Bug 407843 - There's no point in passing a bms to lms.createLivemarkFolderOnly/lms._createFolder, r=dietrich, a=schrep
authorphilringnalda@gmail.com
Fri, 08 Feb 2008 20:41:35 -0800
changeset 11445 baae709ff852fc0b586b7066bf3ae2a5d03d3207
parent 11444 fb3d71f8e695d7ec7e5507a0fe35b2a13567fdc5
child 11446 944d192947482a1e5983c5cec4864a7bfcd0dbe0
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich, schrep
bugs407843
milestone1.9b4pre
Bug 407843 - There's no point in passing a bms to lms.createLivemarkFolderOnly/lms._createFolder, r=dietrich, a=schrep
browser/components/places/src/nsPlacesImportExportService.cpp
toolkit/components/places/public/nsILivemarkService.idl
toolkit/components/places/src/nsLivemarkService.js
toolkit/components/places/tests/bookmarks/test_livemarks.js
toolkit/components/places/tests/chrome/test_341972a.xul
toolkit/components/places/tests/chrome/test_341972b.xul
toolkit/components/places/tests/chrome/test_342484.xul
toolkit/components/places/tests/unit/test_exclude_livemarks.js
--- a/browser/components/places/src/nsPlacesImportExportService.cpp
+++ b/browser/components/places/src/nsPlacesImportExportService.cpp
@@ -1028,23 +1028,22 @@ BookmarkContentSink::HandleLinkEnd()
         NS_ASSERTION(NS_SUCCEEDED(rv), "SetFeedURI failed!");
         rv = mBookmarksService->SetItemTitle(frame.mPreviousId, NS_ConvertUTF16toUTF8(frame.mPreviousText));
         NS_ASSERTION(NS_SUCCEEDED(rv), "SetItemTitle failed!");
       }
     }
 
     if (!isLivemark) {
       if (mIsImportDefaults) {
-        rv = mLivemarkService->CreateLivemarkFolderOnly(mBookmarksService,
-                                                   frame.mContainerID,
-                                                   frame.mPreviousText,
-                                                   frame.mPreviousLink,
-                                                   frame.mPreviousFeed,
-                                                   -1,
-                                                   &frame.mPreviousId);
+        rv = mLivemarkService->CreateLivemarkFolderOnly(frame.mContainerID,
+                                                        frame.mPreviousText,
+                                                        frame.mPreviousLink,
+                                                        frame.mPreviousFeed,
+                                                        -1,
+                                                        &frame.mPreviousId);
         NS_ASSERTION(NS_SUCCEEDED(rv), "CreateLivemarkFolderOnly failed!");
       } else {
         rv = mLivemarkService->CreateLivemark(frame.mContainerID,
                                          frame.mPreviousText,
                                          frame.mPreviousLink,
                                          frame.mPreviousFeed,
                                          -1,
                                          &frame.mPreviousId);
--- a/toolkit/components/places/public/nsILivemarkService.idl
+++ b/toolkit/components/places/public/nsILivemarkService.idl
@@ -37,17 +37,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 interface nsIURI;
 interface nsINavBookmarksService;
 
-[scriptable, uuid(7879747e-8871-4a7b-9032-5c4fff1d6017)]
+[scriptable, uuid(0b0985c7-f34b-447a-8d52-ebfb7da94a6a)]
 interface nsILivemarkService : nsISupports
 {
   /**
    * Starts the livemark refresh timer.
    * Being able to manually control this allows activity such
    * as bookmarks import to occur without kicking off HTTP traffic.
    */
   void start();
@@ -65,18 +65,17 @@ interface nsILivemarkService : nsISuppor
                            in AString name,
                            in nsIURI siteURI,
                            in nsIURI feedURI,
                            in long index);
 
   /**
    * Same as above, use during startup to avoid HTTP traffic
    */
-  long long createLivemarkFolderOnly(in nsINavBookmarksService bms,
-                                     in long long folder,
+  long long createLivemarkFolderOnly(in long long folder,
                                      in AString name,
                                      in nsIURI siteURI,
                                      in nsIURI feedURI,
                                      in long index);
 
   /**
    * Determines whether the folder with the given folder ID identifies
    * a livemark container.
--- a/toolkit/components/places/src/nsLivemarkService.js
+++ b/toolkit/components/places/src/nsLivemarkService.js
@@ -303,44 +303,41 @@ LivemarkService.prototype = {
     livemark.loadGroup = loadgroup;
   },
 
   createLivemark: function LS_createLivemark(folder, name, siteURI,
                                              feedURI, index) {
     // Don't add livemarks to livemarks
     if (this.isLivemark(folder))
       throw Cr.NS_ERROR_INVALID_ARG;
-    var livemarkID = this._createFolder(this._bms, folder, name, siteURI,
-                                        feedURI, index);
+    var livemarkID = this._createFolder(folder, name, siteURI, feedURI, index);
 
     // kick off http fetch
     this._updateLivemarkChildren(
       this._pushLivemark(livemarkID, feedURI) - 1,
       false
     );
 
     return livemarkID;
   },
 
   createLivemarkFolderOnly:
-  function LS_createLivemarkFolderOnly(bms, folder, name, siteURI,
-                                       feedURI, index) {
-    var livemarkID = this._createFolder(bms, folder, name, siteURI, feedURI,
-                                        index);
+  function LS_createLivemarkFolderOnly(folder, name, siteURI, feedURI, index) {
+    var livemarkID = this._createFolder(folder, name, siteURI, feedURI, index);
     this._pushLivemark(livemarkID, feedURI);
     var livemarkIndex = this._getLivemarkIndex(livemarkID);
     var livemark = this._livemarks[livemarkIndex];
-    this.insertLivemarkLoadingItem(bms, livemark);
+    this.insertLivemarkLoadingItem(this._bms, livemark);
 
     return livemarkID;
   },
 
   _createFolder:
-  function LS__createFolder(bms, folder, name, siteURI, feedURI, index) {
-    var livemarkID = bms.createFolder(folder, name, index);
+  function LS__createFolder(folder, name, siteURI, feedURI, index) {
+    var livemarkID = this._bms.createFolder(folder, name, index);
     this._bms.setFolderReadonly(livemarkID, true);
 
     // Add an annotation to map the folder id to the livemark feed URI
     this._ans.setItemAnnotation(livemarkID, LMANNO_FEEDURI, feedURI.spec, 0,
                                 this._ans.EXPIRE_NEVER);
 
     if (siteURI) {
       // Add an annotation to map the folder URI to the livemark site URI
--- a/toolkit/components/places/tests/bookmarks/test_livemarks.js
+++ b/toolkit/components/places/tests/bookmarks/test_livemarks.js
@@ -54,17 +54,17 @@ try {
 }
 
 // get bookmarks root index
 var root = bmsvc.bookmarksRoot;
 
 // main
 function run_test() {
   var livemarkId = 
-    lmsvc.createLivemarkFolderOnly(bmsvc, root, "foo",
+    lmsvc.createLivemarkFolderOnly(root, "foo",
                                    uri("http://example.com/"),
                                    uri("http://example.com/rss.xml"), -1);
 
   do_check_true(lmsvc.isLivemark(livemarkId));
   do_check_true(lmsvc.getSiteURI(livemarkId).spec == "http://example.com/");
   do_check_true(lmsvc.getFeedURI(livemarkId).spec == "http://example.com/rss.xml");
   do_check_true(bmsvc.getFolderReadonly(livemarkId));
 
--- a/toolkit/components/places/tests/chrome/test_341972a.xul
+++ b/toolkit/components/places/tests/chrome/test_341972a.xul
@@ -64,17 +64,17 @@ var observer =
   onPageAnnotationSet: function(aUri, aAnnotationName) {},
   onPageAnnotationRemoved: function(aUri, aAnnotationName) {}
 };
 
 const FEEDSPEC = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
 const INITIALSITESPEC = "http://localhost:8888/";
 const FEEDSITESPEC = "http://example.org/"; 
 
-gLivemarkId = lmsvc.createLivemarkFolderOnly(bmsvc, toolbarFolderId, "foo",
+gLivemarkId = lmsvc.createLivemarkFolderOnly(toolbarFolderId, "foo",
                                              uri(INITIALSITESPEC),
                                              uri(FEEDSPEC), -1);
 annosvc.addObserver(observer, false);
 lmsvc.reloadLivemarkFolder(gLivemarkId);
 
 ]]>
 </script>
 
--- a/toolkit/components/places/tests/chrome/test_341972b.xul
+++ b/toolkit/components/places/tests/chrome/test_341972b.xul
@@ -64,17 +64,17 @@ var observer =
   onItemAnnotationRemoved: function(aItemId, aAnnotationName) {},
   onPageAnnotationSet: function(aUri, aAnnotationName) {},
   onPageAnnotationRemoved: function(aUri, aAnnotationName) {}
 };
 
 const FEEDSPEC = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
 const FEEDSITESPEC = "http://example.org/"; 
 
-gLivemarkId = lmsvc.createLivemarkFolderOnly(bmsvc, toolbarFolderId, "foo",
+gLivemarkId = lmsvc.createLivemarkFolderOnly(toolbarFolderId, "foo",
                                              null, uri(FEEDSPEC), -1);
 annosvc.addObserver(observer, false);
 lmsvc.reloadLivemarkFolder(gLivemarkId);
 
 ]]>
 </script>
 
 </window>
--- a/toolkit/components/places/tests/chrome/test_342484.xul
+++ b/toolkit/components/places/tests/chrome/test_342484.xul
@@ -80,17 +80,17 @@ function runTest() {
   rootNode.containerOpen = false;
   bmsvc.removeFolder(gLivemarkId);
   SimpleTest.finish();
 }
 
 var root = bmsvc.bookmarksRoot;
 const FEEDSPEC = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/bad_links.atom";
 
-gLivemarkId = lmsvc.createLivemarkFolderOnly(bmsvc, toolbarFolderId, "foo",
-                                            uri("http:/localhost/"),
-                                            uri(FEEDSPEC), -1);
+gLivemarkId = lmsvc.createLivemarkFolderOnly(toolbarFolderId, "foo",
+                                             uri("http:/localhost/"),
+                                             uri(FEEDSPEC), -1);
 bmsvc.addObserver(observer, false);
 lmsvc.reloadLivemarkFolder(gLivemarkId);
 ]]>
 </script>
 
 </window>
--- a/toolkit/components/places/tests/unit/test_exclude_livemarks.js
+++ b/toolkit/components/places/tests/unit/test_exclude_livemarks.js
@@ -62,17 +62,17 @@ try {
 }
 
 // get bookmarks root index
 var root = bmsvc.bookmarksRoot;
 
 // main
 function run_test() {
   var livemarkId = 
-    lmsvc.createLivemarkFolderOnly(bmsvc, root, "foo",
+    lmsvc.createLivemarkFolderOnly(root, "foo",
                                    uri("http://example.com/"),
                                    uri("http://example.com/rss.xml"), -1);
 
   do_check_true(lmsvc.isLivemark(livemarkId));
   do_check_true(lmsvc.getSiteURI(livemarkId).spec == "http://example.com/");
   do_check_true(lmsvc.getFeedURI(livemarkId).spec == "http://example.com/rss.xml");
   var livemarkItem = bmsvc.insertBookmark(livemarkId, uri("http://example.com/item1.html"), bmsvc.DEFAULT_INDEX, "item 1");