Commit 090677ed authored by jsbell@chromium.org's avatar jsbell@chromium.org

Service Workers: Remove overloads for optional Dictionary arguments

Trailing optional Dictionary are automagically handled by bindings,
with a new empty dictionary passed in if the argument is not
specified by script. Overloads are not needed in this case.

BUG=373120

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

git-svn-id: svn://svn.chromium.org/blink/trunk@185312 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 41208c9f
......@@ -99,22 +99,6 @@ CacheStorage* ServiceWorkerGlobalScope::caches(ExecutionContext* context)
return m_caches;
}
ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request* request)
{
if (!m_fetchManager)
return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "ServiceWorkerGlobalScope is shutting down."));
// "Let |r| be the associated request of the result of invoking the initial
// value of Request as constructor with |input| and |init| as arguments. If
// this throws an exception, reject |p| with it."
TrackExceptionState exceptionState;
Request* r = Request::create(this, request, exceptionState);
if (exceptionState.hadException()) {
// FIXME: We should throw the caught error.
return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), exceptionState.message()));
}
return m_fetchManager->fetch(scriptState, r->request());
}
ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request* request, const Dictionary& requestInit)
{
if (!m_fetchManager)
......@@ -131,22 +115,6 @@ ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, Request*
return m_fetchManager->fetch(scriptState, r->request());
}
ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, const String& urlstring)
{
if (!m_fetchManager)
return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "ServiceWorkerGlobalScope is shutting down."));
// "Let |r| be the associated request of the result of invoking the initial
// value of Request as constructor with |input| and |init| as arguments. If
// this throws an exception, reject |p| with it."
TrackExceptionState exceptionState;
Request* r = Request::create(this, urlstring, exceptionState);
if (exceptionState.hadException()) {
// FIXME: We should throw the caught error.
return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), exceptionState.message()));
}
return m_fetchManager->fetch(scriptState, r->request());
}
ScriptPromise ServiceWorkerGlobalScope::fetch(ScriptState* scriptState, const String& urlstring, const Dictionary& requestInit)
{
if (!m_fetchManager)
......
......@@ -67,9 +67,7 @@ public:
CacheStorage* caches(ExecutionContext*);
ScriptPromise fetch(ScriptState*, Request*);
ScriptPromise fetch(ScriptState*, Request*, const Dictionary&);
ScriptPromise fetch(ScriptState*, const String&);
ScriptPromise fetch(ScriptState*, const String&, const Dictionary&);
void close(ExceptionState&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment