зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1318206 - Remove some unused code for clearing app data; r=baku,mcmanus
This commit is contained in:
Родитель
9f297a22d4
Коммит
1488007b30
|
@ -6,7 +6,6 @@
|
|||
|
||||
XPIDL_SOURCES += [
|
||||
'mozIApplication.idl',
|
||||
'mozIApplicationClearPrivateDataParams.idl',
|
||||
'nsIAppsService.idl',
|
||||
]
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=8 et :
|
||||
*/
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(ba0e6c8e-8c03-4b9b-8f9b-4fb14216f56e)]
|
||||
interface mozIApplicationClearPrivateDataParams : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long appId;
|
||||
readonly attribute boolean browserOnly;
|
||||
};
|
||||
|
||||
%{C++
|
||||
#define TOPIC_WEB_APP_CLEAR_DATA "webapps-clear-data"
|
||||
#define TOPIC_CLEAR_ORIGIN_DATA "clear-origin-attributes-data"
|
||||
%}
|
|
@ -33,7 +33,6 @@
|
|||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "nsTObserverArray.h"
|
||||
|
||||
class mozIApplicationClearPrivateDataParams;
|
||||
class nsIConsoleReportCollector;
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -78,7 +78,6 @@
|
|||
#include "DOMStorageManager.h"
|
||||
#include "nsJSON.h"
|
||||
#include "nsZipArchive.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/DOMException.h"
|
||||
#include "mozilla/dom/DOMRequest.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "mozilla/Telemetry.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsNetUtilInlines.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "nsCategoryCache.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsHashKeys.h"
|
||||
|
@ -1336,39 +1335,6 @@ NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport)
|
|||
return NS_FAILED(loadingPrincipal->CheckMayLoad(uri, aReport, dataInherits));
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_GetAppInfoFromClearDataNotification(nsISupports *aSubject,
|
||||
uint32_t *aAppID,
|
||||
bool *aBrowserOnly)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<mozIApplicationClearPrivateDataParams>
|
||||
clearParams(do_QueryInterface(aSubject));
|
||||
MOZ_ASSERT(clearParams);
|
||||
if (!clearParams) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
uint32_t appId;
|
||||
rv = clearParams->GetAppId(&appId);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
MOZ_ASSERT(appId != NECKO_UNKNOWN_APP_ID);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (appId == NECKO_UNKNOWN_APP_ID) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
bool browserOnly = false;
|
||||
rv = clearParams->GetBrowserOnly(&browserOnly);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*aAppID = appId;
|
||||
*aBrowserOnly = browserOnly;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
NS_ShouldCheckAppCache(nsIURI *aURI, bool usePrivateBrowsing)
|
||||
{
|
||||
|
|
|
@ -683,15 +683,6 @@ bool NS_GetAppInfo(nsIChannel *aChannel,
|
|||
uint32_t *aAppID,
|
||||
bool *aIsInIsolatedMozBrowserElement);
|
||||
|
||||
/**
|
||||
* Gets appId and browserOnly parameters from the TOPIC_WEB_APP_CLEAR_DATA
|
||||
* nsIObserverService notification. Used when clearing user data or
|
||||
* uninstalling web apps.
|
||||
*/
|
||||
nsresult NS_GetAppInfoFromClearDataNotification(nsISupports *aSubject,
|
||||
uint32_t *aAppID,
|
||||
bool *aBrowserOnly);
|
||||
|
||||
/**
|
||||
* Determines whether appcache should be checked for a given URI.
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "nsCacheService.h"
|
||||
#include "nsApplicationCacheService.h"
|
||||
#include "nsCRT.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIAppsService.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "nsIConsoleService.h"
|
||||
#include "nsVariant.h"
|
||||
|
||||
|
@ -93,6 +92,8 @@ static nsCookieService *gCookieService;
|
|||
#define IDX_BASE_DOMAIN 9
|
||||
#define IDX_ORIGIN_ATTRIBUTES 10
|
||||
|
||||
#define TOPIC_CLEAR_ORIGIN_DATA "clear-origin-attributes-data"
|
||||
|
||||
static const int64_t kCookiePurgeAge =
|
||||
int64_t(30 * 24 * 60 * 60) * PR_USEC_PER_SEC; // 30 days in microseconds
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "mozilla/Attributes.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "nsSocketTransportService2.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "ASpdySession.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "EventTokenBucket.h"
|
||||
#include "Tickler.h"
|
||||
#include "nsIXULAppInfo.h"
|
||||
|
@ -391,7 +390,6 @@ nsHttpHandler::Init()
|
|||
obsService->AddObserver(this, "net:prune-all-connections", true);
|
||||
obsService->AddObserver(this, "net:failed-to-process-uri-content", true);
|
||||
obsService->AddObserver(this, "last-pb-context-exited", true);
|
||||
obsService->AddObserver(this, "webapps-clear-data", true);
|
||||
obsService->AddObserver(this, "browser:purge-session-history", true);
|
||||
obsService->AddObserver(this, NS_NETWORK_LINK_TOPIC, true);
|
||||
obsService->AddObserver(this, "application-background", true);
|
||||
|
@ -2171,10 +2169,6 @@ nsHttpHandler::Observe(nsISupports *subject,
|
|||
if (mConnMgr) {
|
||||
mConnMgr->ClearAltServiceMappings();
|
||||
}
|
||||
} else if (!strcmp(topic, "webapps-clear-data")) {
|
||||
if (mConnMgr) {
|
||||
mConnMgr->ClearAltServiceMappings();
|
||||
}
|
||||
} else if (!strcmp(topic, "browser:purge-session-history")) {
|
||||
if (mConnMgr) {
|
||||
if (gSocketTransportService) {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsServiceManagerUtils.h"
|
||||
#include "plstr.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozIApplicationClearPrivateDataParams.h"
|
||||
#include "nsIURI.h"
|
||||
|
||||
#include "mozilla/net/NeckoChild.h"
|
||||
|
|
|
@ -87,7 +87,6 @@ SpecialPowersObserver.prototype._loadFrameScript = function()
|
|||
this._messageManager.addMessageListener("SPUnloadExtension", this);
|
||||
this._messageManager.addMessageListener("SPExtensionMessage", this);
|
||||
this._messageManager.addMessageListener("SPCleanUpSTSData", this);
|
||||
this._messageManager.addMessageListener("SPClearAppPrivateData", this);
|
||||
|
||||
this._messageManager.loadFrameScript(CHILD_LOGGER_SCRIPT, true);
|
||||
this._messageManager.loadFrameScript(CHILD_SCRIPT_API, true);
|
||||
|
@ -159,7 +158,6 @@ SpecialPowersObserver.prototype.uninit = function()
|
|||
this._messageManager.removeMessageListener("SPUnloadExtension", this);
|
||||
this._messageManager.removeMessageListener("SPExtensionMessage", this);
|
||||
this._messageManager.removeMessageListener("SPCleanUpSTSData", this);
|
||||
this._messageManager.removeMessageListener("SPClearAppPrivateData", this);
|
||||
|
||||
this._messageManager.removeDelayedFrameScript(CHILD_LOGGER_SCRIPT);
|
||||
this._messageManager.removeDelayedFrameScript(CHILD_SCRIPT_API);
|
||||
|
|
|
@ -601,28 +601,6 @@ SpecialPowersObserverAPI.prototype = {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
case "SPClearAppPrivateData": {
|
||||
let appId = aMessage.data.appId;
|
||||
let browserOnly = aMessage.data.browserOnly;
|
||||
|
||||
let attributes = { appId: appId };
|
||||
if (browserOnly) {
|
||||
attributes.inIsolatedMozBrowser = true;
|
||||
}
|
||||
this._notifyCategoryAndObservers(null,
|
||||
"clear-origin-attributes-data",
|
||||
JSON.stringify(attributes));
|
||||
|
||||
let subject = {
|
||||
appId: appId,
|
||||
browserOnly: browserOnly,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.mozIApplicationClearPrivateDataParams])
|
||||
};
|
||||
this._notifyCategoryAndObservers(subject, "webapps-clear-data", null);
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new SpecialPowersError("Unrecognized Special Powers API");
|
||||
}
|
||||
|
|
|
@ -44,8 +44,7 @@ function SpecialPowers(window) {
|
|||
"SPLoadExtension",
|
||||
"SPStartupExtension",
|
||||
"SPUnloadExtension",
|
||||
"SPExtensionMessage",
|
||||
"SPClearAppPrivateData"];
|
||||
"SPExtensionMessage"];
|
||||
addMessageListener("SPPingService", this._messageListener);
|
||||
addMessageListener("SpecialPowers.FilesCreated", this._messageListener);
|
||||
addMessageListener("SpecialPowers.FilesError", this._messageListener);
|
||||
|
|
Загрузка…
Ссылка в новой задаче