зеркало из https://github.com/mozilla/gecko-dev.git
Bug 895543 - part 1: cache SourceClient instances; r=robcee
This commit is contained in:
Родитель
e9069b15ab
Коммит
79e6109df6
|
@ -1581,16 +1581,16 @@ ThreadClient.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* Invalidate pause-lifetime grip clients and clear the list of
|
||||
* current grip clients.
|
||||
* Invalidate pause-lifetime grip clients and clear the list of current grip
|
||||
* clients.
|
||||
*/
|
||||
_clearPauseGrips: function TC_clearPauseGrips() {
|
||||
this._clearGripClients("_pauseGrips");
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate pause-lifetime grip clients and clear the list of
|
||||
* current grip clients.
|
||||
* Invalidate thread-lifetime grip clients and clear the list of current grip
|
||||
* clients.
|
||||
*/
|
||||
_clearThreadGrips: function TC_clearPauseGrips() {
|
||||
this._clearGripClients("_threadGrips");
|
||||
|
@ -1612,7 +1612,12 @@ ThreadClient.prototype = {
|
|||
* Return an instance of SourceClient for the given source actor form.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче