зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1214593 - Remove service worker periodic updater. r=ehsan
This commit is contained in:
Родитель
2f883c5504
Коммит
f3324e8193
|
@ -21,12 +21,9 @@
|
|||
0x45f27d10, 0x987b, 0x11d2, \
|
||||
{0xbd, 0x40, 0x00, 0x10, 0x5a, 0xa4, 0x5e, 0x89} }
|
||||
|
||||
#define SERVICEWORKERPERIODICUPDATER_CONTRACTID \
|
||||
"@mozilla.org/service-worker-periodic-updater;1"
|
||||
|
||||
//The dom cannot provide the crypto or pkcs11 classes that
|
||||
//were used in older days, so if someone wants to provide
|
||||
//the service they must implement an object and give it
|
||||
//the service they must implement an object and give it
|
||||
//this class ID
|
||||
#define NS_CRYPTO_CONTRACTID "@mozilla.org/security/crypto;1"
|
||||
#define NS_PKCS11_CONTRACTID "@mozilla.org/security/pkcs11;1"
|
||||
|
|
|
@ -34,7 +34,7 @@ interface nsIServiceWorkerInfo : nsISupports
|
|||
readonly attribute DOMString waitingCacheName;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(8fb9db4f-1d04-402b-9c37-542da06e03b9)]
|
||||
[scriptable, builtinclass, uuid(10f80c8c-7bf5-479e-a8d8-12ef50c802e8)]
|
||||
interface nsIServiceWorkerManager : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -145,8 +145,6 @@ interface nsIServiceWorkerManager : nsISupports
|
|||
[optional, array, size_is(aDataLength)] in uint8_t aDataBytes);
|
||||
void sendPushSubscriptionChangeEvent(in ACString aOriginAttributes,
|
||||
in ACString scope);
|
||||
|
||||
void updateAllRegistrations();
|
||||
};
|
||||
|
||||
%{ C++
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
#include "nsIMutable.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIServiceWorkerManager.h"
|
||||
#include "nsScreenManagerProxy.h"
|
||||
#include "nsMemoryInfoDumper.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
@ -1434,16 +1433,6 @@ ContentChild::RecvBidiKeyboardNotify(const bool& aIsLangRTL)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvUpdateServiceWorkerRegistrations()
|
||||
{
|
||||
nsCOMPtr<nsIServiceWorkerManager> swm = mozilla::services::GetServiceWorkerManager();
|
||||
if (swm) {
|
||||
swm->UpdateAllRegistrations();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static CancelableTask* sFirstIdleTask;
|
||||
|
||||
static void FirstIdle(void)
|
||||
|
|
|
@ -329,8 +329,6 @@ public:
|
|||
|
||||
virtual bool RecvBidiKeyboardNotify(const bool& isLangRTL) override;
|
||||
|
||||
virtual bool RecvUpdateServiceWorkerRegistrations() override;
|
||||
|
||||
virtual bool RecvNotifyVisited(const URIParams& aURI) override;
|
||||
// auto remove when alertfinished is received.
|
||||
nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver);
|
||||
|
|
|
@ -521,8 +521,6 @@ child:
|
|||
*/
|
||||
async BidiKeyboardNotify(bool isLangRTL);
|
||||
|
||||
async UpdateServiceWorkerRegistrations();
|
||||
|
||||
async DataStoreNotify(uint32_t aAppId, nsString aName,
|
||||
nsString aManifestURL);
|
||||
|
||||
|
|
|
@ -3926,23 +3926,6 @@ ServiceWorkerManager::RemoveAllRegistrations(OriginAttributes* aParams)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ServiceWorkerManager::UpdateAllRegistrations()
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
for (auto it1 = mRegistrationInfos.Iter(); !it1.Done(); it1.Next()) {
|
||||
for (auto it2 = it1.UserData()->mInfos.Iter(); !it2.Done(); it2.Next()) {
|
||||
ServiceWorkerRegistrationInfo* info = it2.UserData();
|
||||
MOZ_ASSERT(!info->mScope.IsEmpty());
|
||||
|
||||
SoftUpdate(info->mPrincipal, info->mScope);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ServiceWorkerManager::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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 "ServiceWorkerPeriodicUpdater.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "nsIServiceWorkerManager.h"
|
||||
|
||||
#define OBSERVER_TOPIC_IDLE_DAILY "idle-daily"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
namespace workers {
|
||||
|
||||
NS_IMPL_ISUPPORTS(ServiceWorkerPeriodicUpdater, nsIObserver)
|
||||
|
||||
StaticRefPtr<ServiceWorkerPeriodicUpdater>
|
||||
ServiceWorkerPeriodicUpdater::sInstance;
|
||||
bool
|
||||
ServiceWorkerPeriodicUpdater::sPeriodicUpdatesEnabled = true;
|
||||
|
||||
already_AddRefed<ServiceWorkerPeriodicUpdater>
|
||||
ServiceWorkerPeriodicUpdater::GetSingleton()
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
if (!sInstance) {
|
||||
sInstance = new ServiceWorkerPeriodicUpdater();
|
||||
ClearOnShutdown(&sInstance);
|
||||
}
|
||||
RefPtr<ServiceWorkerPeriodicUpdater> copy(sInstance.get());
|
||||
return copy.forget();
|
||||
}
|
||||
|
||||
ServiceWorkerPeriodicUpdater::ServiceWorkerPeriodicUpdater()
|
||||
{
|
||||
Preferences::AddBoolVarCache(&sPeriodicUpdatesEnabled,
|
||||
"dom.serviceWorkers.periodic-updates.enabled",
|
||||
true);
|
||||
}
|
||||
|
||||
ServiceWorkerPeriodicUpdater::~ServiceWorkerPeriodicUpdater()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ServiceWorkerPeriodicUpdater::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
const char16_t* aData)
|
||||
{
|
||||
// In tests, the pref is set to false so that the idle-daily service does not
|
||||
// trigger updates leading to intermittent failures.
|
||||
// We're called from SpecialPowers inside tests, in which case we need to
|
||||
// update during the test run, for which we use a non-empty aData.
|
||||
NS_NAMED_LITERAL_STRING(CallerSpecialPowers, "Caller:SpecialPowers");
|
||||
if (strcmp(aTopic, OBSERVER_TOPIC_IDLE_DAILY) == 0 &&
|
||||
(sPeriodicUpdatesEnabled || (aData && CallerSpecialPowers.Equals(aData)))) {
|
||||
// First, update all registrations in the parent process.
|
||||
nsCOMPtr<nsIServiceWorkerManager> swm =
|
||||
mozilla::services::GetServiceWorkerManager();
|
||||
if (swm) {
|
||||
swm->UpdateAllRegistrations();
|
||||
}
|
||||
|
||||
// Now, tell all child processes to update their registrations as well.
|
||||
nsTArray<ContentParent*> children;
|
||||
ContentParent::GetAll(children);
|
||||
for (uint32_t i = 0; i < children.Length(); i++) {
|
||||
Unused << children[i]->SendUpdateServiceWorkerRegistrations();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace workers
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -1,46 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef mozilla_ServiceWorkerPeriodicUpdater_h
|
||||
#define mozilla_ServiceWorkerPeriodicUpdater_h
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
namespace workers {
|
||||
|
||||
/**
|
||||
* This XPCOM component is main-process only, which means that it will never
|
||||
* get instantiated in child processes. When we receive the idle-daily
|
||||
* notification in this component, we iterate over all PContent children, and
|
||||
* send each one a message that will trigger a call to
|
||||
* nsIServiceWorkerManager::UpdateAllRegistrations() in all child processes.
|
||||
*/
|
||||
|
||||
class ServiceWorkerPeriodicUpdater final : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
static already_AddRefed<ServiceWorkerPeriodicUpdater> GetSingleton();
|
||||
|
||||
private:
|
||||
ServiceWorkerPeriodicUpdater();
|
||||
~ServiceWorkerPeriodicUpdater();
|
||||
|
||||
static StaticRefPtr<ServiceWorkerPeriodicUpdater> sInstance;
|
||||
static bool sPeriodicUpdatesEnabled;
|
||||
};
|
||||
|
||||
} // namespace workers
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
|
@ -20,7 +20,6 @@ EXPORTS.mozilla.dom += [
|
|||
|
||||
EXPORTS.mozilla.dom.workers += [
|
||||
'ServiceWorkerManager.h',
|
||||
'ServiceWorkerPeriodicUpdater.h',
|
||||
'WorkerDebuggerManager.h',
|
||||
'Workers.h',
|
||||
]
|
||||
|
@ -73,7 +72,6 @@ UNIFIED_SOURCES += [
|
|||
'ServiceWorkerManagerParent.cpp',
|
||||
'ServiceWorkerManagerService.cpp',
|
||||
'ServiceWorkerMessageEvent.cpp',
|
||||
'ServiceWorkerPeriodicUpdater.cpp',
|
||||
'ServiceWorkerPrivate.cpp',
|
||||
'ServiceWorkerRegistrar.cpp',
|
||||
'ServiceWorkerRegistration.cpp',
|
||||
|
|
|
@ -131,12 +131,6 @@ support-files =
|
|||
worker_updatefoundevent2.js
|
||||
updatefoundevent.html
|
||||
empty.js
|
||||
periodic_update_test.js
|
||||
periodic.sjs
|
||||
periodic/frame.html
|
||||
periodic/register.html
|
||||
periodic/wait_for_update.html
|
||||
periodic/unregister.html
|
||||
notification_constructor_error.js
|
||||
notification_get_sw.js
|
||||
notification/register.html
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
function handleRequest(request, response) {
|
||||
var stateName = request.scheme + 'periodiccounter';
|
||||
if (request.queryString == 'clearcounter') {
|
||||
setState(stateName, '');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!getState(stateName)) {
|
||||
setState(stateName, '1');
|
||||
} else {
|
||||
// Make sure that we pass a string value to setState!
|
||||
setState(stateName, "" + (parseInt(getState(stateName)) + 1));
|
||||
}
|
||||
response.setHeader("Content-Type", "application/javascript", false);
|
||||
response.write(getScript(stateName));
|
||||
}
|
||||
|
||||
function getScript(stateName) {
|
||||
return "onfetch = function(e) {" +
|
||||
"if (e.request.url.indexOf('get-sw-version') > -1) {" +
|
||||
"e.respondWith(new Response('" + getState(stateName) + "'));" +
|
||||
"}" +
|
||||
"};";
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
fetch("get-sw-version").then(function(r) {
|
||||
return r.text();
|
||||
}).then(function(body) {
|
||||
parent.postMessage({status: "callback", data: body}, "*");
|
||||
});
|
||||
</script>
|
|
@ -1,9 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
function done() {
|
||||
parent.postMessage({status: "callback", data: "done"}, "*");
|
||||
}
|
||||
|
||||
navigator.serviceWorker.ready.then(done);
|
||||
navigator.serviceWorker.register("../periodic.sjs", {scope: "."});
|
||||
</script>
|
|
@ -1,16 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
fetch("../periodic.sjs?clearcounter").then(function() {
|
||||
return navigator.serviceWorker.getRegistration(".");
|
||||
}).then(function(registration) {
|
||||
registration.unregister().then(function(success) {
|
||||
if (success) {
|
||||
parent.postMessage({status: "callback", data: "done"}, "*");
|
||||
} else {
|
||||
dump("Unregister failed\n");
|
||||
}
|
||||
}, function(e) {
|
||||
dump("Unregistering the SW failed with " + e + "\n");
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
navigator.serviceWorker.getRegistration(".").then(function(reg) {
|
||||
reg.onupdatefound = function() {
|
||||
reg.onupdatefound = null;
|
||||
var sw = reg.installing;
|
||||
sw.onstatechange = function() {
|
||||
sw.onstatechange = null;
|
||||
var success = !reg.waiting && reg.active;
|
||||
parent.postMessage({status: "callback", data: "done"}, "*");
|
||||
};
|
||||
};
|
||||
SpecialPowers.startPeriodicServiceWorkerUpdates();
|
||||
});
|
||||
</script>
|
|
@ -1,75 +0,0 @@
|
|||
var oldSWVersion, newSWVersion;
|
||||
// This will be set by the test to the base directory for the test files.
|
||||
var gPrefix;
|
||||
|
||||
function start() {
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
function testVersion() {
|
||||
// Verify that the service worker has been correctly updated.
|
||||
testFrame(gPrefix + "periodic/frame.html").then(function(body) {
|
||||
newSWVersion = parseInt(body);
|
||||
is(newSWVersion, 2, "Expected correct new version");
|
||||
ok(newSWVersion > oldSWVersion,
|
||||
"The SW should be successfully updated, old: " + oldSWVersion +
|
||||
", new: " + newSWVersion);
|
||||
unregisterSW().then(function() {
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
registerSW().then(function() {
|
||||
return testFrame(gPrefix + "periodic/frame.html").then(function(body) {
|
||||
oldSWVersion = parseInt(body);
|
||||
is(oldSWVersion, 1, "Expected correct old version");
|
||||
});
|
||||
}).then(function() {
|
||||
return testFrame(gPrefix + "periodic/wait_for_update.html");
|
||||
}).then(function() {
|
||||
return testVersion();
|
||||
});
|
||||
}
|
||||
|
||||
function testFrame(src) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.src = src;
|
||||
window.onmessage = function(e) {
|
||||
if (e.data.status == "callback") {
|
||||
window.onmessage = null;
|
||||
var result = e.data.data;
|
||||
iframe.src = "about:blank";
|
||||
document.body.removeChild(iframe);
|
||||
iframe = null;
|
||||
SpecialPowers.exactGC(window, function() {
|
||||
resolve(result);
|
||||
});
|
||||
}
|
||||
};
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
}
|
||||
|
||||
function registerSW() {
|
||||
return testFrame(gPrefix + "periodic/register.html");
|
||||
}
|
||||
|
||||
function unregisterSW() {
|
||||
return testFrame(gPrefix + "periodic/unregister.html");
|
||||
}
|
||||
|
||||
function runTheTest() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||
["dom.serviceWorkers.interception.enabled", true],
|
||||
["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
['dom.serviceWorkers.interception.enabled', true],
|
||||
]}, function() {
|
||||
start();
|
||||
});
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 1159378 - Test the periodic update of service workers</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="periodic_update_test.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
gPrefix = "https://example.com/tests/dom/workers/test/serviceworkers/";
|
||||
runTheTest();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 1112469 - Test the periodic update of service workers</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="periodic_update_test.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
gPrefix = "http://mochi.test:8888/tests/dom/workers/test/serviceworkers/";
|
||||
runTheTest();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -82,8 +82,4 @@
|
|||
#define SERVICEWORKERMANAGER_CID \
|
||||
{ 0xc74bde32, 0xbcc7, 0x4840, { 0x84, 0x30, 0xc7, 0x33, 0x35, 0x1b, 0x21, 0x2a } }
|
||||
|
||||
// {91f43ef6-8159-457a-ba68-249c3ff7a06a}
|
||||
#define SERVICEWORKERPERIODICUPDATER_CID \
|
||||
{ 0x91f43ef6, 0x8159, 0x457a, { 0xba, 0x68, 0x24, 0x9c, 0x3f, 0xf7, 0xa0, 0x6a } }
|
||||
|
||||
#endif /* nsLayoutCID_h__ */
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
#include "mozilla/dom/network/UDPSocketChild.h"
|
||||
#include "mozilla/dom/quota/QuotaManager.h"
|
||||
#include "mozilla/dom/workers/ServiceWorkerManager.h"
|
||||
#include "mozilla/dom/workers/ServiceWorkerPeriodicUpdater.h"
|
||||
#include "mozilla/dom/workers/WorkerDebuggerManager.h"
|
||||
#include "mozilla/OSFileConstants.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
@ -272,7 +271,6 @@ using mozilla::dom::alarm::AlarmHalService;
|
|||
using mozilla::dom::power::PowerManagerService;
|
||||
using mozilla::dom::quota::QuotaManager;
|
||||
using mozilla::dom::workers::ServiceWorkerManager;
|
||||
using mozilla::dom::workers::ServiceWorkerPeriodicUpdater;
|
||||
using mozilla::dom::workers::WorkerDebuggerManager;
|
||||
using mozilla::dom::UDPSocketChild;
|
||||
using mozilla::dom::time::TimeService;
|
||||
|
@ -320,8 +318,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManager,
|
|||
QuotaManager::FactoryCreate)
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager,
|
||||
ServiceWorkerManager::GetInstance)
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerPeriodicUpdater,
|
||||
ServiceWorkerPeriodicUpdater::GetSingleton)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(WorkerDebuggerManager)
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
|
@ -771,7 +767,6 @@ NS_DEFINE_NAMED_CID(NS_TEXTEDITOR_CID);
|
|||
NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(QUOTA_MANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(SERVICEWORKERMANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(SERVICEWORKERPERIODICUPDATER_CID);
|
||||
NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_CID);
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID);
|
||||
|
@ -1081,7 +1076,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
|||
{ &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor },
|
||||
{ &kQUOTA_MANAGER_CID, false, nullptr, QuotaManagerConstructor },
|
||||
{ &kSERVICEWORKERMANAGER_CID, false, nullptr, ServiceWorkerManagerConstructor },
|
||||
{ &kSERVICEWORKERPERIODICUPDATER_CID, false, nullptr, ServiceWorkerPeriodicUpdaterConstructor },
|
||||
{ &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor },
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
{ &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor },
|
||||
|
@ -1251,7 +1245,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
|||
{ DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID },
|
||||
{ QUOTA_MANAGER_CONTRACTID, &kQUOTA_MANAGER_CID },
|
||||
{ SERVICEWORKERMANAGER_CONTRACTID, &kSERVICEWORKERMANAGER_CID },
|
||||
{ SERVICEWORKERPERIODICUPDATER_CONTRACTID, &kSERVICEWORKERPERIODICUPDATER_CID, Module::MAIN_PROCESS_ONLY },
|
||||
{ WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_CID },
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
{ SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID },
|
||||
|
@ -1367,7 +1360,6 @@ static const mozilla::Module::CategoryEntry kLayoutCategories[] = {
|
|||
#endif
|
||||
{ "profile-after-change", "PresentationDeviceManager", PRESENTATION_DEVICE_MANAGER_CONTRACTID },
|
||||
{ "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID },
|
||||
{ "idle-daily", "ServiceWorker Periodic Updater", SERVICEWORKERPERIODICUPDATER_CONTRACTID },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@ class B2GDesktopReftest(RefTest):
|
|||
# Set a future policy version to avoid the telemetry prompt.
|
||||
prefs["toolkit.telemetry.prompted"] = 999
|
||||
prefs["toolkit.telemetry.notifiedOptOut"] = 999
|
||||
# Disable periodic updates of service workers
|
||||
prefs["dom.serviceWorkers.periodic-updates.enabled"] = False
|
||||
|
||||
# Set the extra prefs.
|
||||
profile.set_preferences(prefs)
|
||||
|
|
|
@ -65,8 +65,5 @@
|
|||
// Make sure SelfSupport doesn't hit the network.
|
||||
branch.setCharPref("browser.selfsupport.url", "https://%(server)s/selfsupport-dummy/");
|
||||
|
||||
// Disable periodic updates of service workers.
|
||||
branch.setBoolPref("dom.serviceWorkers.periodic-updates.enabled", false);
|
||||
|
||||
// Allow XUL and XBL files to be opened from file:// URIs
|
||||
branch.setBoolPref("dom.allow_XUL_XBL_for_file", true);
|
||||
|
|
|
@ -261,8 +261,6 @@ class B2GRemoteReftest(RefTest):
|
|||
# Disable tiles also
|
||||
prefs["browser.newtabpage.directory.source"] = ""
|
||||
prefs["browser.newtabpage.directory.ping"] = ""
|
||||
# Disable periodic updates of service workers
|
||||
prefs["dom.serviceWorkers.periodic-updates.enabled"] = False
|
||||
|
||||
if options.oop:
|
||||
prefs['browser.tabs.remote.autostart'] = True
|
||||
|
|
|
@ -388,8 +388,6 @@ class FirefoxProfile(Profile):
|
|||
# Our current tests expect the unified Telemetry feature to be opt-out,
|
||||
# which is not true while we hold back shipping it.
|
||||
'toolkit.telemetry.unifiedIsOptIn': True,
|
||||
# Disable periodic updates of service workers
|
||||
'dom.serviceWorkers.periodic-updates.enabled': False,
|
||||
}
|
||||
|
||||
class MetroFirefoxProfile(Profile):
|
||||
|
@ -436,8 +434,6 @@ class MetroFirefoxProfile(Profile):
|
|||
# Don't send Telemetry reports to the production server. This is
|
||||
# needed as Telemetry sends pings also if FHR upload is enabled.
|
||||
'toolkit.telemetry.server' : 'http://%(server)s/telemetry-dummy/',
|
||||
# Disable periodic updates of service workers
|
||||
'dom.serviceWorkers.periodic-updates.enabled': False,
|
||||
}
|
||||
|
||||
class ThunderbirdProfile(Profile):
|
||||
|
|
|
@ -337,9 +337,6 @@ user_pref("network.proxy.pac_generator", false);
|
|||
// selected by default).
|
||||
user_pref("lightweightThemes.selectedThemeID", "");
|
||||
|
||||
// Disable periodic updates of service workers.
|
||||
user_pref("dom.serviceWorkers.periodic-updates.enabled", false);
|
||||
|
||||
// Enable speech synth test service, and disable built in platform services.
|
||||
user_pref("media.webspeech.synth.test", true);
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ SpecialPowersObserver.prototype = new SpecialPowersObserverAPI();
|
|||
this._messageManager.addMessageListener("SPChromeScriptMessage", this);
|
||||
this._messageManager.addMessageListener("SPQuotaManager", this);
|
||||
this._messageManager.addMessageListener("SPSetTestPluginEnabledState", this);
|
||||
this._messageManager.addMessageListener("SPPeriodicServiceWorkerUpdates", this);
|
||||
this._messageManager.addMessageListener("SPLoadExtension", this);
|
||||
this._messageManager.addMessageListener("SPStartupExtension", this);
|
||||
this._messageManager.addMessageListener("SPUnloadExtension", this);
|
||||
|
@ -169,7 +168,6 @@ SpecialPowersObserver.prototype = new SpecialPowersObserverAPI();
|
|||
this._messageManager.removeMessageListener("SPChromeScriptMessage", this);
|
||||
this._messageManager.removeMessageListener("SPQuotaManager", this);
|
||||
this._messageManager.removeMessageListener("SPSetTestPluginEnabledState", this);
|
||||
this._messageManager.removeMessageListener("SPPeriodicServiceWorkerUpdates", this);
|
||||
this._messageManager.removeMessageListener("SPLoadExtension", this);
|
||||
this._messageManager.removeMessageListener("SPStartupExtension", this);
|
||||
this._messageManager.removeMessageListener("SPUnloadExtension", this);
|
||||
|
|
|
@ -529,17 +529,6 @@ SpecialPowersObserverAPI.prototype = {
|
|||
return undefined; // See comment at the beginning of this function.
|
||||
}
|
||||
|
||||
case "SPPeriodicServiceWorkerUpdates": {
|
||||
// We could just dispatch a generic idle-daily notification here, but
|
||||
// this is better since it avoids invoking other idle daily observers
|
||||
// at the cost of hard-coding the usage of PeriodicServiceWorkerUpdater.
|
||||
Cc["@mozilla.org/service-worker-periodic-updater;1"].
|
||||
getService(Ci.nsIObserver).
|
||||
observe(null, "idle-daily", "Caller:SpecialPowers");
|
||||
|
||||
return undefined; // See comment at the beginning of this function.
|
||||
}
|
||||
|
||||
case "SPCleanUpSTSData": {
|
||||
let origin = aMessage.data.origin;
|
||||
let flags = aMessage.data.flags;
|
||||
|
|
|
@ -32,7 +32,6 @@ function SpecialPowers(window) {
|
|||
"SPProcessCrashService",
|
||||
"SPSetTestPluginEnabledState",
|
||||
"SPWebAppService",
|
||||
"SPPeriodicServiceWorkerUpdates",
|
||||
"SPCleanUpSTSData"];
|
||||
|
||||
this.SP_ASYNC_MESSAGES = ["SpecialPowers.Focus",
|
||||
|
|
|
@ -1999,10 +1999,6 @@ SpecialPowersAPI.prototype = {
|
|||
return new File(path, options);
|
||||
},
|
||||
|
||||
startPeriodicServiceWorkerUpdates: function() {
|
||||
return this._sendSyncMessage('SPPeriodicServiceWorkerUpdates', {});
|
||||
},
|
||||
|
||||
removeAllServiceWorkerData: function() {
|
||||
this.notifyObserversInParentProcess(null, "browser:purge-session-history", "");
|
||||
},
|
||||
|
|
|
@ -72,8 +72,6 @@ class TPSTestRunner(object):
|
|||
'services.sync.firstSync': 'notReady',
|
||||
'services.sync.lastversion': '1.0',
|
||||
'toolkit.startup.max_resumed_crashes': -1,
|
||||
# Disable periodic updates of service workers
|
||||
'dom.serviceWorkers.periodic-updates.enabled': False,
|
||||
}
|
||||
|
||||
debug_preferences = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче