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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: int32_t -> uint32_t Created 3 years, 10 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
Index: third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp b/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
index 73160f042ade6669ce253c8138413baca46ac274..ea09389dd824fe6804084a897e33bf4620136458 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
@@ -26,14 +26,16 @@ NavigatorServiceWorker& NavigatorServiceWorker::from(Navigator& navigator) {
if (!supplement) {
supplement = new NavigatorServiceWorker(navigator);
provideTo(navigator, supplementName(), supplement);
- if (navigator.frame() &&
- navigator.frame()
- ->securityContext()
- ->getSecurityOrigin()
- ->canAccessServiceWorkers()) {
- // Initialize ServiceWorkerContainer too.
- supplement->serviceWorker(navigator.frame(), ASSERT_NO_EXCEPTION);
- }
+ }
+ if (navigator.frame() &&
+ navigator.frame()
+ ->securityContext()
+ ->getSecurityOrigin()
+ ->canAccessServiceWorkers()) {
+ // Ensure ServiceWorkerContainer. It can be cleared regardless of
+ // |supplement|. See comments in NavigatorServiceWorker::serviceWorker() for
+ // details.
+ supplement->serviceWorker(navigator.frame(), ASSERT_NO_EXCEPTION);
}
return *supplement;
}

Powered by Google App Engine
This is Rietveld 408576698