Skip to content

Commit

Permalink
Revert of ServiceWorker: throw when close() or terminate() called (pa…
Browse files Browse the repository at this point in the history
…tchset #3 of https://codereview.chromium.org/505063002/)

Reason for revert:
Break compilation on various bots. Maybe Win only.

Original issue's description:
> ServiceWorker: throw when close() or terminate() called
> 
> Per spec:
> * ServiceWorker#terminate() should throw InvalidAccessError
> * ServiceWorkerGlobalScope#close() should throw InvalidAccessError
> 
> ... since the behaviors inherited from the base interfaces are not
> supported.
> 
> Spec: slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
> 
> BUG=398318
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181049

[email protected],[email protected]
NOTREECHECKS=true
NOTRY=true
BUG=398318

Review URL: https://codereview.chromium.org/515323002

git-svn-id: svn://svn.chromium.org/blink/trunk@181050 bbb929c8-8fbe-4397-9dbb-9b2b20218538
  • Loading branch information
mounirlamouri committed Aug 28, 2014
1 parent 197b360 commit 1471064
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 76 deletions.
1 change: 0 additions & 1 deletion LayoutTests/http/tests/serviceworker/interfaces.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
{
scriptURL: 'string',
state: 'string',
terminate: 'function',
onstatechange: EVENT_HANDLER
});
return registration.unregister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ self.onmessage = function(e) {

function quit(port) {
port.postMessage('quit');
self.close();
}

function doFetchTwiceTest(port) {
Expand Down Expand Up @@ -91,4 +92,4 @@ function doTextTest(port) {
doJSONTest(port);
});
});
}
}
17 changes: 5 additions & 12 deletions LayoutTests/http/tests/serviceworker/resources/fetch-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ var testTargets = [
];

function doNextFetchTest(port) {

function runInfiniteFetchLoop() {
fetch('dummy.html')
.then(function() { runInfiniteFetchLoop(); });
}

if (testTargets.length == 0) {
// Destroying the execution context while fetch is happening
// should not cause a crash.
runInfiniteFetchLoop();

port.postMessage('quit');
return;
port.postMessage('quit');
// Destroying the execution context while fetch is happening should not cause a crash.
fetch('dummy.html').then(function() {}).catch(function() {});
self.close();
return;
}
var target = testTargets.shift();
fetch(target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ test(function() {
{
scope: 'string',
clients: 'object',
close: 'function',

onactivate: EVENT_HANDLER,
onfetch: EVENT_HANDLER,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions Source/modules/serviceworkers/ServiceWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ void ServiceWorker::postMessage(ExecutionContext*, PassRefPtr<SerializedScriptVa
m_outerWorker->postMessage(messageString, webChannels.leakPtr());
}

void ServiceWorker::terminate(ExceptionState& exceptionState)
{
exceptionState.throwDOMException(InvalidAccessError, "Not supported.");
}

bool ServiceWorker::isReady()
{
return m_proxyState == Ready;
Expand Down
1 change: 0 additions & 1 deletion Source/modules/serviceworkers/ServiceWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class ServiceWorker FINAL : public AbstractWorker, public WebServiceWorkerProxy
static void dispose(WebType*);

void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, ExceptionState&);
void terminate(ExceptionState&);

String scriptURL() const;
const AtomicString& state() const;
Expand Down
2 changes: 0 additions & 2 deletions Source/modules/serviceworkers/ServiceWorker.idl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ enum ServiceWorkerState {
// FIXME: Should inherit this from Worker.
[Custom, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);

[RaisesException] void terminate();

readonly attribute ScalarValueString scriptURL;
readonly attribute ServiceWorkerState state;

Expand Down
5 changes: 0 additions & 5 deletions Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ PassRefPtrWillBeRawPtr<ServiceWorkerClients> ServiceWorkerGlobalScope::clients()
return m_clients;
}

void ServiceWorkerGlobalScope::close(ExceptionState& exceptionState)
{
exceptionState.throwDOMException(InvalidAccessError, "Not supported.");
}

const AtomicString& ServiceWorkerGlobalScope::interfaceName() const
{
return EventTargetNames::ServiceWorkerGlobalScope;
Expand Down
2 changes: 0 additions & 2 deletions Source/modules/serviceworkers/ServiceWorkerGlobalScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ class ServiceWorkerGlobalScope FINAL : public WorkerGlobalScope {
ScriptPromise fetch(ScriptState*, const String&);
ScriptPromise fetch(ScriptState*, const String&, const Dictionary&);

void close(ExceptionState&);

// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;

Expand Down
2 changes: 0 additions & 2 deletions Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
[CallWith=ScriptState] Promise fetch(DOMString request, optional Dictionary requestInitDict);
[CallWith=ScriptState] Promise fetch(Request request, optional Dictionary requestInitDict);

[RaisesException] void close();

attribute EventHandler onactivate;
attribute EventHandler onfetch;
attribute EventHandler oninstall;
Expand Down

0 comments on commit 1471064

Please sign in to comment.