Bug 660753 - Don't spin the event loop in the history tracker. r=rnewman

This commit is contained in:
Philipp von Weitershausen 2011-06-08 17:10:29 +02:00
Родитель fa8e807b68
Коммит a3d9e024c6
1 изменённых файлов: 13 добавлений и 25 удалений

Просмотреть файл

@ -419,14 +419,8 @@ HistoryTracker.prototype = {
}
},
_GUIDForUri: function _GUIDForUri(uri, create) {
// Isn't indirection fun...
return Engines.get("history")._store.GUIDForUri(uri, create);
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsINavHistoryObserver,
Ci.nsINavHistoryObserver_MOZILLA_1_9_1_ADDITIONS,
Ci.nsISupportsWeakReference
]),
@ -442,31 +436,25 @@ HistoryTracker.prototype = {
this.score += 1;
},
onVisit: function HT_onVisit(uri, vid, time, session, referrer, trans) {
onVisit: function HT_onVisit(uri, vid, time, session, referrer, trans, guid) {
if (this.ignoreAll)
return;
this._log.trace("onVisit: " + uri.spec);
let self = this;
Utils.delay(function() {
if (self.addChangedID(self._GUIDForUri(uri, true))) {
self._upScore();
}
}, 0);
},
onDeleteVisits: function onDeleteVisits() {
},
onPageExpired: function HT_onPageExpired(uri, time, entry) {
},
onBeforeDeleteURI: function onBeforeDeleteURI(uri) {
if (this.ignoreAll)
return;
this._log.trace("onBeforeDeleteURI: " + uri.spec);
let self = this;
if (this.addChangedID(this._GUIDForUri(uri, true))) {
if (this.addChangedID(guid)) {
this._upScore();
}
},
onDeleteURI: function HT_onDeleteURI(uri) {
onDeleteVisits: function onDeleteVisits() {
},
onBeforeDeleteURI: function onBeforeDeleteURI(uri, guid) {
if (this.ignoreAll)
return;
this._log.trace("onBeforeDeleteURI: " + uri.spec);
if (this.addChangedID(guid)) {
this._upScore();
}
},
onDeleteURI: function HT_onDeleteURI(uri, guid) {
},
onClearHistory: function HT_onClearHistory() {
this._log.trace("onClearHistory");