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

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

Issue 213223005: Use the Navigator's frame in navigator.serviceWorker and associated container. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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: Source/modules/serviceworkers/NavigatorServiceWorker.cpp
diff --git a/Source/modules/serviceworkers/NavigatorServiceWorker.cpp b/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
index d4068538cffcd18730fd68b633c2fb63d149d7a9..57ef2a1511c27e672f5c163ede7eaf9076194398 100644
--- a/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
+++ b/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
@@ -5,6 +5,8 @@
#include "config.h"
#include "modules/serviceworkers/NavigatorServiceWorker.h"
+#include "core/frame/DOMWindow.h"
+#include "core/frame/LocalFrame.h"
#include "core/frame/Navigator.h"
#include "modules/serviceworkers/ServiceWorkerContainer.h"
@@ -39,15 +41,17 @@ const char* NavigatorServiceWorker::supplementName()
return "NavigatorServiceWorker";
}
-ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(ExecutionContext* executionContext, Navigator& navigator)
+ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(Navigator& navigator)
{
- return NavigatorServiceWorker::from(navigator).serviceWorker(executionContext);
+ return NavigatorServiceWorker::from(navigator).serviceWorker();
}
-ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(ExecutionContext* executionContext)
+ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker()
{
- if (!m_serviceWorker && frame())
- m_serviceWorker = ServiceWorkerContainer::create(executionContext);
+ if (!m_serviceWorker && frame()) {
+ ASSERT(frame()->domWindow());
+ m_serviceWorker = ServiceWorkerContainer::create(frame()->domWindow()->executionContext());
+ }
return m_serviceWorker.get();
}
« no previous file with comments | « Source/modules/serviceworkers/NavigatorServiceWorker.h ('k') | Source/modules/serviceworkers/NavigatorServiceWorker.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698