Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

Issue 1190503002: ServiceWorker: Route unregister() through WebServiceWorkerRegistration for refactoring (3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@route_web_sw_reg_1
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | public/platform/WebServiceWorkerProvider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index fa2e56abbbcb5d4a88df622dca4f2ff30eac51fb..cf94bd521093010a71a84420d370e05d490051f3 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -105,16 +105,7 @@ ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState)
return promise;
}
- RefPtr<SecurityOrigin> documentOrigin = scriptState->executionContext()->securityOrigin();
- KURL scopeURL = scriptState->executionContext()->completeURL(scope());
- scopeURL.removeFragmentIdentifier();
- if (!scope().isEmpty() && !documentOrigin->canRequest(scopeURL)) {
- RefPtr<SecurityOrigin> scopeOrigin = SecurityOrigin::create(scopeURL);
- resolver->reject(DOMException::create(SecurityError, "Failed to unregister a ServiceWorkerRegistration: The origin of the registration's scope ('" + scopeOrigin->toString() + "') does not match the current origin ('" + documentOrigin->toString() + "')."));
- return promise;
- }
-
- m_provider->unregisterServiceWorker(scopeURL, new CallbackPromiseAdapter<bool, ServiceWorkerError>(resolver));
+ m_outerRegistration->unregister(m_provider, new CallbackPromiseAdapter<bool, ServiceWorkerError>(resolver));
return promise;
}
« no previous file with comments | « no previous file | public/platform/WebServiceWorkerProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698