Backout 66a04865fe51 (bug 827050) for xpcshell orange on a CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Mon, 07 Jan 2013 11:37:10 +0000
changeset 123488 510b15b4d139a7179741ec60f1bc297fe481d137
parent 123487 3e5257f5f4a60c7b306389533d872c0105a4e7f0
child 123489 fa6cb5761ae0212c600549f356fc6e070aea2e37
push id3129
push userakeybl@mozilla.com
push dateMon, 07 Jan 2013 22:54:45 +0000
treeherdermozilla-aurora@090bc89ff6b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs827050
milestone20.0a1
backs out66a04865fe51b954645cbc9b4a16f775682461c8
Backout 66a04865fe51 (bug 827050) for xpcshell orange on a CLOSED TREE
extensions/cookie/nsPermissionManager.cpp
extensions/cookie/nsPermissionManager.h
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -333,18 +333,16 @@ nsPermissionManager::Init()
   nsresult rv;
 
   mPermissionTable.Init();
 
   mObserverService = do_GetService("@mozilla.org/observer-service;1", &rv);
   if (NS_SUCCEEDED(rv)) {
     mObserverService->AddObserver(this, "profile-before-change", true);
     mObserverService->AddObserver(this, "profile-do-change", true);
-    mObserverService->AddObserver(this, "webapps-clear-data", true);
-
   }
 
   if (IsChildProcess()) {
     // Get the permissions from the parent process
     InfallibleTArray<IPC::Permission> perms;
     ChildProcess()->SendReadPermissions(&perms);
 
     for (uint32_t i = 0; i < perms.Length(); i++) {
@@ -1123,39 +1121,16 @@ NS_IMETHODIMP nsPermissionManager::Obser
     } else {
       RemoveAllFromMemory();
       CloseDB(false);
     }
   }
   else if (!nsCRT::strcmp(aTopic, "profile-do-change")) {
     // the profile has already changed; init the db from the new location
     InitDB(false);
-  } else if (!nsCRT::strcmp(aTopic, "webapps-clear-data")) {
-    nsCOMPtr<mozIApplicationClearPrivateDataParams> params =
-      do_QueryInterface(aSubject);
-    if (!params) {
-      NS_ERROR("'webapps-clear-data' notification's subject should be a mozIApplicationClearPrivateDataParams");
-      return NS_ERROR_UNEXPECTED;
-    }
-
-    uint32_t appId;
-    nsresult rv = params->GetAppId(&appId);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    bool browserOnly;
-    rv = params->GetBrowserOnly(&browserOnly);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // If browserOnly if false, it probably means that we are disinstalling
-    // the app, so we can just ignore this event.
-    if (!browserOnly) {
-      return NS_OK;
-    }
-
-    return RemovePermissionsForApp(appId, true);
   }
 
   return NS_OK;
 }
 
 PLDHashOperator
 nsPermissionManager::GetPermissionsForApp(nsPermissionManager::PermissionHashKey* entry, void* arg)
 {
@@ -1178,42 +1153,31 @@ nsPermissionManager::GetPermissionsForAp
   }
 
   return PL_DHASH_NEXT;
 }
 
 NS_IMETHODIMP
 nsPermissionManager::RemovePermissionsForApp(uint32_t aAppId)
 {
-  return RemovePermissionsForApp(aAppId, false);
-}
-
-nsresult
-nsPermissionManager::RemovePermissionsForApp(uint32_t aAppId, bool aBrowserOnly)
-{
   ENSURE_NOT_CHILD_PROCESS;
   NS_ENSURE_ARG(aAppId != nsIScriptSecurityManager::NO_APP_ID);
 
   // We begin by removing all the permissions from the DB.
   // After clearing the DB, we call AddInternal() to make sure that all
   // processes are aware of this change and the representation of the DB in
   // memory is updated.
   // We have to get all permissions associated with an application and then
   // remove those because doing so in EnumerateEntries() would fail because
   // we might happen to actually delete entries from the list.
 
   nsAutoCString sql;
   sql.AppendLiteral("DELETE FROM moz_hosts WHERE appId=");
   sql.AppendInt(aAppId);
 
-  if (aBrowserOnly) {
-    sql.AppendLiteral(" AND isInBrowserElement=");
-    sql.AppendInt(true);
-  }
-
   nsCOMPtr<mozIStorageAsyncStatement> removeStmt;
   nsresult rv = mDBConn->CreateAsyncStatement(sql, getter_AddRefs(removeStmt));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<mozIStoragePendingStatement> pending;
   rv = removeStmt->ExecuteAsync(nullptr, getter_AddRefs(pending));
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/extensions/cookie/nsPermissionManager.h
+++ b/extensions/cookie/nsPermissionManager.h
@@ -244,18 +244,16 @@ private:
                        const nsACString& aHost,
                        const nsACString& aType,
                        uint32_t aPermission,
                        uint32_t aExpireType,
                        int64_t aExpireTime,
                        uint32_t aAppId,
                        bool aIsInBrowserElement);
 
-  nsresult RemovePermissionsForApp(uint32_t aAppId, bool aBrowserOnly);
-
   nsresult RemoveExpiredPermissionsForApp(uint32_t aAppId);
 
   /**
    * This struct has to be passed as an argument to GetPermissionsForApp.
    * |appId| has to be defined.
    * |permissions| will be filed with permissions that are related to the app.
    */
   struct GetPermissionsForAppStruct {