Backed out changeset c189d09ec942 (bug 930348) for B2G desktop bustage.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2014-05-13 15:33:58 -04:00
Родитель 6734a2eaec
Коммит 82d24eb10c
20 изменённых файлов: 1 добавлений и 517 удалений

Просмотреть файл

@ -786,7 +786,6 @@ GK_ATOM(onpageshow, "onpageshow")
GK_ATOM(onpaint, "onpaint")
GK_ATOM(onpairedstatuschanged, "onpairedstatuschanged")
GK_ATOM(onpaste, "onpaste")
GK_ATOM(onpendingchange, "onpendingchange")
GK_ATOM(onpopuphidden, "onpopuphidden")
GK_ATOM(onpopuphiding, "onpopuphiding")
GK_ATOM(onpopupshowing, "onpopupshowing")
@ -829,7 +828,6 @@ GK_ATOM(ontouchcancel, "ontouchcancel")
GK_ATOM(ontransitionend, "ontransitionend")
GK_ATOM(onunderflow, "onunderflow")
GK_ATOM(onunload, "onunload")
GK_ATOM(onupdatefound, "onupdatefound")
GK_ATOM(onupdateready, "onupdateready")
GK_ATOM(onupgradeneeded, "onupgradeneeded")
GK_ATOM(onussdreceived, "onussdreceived")
@ -929,7 +927,6 @@ GK_ATOM(rectangle, "rectangle")
GK_ATOM(ref, "ref")
GK_ATOM(refresh, "refresh")
GK_ATOM(rel, "rel")
GK_ATOM(onreloadpage, "onreloadpage")
GK_ATOM(rem, "rem")
GK_ATOM(removeelement, "removeelement")
GK_ATOM(renderingobserverlist, "renderingobserverlist")
@ -1930,7 +1927,6 @@ GK_ATOM(ondurationchange, "ondurationchange")
GK_ATOM(onvolumechange, "onvolumechange")
GK_ATOM(onaddtrack, "onaddtrack")
GK_ATOM(oncuechange, "oncuechange")
GK_ATOM(oncurrentchange, "oncurrentchange")
GK_ATOM(onenter, "onenter")
GK_ATOM(onexit, "onexit")
GK_ATOM(onremovetrack, "onremovetrack")

Просмотреть файл

@ -34,7 +34,6 @@
#include "mozilla/dom/WakeLock.h"
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/MobileMessageManager.h"
#include "mozilla/dom/ServiceWorkerContainer.h"
#include "mozilla/dom/Telephony.h"
#include "mozilla/Hal.h"
#include "nsISiteSpecificUserAgent.h"
@ -178,7 +177,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessagesManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeviceStorageStores)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimeManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedResolveResults)
@ -288,8 +286,6 @@ Navigator::Invalidate()
if (mTimeManager) {
mTimeManager = nullptr;
}
mServiceWorkerContainer = nullptr;
}
//*****************************************************************************
@ -1816,19 +1812,6 @@ Navigator::GetMozCameras(ErrorResult& aRv)
return mCameraManager;
}
already_AddRefed<ServiceWorkerContainer>
Navigator::ServiceWorker()
{
MOZ_ASSERT(mWindow);
if (!mServiceWorkerContainer) {
mServiceWorkerContainer = new workers::ServiceWorkerContainer(mWindow);
}
nsRefPtr<ServiceWorkerContainer> ref = mServiceWorkerContainer;
return ref.forget();
}
size_t
Navigator::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{

Просмотреть файл

@ -104,10 +104,6 @@ class AudioChannelManager;
#endif
} // namespace system
namespace workers {
class ServiceWorkerContainer;
} // namespace workers
class Navigator : public nsIDOMNavigator
, public nsIMozNavigatorNetwork
, public nsWrapperCache
@ -254,9 +250,6 @@ public:
uint64_t aInnerWindowID,
ErrorResult& aRv);
#endif // MOZ_MEDIA_NAVIGATOR
already_AddRefed<workers::ServiceWorkerContainer> ServiceWorker();
bool DoNewResolve(JSContext* aCx, JS::Handle<JSObject*> aObject,
JS::Handle<jsid> aId,
JS::MutableHandle<JSPropertyDescriptor> aDesc);
@ -372,7 +365,6 @@ private:
nsCOMPtr<nsIDOMNavigatorSystemMessages> mMessagesManager;
nsTArray<nsRefPtr<nsDOMDeviceStorage> > mDeviceStorageStores;
nsRefPtr<time::TimeManager> mTimeManager;
nsRefPtr<workers::ServiceWorkerContainer> mServiceWorkerContainer;
nsCOMPtr<nsPIDOMWindow> mWindow;
// Hashtable for saving cached objects newresolve created, so we don't create

