Closed Bug 854761 Opened 12 years ago Closed 12 years ago

Remove previous bookmark calls from PlacesUtils

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: andreshm, Assigned: andreshm)

References

Details

Attachments

(2 files, 4 obsolete files)

After all BookmarkJSONUtils.jsm calls are updated, remove all previous code left in Places.
Status: NEW → ASSIGNED
Depends on: 854288
Bug 854288 handles all import calls, this bug handles export calls.
(In reply to Andres Hernandez [:andreshm] from comment #1) > Bug 854288 handles all import calls, this bug handles export calls. PlacesUtils.backups.saveBookmarksToJSONFile is replaced by BookmarkJSONUtils.exportToFile in bug 852041. Then, PlacesUtils.backups would be handled by bug 857429, therefore, no work is required in this bug.
No longer blocks: 852032
Depends on: 857429
(In reply to Raymond Lee [:raymondlee] from comment #2) > (In reply to Andres Hernandez [:andreshm] from comment #1) > > Bug 854288 handles all import calls, this bug handles export calls. > > PlacesUtils.backups.saveBookmarksToJSONFile is replaced by > BookmarkJSONUtils.exportToFile in bug 852041. Then, PlacesUtils.backups > would be handled by bug 857429, therefore, no work is required in this bug. After checking the code, PlacesUtils.serializeNodeAsJSONToOutputStream does the same thing as BookmarkNode.serializeAsJSONToOutputStream so I guess we should depreciate PlacesUtils.serializeNodeAsJSONToOutputStream and wrap it with the BookmarkNode.serializeAsJSONToOutputStream. Andres: can you confirm that please?
Flags: needinfo?(andres)
(In reply to Raymond Lee [:raymondlee] from comment #3) > (In reply to Raymond Lee [:raymondlee] from comment #2) > > (In reply to Andres Hernandez [:andreshm] from comment #1) > > > Bug 854288 handles all import calls, this bug handles export calls. > > > > PlacesUtils.backups.saveBookmarksToJSONFile is replaced by > > BookmarkJSONUtils.exportToFile in bug 852041. Then, PlacesUtils.backups > > would be handled by bug 857429, therefore, no work is required in this bug. > > > After checking the code, PlacesUtils.serializeNodeAsJSONToOutputStream does > the same thing as BookmarkNode.serializeAsJSONToOutputStream so I guess we > should depreciate PlacesUtils.serializeNodeAsJSONToOutputStream and wrap it > with the BookmarkNode.serializeAsJSONToOutputStream. > > Andres: can you confirm that please? That's right, but this bug depends on changes apply on bug 855842 in order to avoid conflicts. I'll work on those changes.
Depends on: 855842
Flags: needinfo?(andres)
Attached patch Patch v1 (obsolete) — Splinter Review
Attachment #738900 - Flags: review?(mak77)
Comment on attachment 738900 [details] [diff] [review] Patch v1 Review of attachment 738900 [details] [diff] [review]: ----------------------------------------------------------------- there is a call in /services/sync/tps/extensions/tps/modules/bookmarks.jsm that is unhandled here ::: toolkit/components/places/BookmarkJSONUtils.jsm @@ +118,5 @@ > + let deferred = Promise.defer(); > + Services.tm.mainThread.dispatch(function() { > + BookmarkNode.serializeAsJSONToOutputStream( > + aNode, aStream, aIsUICommand, aResolveShortcuts, aExcludeItems); > + deferred.resolve(); please try/catch and handle exceptions with a reject ::: toolkit/components/places/PlacesUtils.jsm @@ +562,5 @@ > + if (shouldClose) > + node.containerOpen = false; > + > + return writer.value; > + }); unfortunately we cannot do this... and I'm not sure we have a solution off-hand since wrapNode is totally synchronous... this should probably keep using the synchronous version for now, you should move the body of serializeNodeAsJSONToOutputStream to a "private" method ( _ prefix) and invoke the private method from the deprecated serializeNodeAsJSONToOutputStream and from here (so that wrapNode won't cause the deprecation). We'll re-evaluate this once we are done with moving APIs.
Attachment #738900 - Flags: review?(mak77)
Attached patch Patch v2 (obsolete) — Splinter Review
Attachment #738900 - Attachment is obsolete: true
Attachment #740673 - Flags: review?(mak77)
(In reply to Andres Hernandez [:andreshm] from comment #7) > Created attachment 740673 [details] [diff] [review] > Patch v2 The patch in bug 860625 touches BookmarkNode.serializeAsJSONToOutputStream so it's best to wait for it to land first.
Depends on: 860625
Blocks: 846644
Comment on attachment 740673 [details] [diff] [review] Patch v2 please, re-flag once bug 860625 lands and this has been unbitrotted against that.
Attachment #740673 - Flags: review?(mak77)
Attached patch Part 1: toolkit/ component v3 (obsolete) — Splinter Review
bug 860625 is in mozilla-inbound so I just updated this patch. Splitting the previous patch into two as one part is for services/sync/
Attachment #740673 - Attachment is obsolete: true
Attachment #755787 - Flags: review?(mak77)
Attached patch Part 2: services/sync (obsolete) — Splinter Review
Patch for services/sync. I have run the tps tests and the following test failed before and after applying the patch so I guess it's ok. TEST-UNEXPECTED-FAIL | test_tabs.js | [phase3] Exception caught: ASSERTION FAILED! error locating tab No traceback available
Attachment #755828 - Flags: review?(rnewman)
Attachment #755828 - Flags: review?(rnewman) → review+
Attachment #755787 - Flags: review?(mak77) → review+
Attached patch Part 1: v4Splinter Review
Attachment #755787 - Attachment is obsolete: true
Attached patch Part 2: v4Splinter Review
Attachment #755828 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: