mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 854761 - Part 2: Remove previous bookmark calls from PlacesUtils - Sync. r=rnewman
This commit is contained in:
parent
e89af5938a
commit
2bf4ba49f2
@ -17,6 +17,8 @@ const CU = Components.utils;
|
||||
CU.import("resource://tps/logger.jsm");
|
||||
CU.import("resource://gre/modules/Services.jsm");
|
||||
CU.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
CU.import("resource://services-common/async.js");
|
||||
|
||||
var DumpBookmarks = function TPS_Bookmarks__DumpBookmarks() {
|
||||
@ -33,9 +35,14 @@ var DumpBookmarks = function TPS_Bookmarks__DumpBookmarks() {
|
||||
query.setFolders([PlacesUtils.placesRootId], 1);
|
||||
let root = PlacesUtils.history.executeQuery(query, options).root;
|
||||
root.containerOpen = true;
|
||||
PlacesUtils.serializeNodeAsJSONToOutputStream(root, writer, true, false);
|
||||
let value = JSON.parse(writer.value);
|
||||
Logger.logInfo("dumping bookmarks\n\n" + JSON.stringify(value, null, ' ') + "\n\n");
|
||||
let cb = Async.makeSpinningCallback();
|
||||
Task.spawn(function() {
|
||||
yield BookmarkJSONUtils.serializeNodeAsJSONToOutputStream(root, writer, true, false);
|
||||
let value = JSON.parse(writer.value);
|
||||
Logger.logInfo("dumping bookmarks\n\n" + JSON.stringify(value, null, ' ') + "\n\n");
|
||||
cb();
|
||||
});
|
||||
cb.wait();
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user