Просмотреть файл

@ -1019,16 +1019,6 @@ DOMInterfaces = {
]
},
'ServiceWorker': {
'nativeType': 'mozilla::dom::workers::ServiceWorker',
'headerFile': 'mozilla/dom/workers/bindings/ServiceWorker.h',
},
'ServiceWorkerContainer': {
'nativeType': 'mozilla::dom::workers::ServiceWorkerContainer',
'headerFile': 'mozilla/dom/ServiceWorkerContainer.h',
},
'SharedWorker': {
'nativeType': 'mozilla::dom::workers::SharedWorker',
'headerFile': 'mozilla/dom/workers/bindings/SharedWorker.h',

Просмотреть файл

@ -809,10 +809,6 @@ var interfaceNamesInGlobalScope =
"ScrollAreaEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
"Selection",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "ServiceWorker", pref: "dom.serviceWorkers.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "ServiceWorkerContainer", pref: "dom.serviceWorkers.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
"SettingsLock",
// IMPORTANT: Do not change this list without review from a DOM peer!

Просмотреть файл

@ -355,12 +355,6 @@ partial interface Navigator {
};
#endif // MOZ_MEDIA_NAVIGATOR
// Service Workers/Navigation Controllers
partial interface Navigator {
[Pref="dom.serviceWorkers.enabled"]
readonly attribute ServiceWorkerContainer serviceWorker;
};
partial interface Navigator {
[Throws, Pref="beacon.enabled"]
boolean sendBeacon(DOMString url,

Просмотреть файл

@ -1,31 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
*
*/
// Still unclear what should be subclassed.
// https://github.com/slightlyoff/ServiceWorker/issues/189
[Pref="dom.serviceWorkers.enabled"]
interface ServiceWorker : EventTarget {
readonly attribute DOMString scope;
readonly attribute DOMString url;
readonly attribute ServiceWorkerState state;
attribute EventHandler onstatechange;
};
ServiceWorker implements AbstractWorker;
enum ServiceWorkerState {
"parsed",
"installing",
"installed",
"activating",
"activated",
"redundant"
};

Просмотреть файл

@ -1,50 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
*
*/
[Pref="dom.serviceWorkers.enabled"]
interface ServiceWorkerContainer {
// FIXME(nsm):
// https://github.com/slightlyoff/ServiceWorker/issues/198
// and discussion at https://etherpad.mozilla.org/serviceworker07apr
[Unforgeable] readonly attribute ServiceWorker? installing;
[Unforgeable] readonly attribute ServiceWorker? waiting;
[Unforgeable] readonly attribute ServiceWorker? current;
[Throws]
Promise getAll();
[Throws]
Promise register(DOMString url, optional RegistrationOptionList options);
[Throws]
Promise unregister(DOMString? scope);
// Promise<ServiceWorker>
[Throws]
Promise whenReady();
attribute EventHandler onupdatefound;
attribute EventHandler oncurrentchange;
attribute EventHandler onreloadpage;
attribute EventHandler onerror;
};
// Testing only.
[ChromeOnly, Pref="dom.serviceWorkers.testing.enabled"]
partial interface ServiceWorkerContainer {
[Throws]
Promise clearAllServiceWorkerData();
[Throws]
DOMString getControllingWorkerScriptURLForPath(DOMString path);
};
dictionary RegistrationOptionList {
DOMString scope = "*";
};

Просмотреть файл

@ -299,8 +299,6 @@ WEBIDL_FILES = [
'ScriptProcessorNode.webidl',
'ScrollAreaEvent.webidl',
'Selection.webidl',
'ServiceWorker.webidl',
'ServiceWorkerContainer.webidl',
'SettingsManager.webidl',
'ShadowRoot.webidl',
'SharedWorker.webidl',

Просмотреть файл

@ -6,7 +6,7 @@
#ifndef mozilla_dom_workers_messageport_h_
#define mozilla_dom_workers_messageport_h_
#include "mozilla/dom/workers/Workers.h"
#include "Workers.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/BindingDeclarations.h"

Просмотреть файл

@ -1,46 +0,0 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* 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 "ServiceWorker.h"
#include "nsPIDOMWindow.h"
#include "SharedWorker.h"
#include "WorkerPrivate.h"
#include "mozilla/dom/Promise.h"
using namespace mozilla::dom;
USING_WORKERS_NAMESPACE
ServiceWorker::ServiceWorker(nsPIDOMWindow* aWindow,
SharedWorker* aSharedWorker)
: DOMEventTargetHelper(aWindow),
mSharedWorker(aSharedWorker)
{
AssertIsOnMainThread();
MOZ_ASSERT(mSharedWorker);
}
ServiceWorker::~ServiceWorker()
{
AssertIsOnMainThread();
}
NS_IMPL_ADDREF_INHERITED(ServiceWorker, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(ServiceWorker, DOMEventTargetHelper)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorker)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorker, DOMEventTargetHelper,
mSharedWorker)
JSObject*
ServiceWorker::WrapObject(JSContext* aCx)
{
AssertIsOnMainThread();
return ServiceWorkerBinding::Wrap(aCx, this);
}

Просмотреть файл

@ -1,77 +0,0 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* 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_dom_workers_serviceworker_h__
#define mozilla_dom_workers_serviceworker_h__
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/ServiceWorkerBinding.h" // For ServiceWorkerState.
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class Promise;
namespace workers {
class SharedWorker;
class ServiceWorker MOZ_FINAL : public DOMEventTargetHelper
{
friend class RuntimeService;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorker, DOMEventTargetHelper)
IMPL_EVENT_HANDLER(statechange)
IMPL_EVENT_HANDLER(error)
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
ServiceWorkerState
State() const
{
return mState;
}
void
GetScope(nsString& aScope) const
{
aScope = mScope;
}
void
GetUrl(nsString& aURL) const
{
aURL = mURL;
}
private:
// This class can only be created from the RuntimeService.
ServiceWorker(nsPIDOMWindow* aWindow, SharedWorker* aSharedWorker);
// This class is reference-counted and will be destroyed from Release().
~ServiceWorker();
ServiceWorkerState mState;
nsString mScope;
nsString mURL;
// To allow ServiceWorkers to potentially drop the backing DOMEventTargetHelper and
// re-instantiate it later, they simply own a SharedWorker member that
// can be released and recreated as required rather than re-implement some of
// the SharedWorker logic.
nsRefPtr<SharedWorker> mSharedWorker;
};
} // namespace workers
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_workers_serviceworker_h__

Просмотреть файл

@ -1,110 +0,0 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=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 "ServiceWorkerContainer.h"
#include "nsPIDOMWindow.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ServiceWorkerContainerBinding.h"
#include "mozilla/dom/workers/bindings/ServiceWorker.h"
namespace mozilla {
namespace dom {
namespace workers {
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorkerContainer)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper, mWindow)
JSObject*
ServiceWorkerContainer::WrapObject(JSContext* aCx)
{
return ServiceWorkerContainerBinding::Wrap(aCx, this);
}
already_AddRefed<Promise>
ServiceWorkerContainer::Register(const nsAString& aScriptURL,
const RegistrationOptionList& aOptions,
ErrorResult& aRv)
{
// FIXME(nsm): Bug 984048
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return nullptr;
}
already_AddRefed<Promise>
ServiceWorkerContainer::Unregister(const nsAString& aScope,
ErrorResult& aRv)
{
// FIXME(nsm): Bug 984048
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return nullptr;
}
already_AddRefed<workers::ServiceWorker>
ServiceWorkerContainer::GetInstalling()
{
// FIXME(nsm): Bug 1002570
return nullptr;
}
already_AddRefed<workers::ServiceWorker>
ServiceWorkerContainer::GetWaiting()
{
// FIXME(nsm): Bug 1002570
return nullptr;
}
already_AddRefed<workers::ServiceWorker>
ServiceWorkerContainer::GetCurrent()
{
// FIXME(nsm): Bug 1002570
return nullptr;
}
already_AddRefed<Promise>
ServiceWorkerContainer::GetAll(ErrorResult& aRv)
{
// FIXME(nsm): Bug 1002571
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return nullptr;
}
already_AddRefed<Promise>
ServiceWorkerContainer::WhenReady(ErrorResult& aRv)
{
// FIXME(nsm): Bug 984048
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return nullptr;
}
// Testing only.
already_AddRefed<Promise>
ServiceWorkerContainer::ClearAllServiceWorkerData(ErrorResult& aRv)
{
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return nullptr;
}
// Testing only.
void
ServiceWorkerContainer::GetControllingWorkerScriptURLForPath(
const nsAString& aPath,
nsString& aScriptURL,
ErrorResult& aRv)
{
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
}
} // namespace workers
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -1,94 +0,0 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=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_dom_workers_serviceworkercontainer_h__
#define mozilla_dom_workers_serviceworkercontainer_h__
#include "mozilla/DOMEventTargetHelper.h"
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class Promise;
struct RegistrationOptionList;
namespace workers {
class ServiceWorker;
// Lightweight serviceWorker APIs collection.
class ServiceWorkerContainer MOZ_FINAL : public DOMEventTargetHelper
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
IMPL_EVENT_HANDLER(updatefound)
IMPL_EVENT_HANDLER(currentchange)
IMPL_EVENT_HANDLER(reloadpage)
IMPL_EVENT_HANDLER(error)
explicit ServiceWorkerContainer(nsPIDOMWindow* aWindow)
: mWindow(aWindow)
{
SetIsDOMBinding();
}
nsPIDOMWindow*
GetParentObject() const
{
return mWindow;
}
JSObject*
WrapObject(JSContext* aCx);
already_AddRefed<Promise>
Register(const nsAString& aScriptURL,
const RegistrationOptionList& aOptions,
ErrorResult& aRv);
already_AddRefed<Promise>
Unregister(const nsAString& scope, ErrorResult& aRv);
already_AddRefed<ServiceWorker>
GetInstalling();
already_AddRefed<ServiceWorker>
GetWaiting();
already_AddRefed<ServiceWorker>
GetCurrent();
already_AddRefed<Promise>
GetAll(ErrorResult& aRv);
already_AddRefed<Promise>
WhenReady(ErrorResult& aRv);
// Testing only.
already_AddRefed<Promise>
ClearAllServiceWorkerData(ErrorResult& aRv);
// Testing only.
void
GetControllingWorkerScriptURLForPath(const nsAString& aPath,
nsString& aScriptURL,
ErrorResult& aRv);
private:
~ServiceWorkerContainer()
{ }
nsCOMPtr<nsPIDOMWindow> mWindow;
};
} // namespace workers
} // namespace dom
} // namespace mozilla
#endif /* mozilla_dom_workers_serviceworkercontainer_h__ */

