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

Unified Diff: public/web/WebServiceWorkerContextProxy.h

Issue 383063008: Expose the ServiceWorker's v8 context to embedders. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Don't #include .cpp files. :-P Created 6 years, 5 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: public/web/WebServiceWorkerContextProxy.h
diff --git a/public/web/WebServiceWorkerContextProxy.h b/public/web/WebServiceWorkerContextProxy.h
index 6c6328d0bff08558f93467121aed29e30a8854f9..a53b90fb8685637a11cc4333f8a86d5d0a4c831d 100644
--- a/public/web/WebServiceWorkerContextProxy.h
+++ b/public/web/WebServiceWorkerContextProxy.h
@@ -33,6 +33,12 @@
#include "public/platform/WebMessagePortChannel.h"
+namespace v8 {
+class Context;
+template <class T>
+class Handle;
+}
+
namespace blink {
class WebServiceWorkerRequest;
@@ -56,6 +62,11 @@ public:
// Once the ServiceWorker has finished handling the sync event
// didHandleSyncEvent is called on the context client.
virtual void dispatchSyncEvent(int syncEventID) = 0;
+
+ // Returns the raw v8 context for the Service Worker. This must be called
+ // with an active HandleScope, and the handle is non-null in non-cleanup
+ // tasks from workerContextStarted() to willDestroyWorkerContext().
+ virtual v8::Handle<v8::Context> v8Context() = 0;
};
} // namespace blink
« Source/web/tests/ServiceWorkerGlobalScopeProxyTest.cpp ('K') | « Source/web/web.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698