зеркало из https://github.com/mozilla/gecko-dev.git
Bug 897954: Remove onBeginUpdateBatch and onEndUpdateBatch functions. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D105441
This commit is contained in:
Родитель
88810c4c22
Коммит
9f8f7cf96f
|
@ -2396,9 +2396,6 @@ var BookmarkingUI = {
|
|||
}
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onBeforeItemRemoved() {},
|
||||
onItemMoved(
|
||||
aItemId,
|
||||
aProperty,
|
||||
|
|
|
@ -126,9 +126,6 @@ let observer = new (class extends EventEmitter {
|
|||
this.handlePlacesEvents = this.handlePlacesEvents.bind(this);
|
||||
}
|
||||
|
||||
onBeginUpdateBatch() {}
|
||||
onEndUpdateBatch() {}
|
||||
|
||||
handlePlacesEvents(events) {
|
||||
for (let event of events) {
|
||||
switch (event.type) {
|
||||
|
|
|
@ -56,10 +56,6 @@ class BookmarksObserver extends Observer {
|
|||
}
|
||||
|
||||
// Empty functions to make xpconnect happy
|
||||
onBeginUpdateBatch() {}
|
||||
|
||||
onEndUpdateBatch() {}
|
||||
|
||||
onItemMoved() {}
|
||||
|
||||
// Disabled due to performance cost, see Issue 3203 /
|
||||
|
|
|
@ -988,8 +988,6 @@ var PlacesUIUtils = {
|
|||
return;
|
||||
}
|
||||
|
||||
resultNode = resultNode.QueryInterface(Ci.nsINavBookmarkObserver);
|
||||
|
||||
if (itemsBeingChanged > ITEM_CHANGED_BATCH_NOTIFICATION_THRESHOLD) {
|
||||
resultNode.onBeginUpdateBatch();
|
||||
}
|
||||
|
@ -1183,8 +1181,6 @@ var PlacesUIUtils = {
|
|||
|
||||
// This listener is for tracking bookmark moves
|
||||
let placesUtilsBookmarksObserver = {
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemChanged() {},
|
||||
onItemMoved(
|
||||
aItemId,
|
||||
|
|
|
@ -1294,9 +1294,6 @@ var gEditItemOverlay = {
|
|||
);
|
||||
});
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
};
|
||||
|
||||
XPCOMUtils.defineLazyGetter(gEditItemOverlay, "_folderTree", () => {
|
||||
|
|
|
@ -6,8 +6,6 @@ add_task(async function() {
|
|||
function promiseOnItemChanged() {
|
||||
return new Promise(resolve => {
|
||||
PlacesUtils.bookmarks.addObserver({
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemMoved() {},
|
||||
onItemChanged(id, property, isAnno, value) {
|
||||
PlacesUtils.bookmarks.removeObserver(this);
|
||||
|
|
|
@ -209,9 +209,6 @@ var bookmarksObserver = {
|
|||
]);
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
|
||||
onItemChanged(
|
||||
itemId,
|
||||
property,
|
||||
|
|
|
@ -795,8 +795,6 @@ BookmarksStore.prototype = {
|
|||
// to bump the score, so that changed bookmarks are synced immediately.
|
||||
function BookmarksTracker(name, engine) {
|
||||
Tracker.call(this, name, engine);
|
||||
this._batchDepth = 0;
|
||||
this._batchSawScoreIncrement = false;
|
||||
}
|
||||
BookmarksTracker.prototype = {
|
||||
__proto__: Tracker.prototype,
|
||||
|
@ -862,14 +860,9 @@ BookmarksTracker.prototype = {
|
|||
"nsISupportsWeakReference",
|
||||
]),
|
||||
|
||||
/* Every add/remove/change will trigger a sync for MULTI_DEVICE (except in
|
||||
a batch operation, where we do it at the end of the batch) */
|
||||
/* Every add/remove/change will trigger a sync for MULTI_DEVICE */
|
||||
_upScore: function BMT__upScore() {
|
||||
if (this._batchDepth == 0) {
|
||||
this.score += SCORE_INCREMENT_XLARGE;
|
||||
} else {
|
||||
this._batchSawScoreIncrement = true;
|
||||
}
|
||||
this.score += SCORE_INCREMENT_XLARGE;
|
||||
},
|
||||
|
||||
handlePlacesEvents(events) {
|
||||
|
@ -952,16 +945,6 @@ BookmarksTracker.prototype = {
|
|||
this._log.trace("onItemMoved: " + itemId);
|
||||
this._upScore();
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {
|
||||
++this._batchDepth;
|
||||
},
|
||||
onEndUpdateBatch() {
|
||||
if (--this._batchDepth === 0 && this._batchSawScoreIncrement) {
|
||||
this.score += SCORE_INCREMENT_XLARGE;
|
||||
this._batchSawScoreIncrement = false;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -257,7 +257,7 @@ function promiseTimeout(aTime) {
|
|||
* String containing the URI that will be visited.
|
||||
*
|
||||
* @return {Promise}
|
||||
* @resolves Array [aTime, aTransitionType] from nsINavHistoryObserver.onVisit.
|
||||
* @resolves Array [aTime, aTransitionType] from page-visited places event.
|
||||
* @rejects Never.
|
||||
*/
|
||||
function promiseWaitForVisit(aUrl) {
|
||||
|
|
|
@ -62,10 +62,10 @@
|
|||
*
|
||||
*
|
||||
*
|
||||
* Each successful operation notifies through the nsINavHistoryObserver
|
||||
* interface. To listen to such notifications you must register using
|
||||
* nsINavHistoryService `addObserver` and `removeObserver` methods.
|
||||
* @see nsINavHistoryObserver
|
||||
* Each successful operation notifies through the PlacesObservers. To listen to such
|
||||
* notifications you must register using
|
||||
* PlacesObservers `addListener` and `removeListener` methods.
|
||||
* @see PlacesObservers
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = ["History"];
|
||||
|
@ -222,7 +222,7 @@ var History = Object.freeze({
|
|||
/**
|
||||
* Adds a number of visits for a single page.
|
||||
*
|
||||
* Any change may be observed through nsINavHistoryObserver
|
||||
* Any change may be observed through PlacesObservers.
|
||||
*
|
||||
* @param pageInfo: (PageInfo)
|
||||
* Information on a page. This `PageInfo` MUST contain
|
||||
|
@ -269,7 +269,7 @@ var History = Object.freeze({
|
|||
/**
|
||||
* Adds a number of visits for a number of pages.
|
||||
*
|
||||
* Any change may be observed through nsINavHistoryObserver
|
||||
* Any change may be observed through PlacesObservers.
|
||||
*
|
||||
* @param pageInfos: (Array<PageInfo>)
|
||||
* Information on a page. This `PageInfo` MUST contain
|
||||
|
@ -339,7 +339,7 @@ var History = Object.freeze({
|
|||
/**
|
||||
* Remove pages from the database.
|
||||
*
|
||||
* Any change may be observed through nsINavHistoryObserver
|
||||
* Any change may be observed through PlacesObservers.
|
||||
*
|
||||
*
|
||||
* @param page: (URL or nsIURI)
|
||||
|
@ -422,7 +422,7 @@ var History = Object.freeze({
|
|||
/**
|
||||
* Remove visits matching specific characteristics.
|
||||
*
|
||||
* Any change may be observed through nsINavHistoryObserver.
|
||||
* Any change may be observed through PlacesObservers.
|
||||
*
|
||||
* @param filter: (object)
|
||||
* The `object` may contain some of the following
|
||||
|
@ -516,7 +516,7 @@ var History = Object.freeze({
|
|||
/**
|
||||
* Remove pages from the database based on a filter.
|
||||
*
|
||||
* Any change may be observed through nsINavHistoryObserver
|
||||
* Any change may be observed through PlacesObservers
|
||||
*
|
||||
*
|
||||
* @param filter: An object containing a non empty subset of the following
|
||||
|
|
|
@ -934,7 +934,6 @@ nsPlacesExpiration.prototype = {
|
|||
|
||||
QueryInterface: ChromeUtils.generateQI([
|
||||
"nsIObserver",
|
||||
"nsINavHistoryObserver",
|
||||
"nsITimerCallback",
|
||||
"nsISupportsWeakReference",
|
||||
]),
|
||||
|
|
|
@ -2407,9 +2407,6 @@ class BookmarkObserverRecorder {
|
|||
async notifyBookmarkObservers() {
|
||||
MirrorLog.trace("Notifying bookmark observers");
|
||||
let observers = PlacesUtils.bookmarks.getObservers();
|
||||
// ideally we'd send `onBeginUpdateBatch` here (and `onEndUpdateBatch` at
|
||||
// the end) to all observers, but batching is somewhat broken currently.
|
||||
// See bug 1605881 for all the gory details...
|
||||
await Async.yieldingForEach(
|
||||
this.guidChangedArgs,
|
||||
args => {
|
||||
|
|
|
@ -452,9 +452,6 @@ TaggingService.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
|
||||
// nsISupports
|
||||
|
||||
classID: Components.ID("{bbc23860-2553-479d-8b78-94d9038334f7}"),
|
||||
|
|
|
@ -21,21 +21,6 @@ interface nsINavBookmarkObserver : nsISupports
|
|||
*/
|
||||
readonly attribute boolean skipTags;
|
||||
|
||||
/**
|
||||
* Notifies that a batch transaction has started.
|
||||
* Other notifications will be sent during the batch, but the observer is
|
||||
* guaranteed that onEndUpdateBatch() will be called at its completion.
|
||||
* During a batch the observer should do its best to reduce the work done to
|
||||
* handle notifications, since multiple changes are going to happen in a short
|
||||
* timeframe.
|
||||
*/
|
||||
void onBeginUpdateBatch();
|
||||
|
||||
/**
|
||||
* Notifies that a batch transaction has ended.
|
||||
*/
|
||||
void onEndUpdateBatch();
|
||||
|
||||
/**
|
||||
* Notifies that an item's information has changed. This will be called
|
||||
* whenever any attributes like "title" are changed.
|
||||
|
|
|
@ -557,16 +557,7 @@ interface nsINavHistoryResult : nsISupports
|
|||
* are done with a result, since that will avoid unwanted performance hits.
|
||||
*/
|
||||
readonly attribute nsINavHistoryContainerResultNode root;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* DANGER! If you are in the middle of a batch transaction, there may be a
|
||||
* database transaction active. You can still access the DB, but be careful.
|
||||
*/
|
||||
[scriptable, uuid(0f0f45b0-13a1-44ae-a0ab-c6046ec6d4da)]
|
||||
interface nsINavHistoryObserver : nsISupports
|
||||
{
|
||||
/**
|
||||
* Notifies you that a bunch of things are about to change, don't do any
|
||||
* heavy-duty processing until onEndUpdateBatch is called.
|
||||
|
@ -1103,25 +1094,6 @@ interface nsINavHistoryService : nsISupports
|
|||
AUTF8String queryToQueryString(in nsINavHistoryQuery aQuery,
|
||||
in nsINavHistoryQueryOptions options);
|
||||
|
||||
/**
|
||||
* Adds a history observer. If ownsWeak is false, the history service will
|
||||
* keep an owning reference to the observer. If ownsWeak is true, then
|
||||
* aObserver must implement nsISupportsWeakReference, and the history service
|
||||
* will keep a weak reference to the observer.
|
||||
*/
|
||||
void addObserver(in nsINavHistoryObserver observer,
|
||||
[optional] in boolean ownsWeak);
|
||||
|
||||
/**
|
||||
* Removes a history observer.
|
||||
*/
|
||||
void removeObserver(in nsINavHistoryObserver observer);
|
||||
|
||||
/**
|
||||
* Gets an array of registered nsINavHistoryObserver objects.
|
||||
*/
|
||||
Array<nsINavHistoryObserver> getObservers();
|
||||
|
||||
/**
|
||||
* True if history is disabled. currently,
|
||||
* history is disabled if the places.history.enabled pref is false.
|
||||
|
|
|
@ -387,8 +387,7 @@ nsNavHistory::nsNavHistory()
|
|||
mDecayFrecencyPendingCount(0),
|
||||
mTagsFolder(-1),
|
||||
mLastCachedStartOfDay(INT64_MAX),
|
||||
mLastCachedEndOfDay(0),
|
||||
mCanNotify(true)
|
||||
mLastCachedEndOfDay(0)
|
||||
#ifdef XP_WIN
|
||||
,
|
||||
mCryptoProviderInitialized(false)
|
||||
|
@ -1917,48 +1916,6 @@ nsresult nsNavHistory::GetQueryResults(
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistory::AddObserver(nsINavHistoryObserver* aObserver, bool aOwnsWeak) {
|
||||
NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
|
||||
NS_ENSURE_ARG(aObserver);
|
||||
|
||||
if (NS_WARN_IF(!mCanNotify)) return NS_ERROR_UNEXPECTED;
|
||||
|
||||
return mObservers.AppendWeakElementUnlessExists(aObserver, aOwnsWeak);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistory::RemoveObserver(nsINavHistoryObserver* aObserver) {
|
||||
NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
|
||||
NS_ENSURE_ARG(aObserver);
|
||||
|
||||
return mObservers.RemoveWeakElement(aObserver);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistory::GetObservers(
|
||||
nsTArray<RefPtr<nsINavHistoryObserver>>& aObservers) {
|
||||
aObservers.Clear();
|
||||
|
||||
// Clear any cached value, cause it's very likely the consumer has made
|
||||
// changes to history and is now trying to notify them.
|
||||
InvalidateDaysOfHistory();
|
||||
|
||||
if (!mCanNotify) return NS_OK;
|
||||
|
||||
// Then add the other observers.
|
||||
for (uint32_t i = 0; i < mObservers.Length(); ++i) {
|
||||
nsCOMPtr<nsINavHistoryObserver> observer =
|
||||
mObservers.ElementAt(i).GetValue();
|
||||
// Skip nullified weak observers.
|
||||
if (observer) {
|
||||
aObservers.AppendElement(observer.forget());
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistory::GetHistoryDisabled(bool* _retval) {
|
||||
NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
|
||||
|
@ -2156,13 +2113,6 @@ nsNavHistory::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
mDB->Observe(aSubject, aTopic, aData);
|
||||
}
|
||||
|
||||
else if (strcmp(aTopic, TOPIC_PLACES_CONNECTION_CLOSED) == 0) {
|
||||
// Don't even try to notify observers from this point on, the category
|
||||
// cache would init services that could try to use our APIs.
|
||||
mCanNotify = false;
|
||||
mObservers.Clear();
|
||||
}
|
||||
|
||||
else if (strcmp(aTopic, TOPIC_PREF_CHANGED) == 0) {
|
||||
LoadPrefs();
|
||||
}
|
||||
|
|
|
@ -238,13 +238,6 @@ class nsNavHistory final : public nsSupportsWeakReference,
|
|||
|
||||
typedef nsDataHashtable<nsCStringHashKey, nsCString> StringHash;
|
||||
|
||||
/**
|
||||
* Indicates if it is OK to notify history observers or not.
|
||||
*
|
||||
* @return true if it is OK to notify, false otherwise.
|
||||
*/
|
||||
bool canNotify() { return mCanNotify; }
|
||||
|
||||
enum RecentEventFlags {
|
||||
RECENT_TYPED = 1 << 0, // User typed in URL recently
|
||||
RECENT_ACTIVATED = 1 << 1, // User tapped URL link recently
|
||||
|
@ -433,9 +426,6 @@ class nsNavHistory final : public nsSupportsWeakReference,
|
|||
nsNavHistoryQueryOptions* aOptions,
|
||||
nsCOMArray<nsNavHistoryResultNode>* aResults);
|
||||
|
||||
// observers
|
||||
nsMaybeWeakPtrArray<nsINavHistoryObserver> mObservers;
|
||||
|
||||
// effective tld service
|
||||
nsCOMPtr<nsIEffectiveTLDService> mTLDService;
|
||||
nsCOMPtr<nsIIDNService> mIDNService;
|
||||
|
@ -500,9 +490,6 @@ class nsNavHistory final : public nsSupportsWeakReference,
|
|||
int64_t mLastCachedStartOfDay;
|
||||
int64_t mLastCachedEndOfDay;
|
||||
|
||||
// Used to enable and disable the observer notifications
|
||||
bool mCanNotify;
|
||||
|
||||
// Used to cache the call to CryptAcquireContext, which is expensive
|
||||
// when called thousands of times
|
||||
#ifdef XP_WIN
|
||||
|
|
|
@ -1992,11 +1992,9 @@ nsNavHistoryQueryResultNode::GetSkipTags(bool* aSkipTags) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryQueryResultNode::OnBeginUpdateBatch() { return NS_OK; }
|
||||
nsresult nsNavHistoryQueryResultNode::OnBeginUpdateBatch() { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryQueryResultNode::OnEndUpdateBatch() {
|
||||
nsresult nsNavHistoryQueryResultNode::OnEndUpdateBatch() {
|
||||
// If the query has no children it's possible it's not yet listening to
|
||||
// bookmarks changes, in such a case it's safer to force a refresh to gather
|
||||
// eventual new nodes matching query options.
|
||||
|
@ -2990,11 +2988,9 @@ nsNavHistoryFolderResultNode::GetSkipTags(bool* aSkipTags) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryFolderResultNode::OnBeginUpdateBatch() { return NS_OK; }
|
||||
nsresult nsNavHistoryFolderResultNode::OnBeginUpdateBatch() { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNavHistoryFolderResultNode::OnEndUpdateBatch() { return NS_OK; }
|
||||
nsresult nsNavHistoryFolderResultNode::OnEndUpdateBatch() { return NS_OK; }
|
||||
|
||||
nsresult nsNavHistoryFolderResultNode::OnItemAdded(
|
||||
int64_t aItemId, int64_t aParentFolder, int32_t aIndex, uint16_t aItemType,
|
||||
|
@ -3451,7 +3447,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsNavHistoryResult)
|
|||
NS_INTERFACE_MAP_STATIC_AMBIGUOUS(nsNavHistoryResult)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINavHistoryResult)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINavBookmarkObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINavHistoryObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
@ -3513,10 +3508,6 @@ void nsNavHistoryResult::StopObserving() {
|
|||
mIsMobilePrefObserver = false;
|
||||
}
|
||||
if (mIsHistoryObserver) {
|
||||
nsNavHistory* history = nsNavHistory::GetHistoryService();
|
||||
if (history) {
|
||||
history->RemoveObserver(this);
|
||||
}
|
||||
mIsHistoryObserver = false;
|
||||
events.AppendElement(PlacesEventType::History_cleared);
|
||||
events.AppendElement(PlacesEventType::Page_removed);
|
||||
|
@ -3548,9 +3539,6 @@ bool nsNavHistoryResult::CanSkipHistoryDetailsNotifications() const {
|
|||
void nsNavHistoryResult::AddHistoryObserver(
|
||||
nsNavHistoryQueryResultNode* aNode) {
|
||||
if (!mIsHistoryObserver) {
|
||||
nsNavHistory* history = nsNavHistory::GetHistoryService();
|
||||
NS_ASSERTION(history, "Can't create history service");
|
||||
history->AddObserver(this, true);
|
||||
mIsHistoryObserver = true;
|
||||
|
||||
AutoTArray<PlacesEventType, 3> events;
|
||||
|
|
|
@ -77,7 +77,6 @@ class nsNavHistoryResult final
|
|||
: public nsSupportsWeakReference,
|
||||
public nsINavHistoryResult,
|
||||
public nsINavBookmarkObserver,
|
||||
public nsINavHistoryObserver,
|
||||
public mozilla::places::INativePlacesEventCallback {
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYRESULT_IID)
|
||||
|
@ -696,6 +695,9 @@ class nsNavHistoryQueryResultNode final
|
|||
|
||||
virtual void OnRemoving() override;
|
||||
|
||||
nsresult OnBeginUpdateBatch();
|
||||
nsresult OnEndUpdateBatch();
|
||||
|
||||
public:
|
||||
RefPtr<nsNavHistoryQuery> mQuery;
|
||||
uint32_t mLiveUpdate; // one of QUERYUPDATE_* in nsNavHistory.h
|
||||
|
@ -797,6 +799,9 @@ class nsNavHistoryFolderResultNode final
|
|||
|
||||
nsNavHistoryResultNode* FindChildById(int64_t aItemId, uint32_t* aNodeIndex);
|
||||
|
||||
nsresult OnBeginUpdateBatch();
|
||||
nsresult OnEndUpdateBatch();
|
||||
|
||||
protected:
|
||||
virtual ~nsNavHistoryFolderResultNode();
|
||||
|
||||
|
|
|
@ -431,17 +431,13 @@ var PlacesTestUtils = Object.freeze({
|
|||
});
|
||||
}
|
||||
|
||||
let iface =
|
||||
type == "bookmarks"
|
||||
? Ci.nsINavBookmarkObserver
|
||||
: Ci.nsINavHistoryObserver;
|
||||
return new Promise(resolve => {
|
||||
let proxifiedObserver = new Proxy(
|
||||
{},
|
||||
{
|
||||
get: (target, name) => {
|
||||
if (name == "QueryInterface") {
|
||||
return ChromeUtils.generateQI([iface]);
|
||||
return ChromeUtils.generateQI([Ci.nsINavBookmarkObserver]);
|
||||
}
|
||||
if (name == notification) {
|
||||
return (...args) => {
|
||||
|
|
|
@ -57,12 +57,6 @@ var gBookmarksObserver = {
|
|||
},
|
||||
|
||||
// nsINavBookmarkObserver
|
||||
onBeginUpdateBatch() {
|
||||
return this.validate("onBeginUpdateBatch", arguments);
|
||||
},
|
||||
onEndUpdateBatch() {
|
||||
return this.validate("onEndUpdateBatch", arguments);
|
||||
},
|
||||
onItemChanged() {
|
||||
return this.validate("onItemChanged", arguments);
|
||||
},
|
||||
|
@ -109,12 +103,6 @@ var gBookmarkSkipObserver = {
|
|||
},
|
||||
|
||||
// nsINavBookmarkObserver
|
||||
onBeginUpdateBatch() {
|
||||
return this.validate("onBeginUpdateBatch", arguments);
|
||||
},
|
||||
onEndUpdateBatch() {
|
||||
return this.validate("onEndUpdateBatch", arguments);
|
||||
},
|
||||
onItemChanged() {
|
||||
return this.validate("onItemChanged", arguments);
|
||||
},
|
||||
|
|
|
@ -24,8 +24,6 @@ const TEST_URI = NetUtil.newURI("http://foo.com");
|
|||
function promiseOnItemChanged() {
|
||||
return new Promise(resolve => {
|
||||
PlacesUtils.bookmarks.addObserver({
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemRemoved() {},
|
||||
onItemMoved() {},
|
||||
|
||||
|
|
|
@ -720,8 +720,6 @@ function do_compare_arrays(a1, a2, sorted) {
|
|||
function NavBookmarkObserver() {}
|
||||
|
||||
NavBookmarkObserver.prototype = {
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemRemoved() {},
|
||||
onItemChanged() {},
|
||||
onItemMoved() {},
|
||||
|
|
|
@ -1023,8 +1023,8 @@ add_task(async function test_title_change_notifies() {
|
|||
});
|
||||
|
||||
add_task(async function test_visit_notifies() {
|
||||
// There are two observers we need to see for each visit. One is an
|
||||
// nsINavHistoryObserver and the other is the uri-visit-saved observer topic.
|
||||
// There are two observers we need to see for each visit. One is an
|
||||
// PlacesObservers and the other is the uri-visit-saved observer topic.
|
||||
let place = {
|
||||
guid: "abcdefghijkl",
|
||||
uri: NetUtil.newURI(TEST_DOMAIN + "test_visit_notifies"),
|
||||
|
|
|
@ -42,13 +42,6 @@ var bookmarksObserver = {
|
|||
}
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {
|
||||
this._beginUpdateBatch = true;
|
||||
},
|
||||
onEndUpdateBatch() {
|
||||
this._endUpdateBatch = true;
|
||||
},
|
||||
|
||||
onItemChanged(
|
||||
id,
|
||||
property,
|
||||
|
|
|
@ -347,8 +347,6 @@ BookmarkObserver.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemChanged(
|
||||
itemId,
|
||||
property,
|
||||
|
|
|
@ -27,8 +27,6 @@ var observer = {
|
|||
this.itemsRemoved = new Map();
|
||||
this.itemsChanged = new Map();
|
||||
this.itemsMoved = new Map();
|
||||
this.beginUpdateBatch = false;
|
||||
this.endUpdateBatch = false;
|
||||
},
|
||||
|
||||
handlePlacesEvents(events) {
|
||||
|
@ -64,14 +62,6 @@ var observer = {
|
|||
}
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {
|
||||
this.beginUpdateBatch = true;
|
||||
},
|
||||
|
||||
onEndUpdateBatch() {
|
||||
this.endUpdateBatch = true;
|
||||
},
|
||||
|
||||
onItemChanged(
|
||||
aItemId,
|
||||
aProperty,
|
||||
|
|
|
@ -52,8 +52,6 @@ add_task(async function run_test() {
|
|||
}
|
||||
},
|
||||
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemMoved() {},
|
||||
};
|
||||
PlacesUtils.bookmarks.addObserver(bookmarksObserver);
|
||||
|
|
Загрузка…
Ссылка в новой задаче