Просмотреть файл

@ -8,7 +8,6 @@ TEST_DIRS += ['test']
# Public stuff.
EXPORTS.mozilla.dom += [
'ServiceWorkerContainer.h',
'WorkerPrivate.h',
'WorkerRunnable.h',
'WorkerScope.h',
@ -26,7 +25,6 @@ EXPORTS.mozilla.dom.workers.bindings += [
'Location.h',
'MessagePort.h',
'Navigator.h',
'ServiceWorker.h',
'SharedWorker.h',
'URL.h',
'WorkerFeature.h',
@ -47,8 +45,6 @@ SOURCES += [
'RegisterBindings.cpp',
'RuntimeService.cpp',
'ScriptLoader.cpp',
'ServiceWorker.cpp',
'ServiceWorkerContainer.cpp',
'SharedWorker.cpp',
'URL.cpp',
'WorkerPrivate.cpp',

Просмотреть файл

@ -6,7 +6,6 @@
DIRS += [
'extensions',
'serviceworkers',
]
MOCHITEST_MANIFESTS += ['mochitest.ini']

Просмотреть файл

@ -1 +0,0 @@
[test_navigator.html]

Просмотреть файл

@ -1,7 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
MOCHITEST_MANIFESTS += ['mochitest.ini']

Просмотреть файл

@ -1,41 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<title>Bug 930348 - test stub Navigator ServiceWorker utilities.</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.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">
function checkEnabled() {
ok(navigator.serviceWorker, "navigator.serviceWorker should exist when ServiceWorkers are enabled.");
ok(typeof navigator.serviceWorker.register === "function", "navigator.serviceWorker.register() should be a function.");
ok(typeof navigator.serviceWorker.unregister === "function", "navigator.serviceWorker.unregister() should be a function.");
ok(typeof navigator.serviceWorker.getAll === "function", "navigator.serviceWorker.getAll() should be a function.");
ok(typeof navigator.serviceWorker.whenReady === "function", "navigator.serviceWorker.whenReady() should be a function.");
ok(navigator.serviceWorker.installing === null, "There should be no installing worker for an uncontrolled document.");
ok(navigator.serviceWorker.waiting === null, "There should be no waiting worker for an uncontrolled document.");
ok(navigator.serviceWorker.current === null, "There should be no current worker for an uncontrolled document.");
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.enabled", true]
]}, function() {
checkEnabled();
SimpleTest.finish();
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -102,9 +102,6 @@ pref("dom.workers.maxPerDomain", 20);
// Whether or not Shared Web Workers are enabled.
pref("dom.workers.sharedWorkers.enabled", true);
// Service workers
pref("dom.serviceWorkers.enabled", false);
// Whether nonzero values can be returned from performance.timing.*
pref("dom.enable_performance", true);