Bug 521285 - remove app-wide microsummary generator support (r=marco)
authorDietrich Ayala <dietrich@mozilla.com>
Fri, 22 Jan 2010 08:55:58 -0800
changeset 37405 b99be55d43f770905cfc4245f483adbc0fe06cdf
parent 37404 97745a2b2de9ca2af6922866dd16f50b91a31e60
child 37406 9f2860ad939ee76ac60af76e309510cd65c44675
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)
reviewersmarco
bugs521285
milestone1.9.3a1pre
Bug 521285 - remove app-wide microsummary generator support (r=marco)
browser/components/dirprovider/DirectoryProvider.cpp
browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h
browser/components/dirprovider/tests/unit/test_keys.js
browser/components/microsummaries/src/nsMicrosummaryService.js
--- a/browser/components/dirprovider/DirectoryProvider.cpp
+++ b/browser/components/dirprovider/DirectoryProvider.cpp
@@ -94,25 +94,16 @@ DirectoryProvider::GetFile(const char *a
     rv = NS_GetSpecialDirectory(NS_APP_DEFAULTS_50_DIR,
                                 getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
 
     file->AppendNative(NS_LITERAL_CSTRING("existing-profile-defaults.js"));
     file.swap(*aResult);
     return NS_OK;
   }
-  else if (!strcmp(aKey, NS_APP_MICROSUMMARY_DIR)) {
-    rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
-                                getter_AddRefs(file));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    file->AppendNative(NS_LITERAL_CSTRING("microsummary-generators"));
-    file.swap(*aResult);
-    return NS_OK;
-  }
   else if (!strcmp(aKey, NS_APP_USER_MICROSUMMARY_DIR)) {
     rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
                                 getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
 
     file->AppendNative(NS_LITERAL_CSTRING("microsummary-generators"));
     file.swap(*aResult);
     return NS_OK;
--- a/browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h
+++ b/browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h
@@ -47,17 +47,16 @@
 // General application properties are defined in nsAppDirectoryServiceDefs.h.
 //
 //=============================================================================
 
 // ----------------------------------------------------------------------------
 // Files and directories that exist on a per-browser basis.
 // ----------------------------------------------------------------------------
 
-#define NS_APP_MICROSUMMARY_DIR                 "MicsumGens"
 #define NS_APP_EXISTING_PREF_OVERRIDE           "ExistingPrefOverride"
 
 // ----------------------------------------------------------------------------
 // Files and directories that exist on a per-profile basis.
 // ----------------------------------------------------------------------------
 
 #define NS_APP_USER_MICROSUMMARY_DIR            "UsrMicsumGens"
          
--- a/browser/components/dirprovider/tests/unit/test_keys.js
+++ b/browser/components/dirprovider/tests/unit/test_keys.js
@@ -48,24 +48,16 @@ function test_usr_micsum() {
 
   let tfile = writeTestFile(tmdir, "usrmicsum");
   do_check_true(tfile.exists());
 
   mdir.append(tfile.leafName);
   do_check_true(mdir.exists());
 }
 
-function test_app_micsum() {
-  let mdir = gDirSvc.get("XCurProcD", Ci.nsIFile);
-  mdir.append("microsummary-generators");
-
-  let tmdir = gDirSvc.get("MicsumGens", Ci.nsIFile);
-  do_check_true(tmdir.equals(mdir));
-}
-
 function test_bookmarkhtml() {
   let bmarks = gProfD.clone();
   bmarks.append("bookmarks.html");
 
   let tbmarks = gDirSvc.get("BMarks", Ci.nsIFile);
   do_check_true(bmarks.equals(tbmarks));
 }
 
@@ -74,17 +66,16 @@ function test_prefoverride() {
   dir.append("existing-profile-defaults.js");
 
   let tdir = gDirSvc.get("ExistingPrefOverride", Ci.nsIFile);
   do_check_true(dir.equals(tdir));
 }
 
 function run_test() {
   [test_usr_micsum,
-   test_app_micsum,
    test_bookmarkhtml,
    test_prefoverride
   ].forEach(function(f) {
     do_test_pending();
     print("Running test: " + f.name);
     f();
     do_test_finished();
   });
--- a/browser/components/microsummaries/src/nsMicrosummaryService.js
+++ b/browser/components/microsummaries/src/nsMicrosummaryService.js
@@ -261,25 +261,20 @@ MicrosummaryService.prototype = {
                   Date.now() + (microsummary.updateInterval || this._updateInterval));
   },
 
   /**
    * Load local generators into the cache.
    * 
    */
   _cacheLocalGenerators: function MSS__cacheLocalGenerators() {
-    // Load generators from the application directory.
-    var appDir = this._dirs.get("MicsumGens", Ci.nsIFile);
-    if (appDir.exists())
-      this._cacheLocalGeneratorDir(appDir);
-
     // Load generators from the user's profile.
-    var profileDir = this._dirs.get("UsrMicsumGens", Ci.nsIFile);
-    if (profileDir.exists())
-      this._cacheLocalGeneratorDir(profileDir);
+    var msDir = this._dirs.get("UsrMicsumGens", Ci.nsIFile);
+    if (msDir.exists())
+      this._cacheLocalGeneratorDir(msDir);
   },
 
   /**
    * Load local generators from a directory into the cache.
    *
    * @param   dir
    *          nsIFile object pointing to directory containing generator files
    *