mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 895543 - part 1: cache SourceClient instances; r=robcee
This commit is contained in:
parent
e9069b15ab
commit
79e6109df6
@ -1581,16 +1581,16 @@ ThreadClient.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate pause-lifetime grip clients and clear the list of
|
* Invalidate pause-lifetime grip clients and clear the list of current grip
|
||||||
* current grip clients.
|
* clients.
|
||||||
*/
|
*/
|
||||||
_clearPauseGrips: function TC_clearPauseGrips() {
|
_clearPauseGrips: function TC_clearPauseGrips() {
|
||||||
this._clearGripClients("_pauseGrips");
|
this._clearGripClients("_pauseGrips");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate pause-lifetime grip clients and clear the list of
|
* Invalidate thread-lifetime grip clients and clear the list of current grip
|
||||||
* current grip clients.
|
* clients.
|
||||||
*/
|
*/
|
||||||
_clearThreadGrips: function TC_clearPauseGrips() {
|
_clearThreadGrips: function TC_clearPauseGrips() {
|
||||||
this._clearGripClients("_threadGrips");
|
this._clearGripClients("_threadGrips");
|
||||||
@ -1612,7 +1612,12 @@ ThreadClient.prototype = {
|
|||||||
* Return an instance of SourceClient for the given source actor form.
|
* Return an instance of SourceClient for the given source actor form.
|
||||||
*/
|
*/
|
||||||
source: function TC_source(aForm) {
|
source: function TC_source(aForm) {
|
||||||
return new SourceClient(this._client, aForm);
|
if (aForm.actor in this._threadGrips) {
|
||||||
|
return this._threadGrips[aForm.actor];
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._threadGrips[aForm.actor] = new SourceClient(this._client,
|
||||||
|
aForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user