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

Unified Diff: third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h

Issue 2118243002: [proof-of-concept] SW thread independent of the main thread Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 | « third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h
diff --git a/third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h b/third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h
new file mode 100644
index 0000000000000000000000000000000000000000..dac9bce472f54fe6797237912dead89ecc8b95d9
--- /dev/null
+++ b/third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorkerContextClient.h
@@ -0,0 +1,50 @@
+
+#ifndef WebIsolatedWorkerContextClient_h
+#define WebIsolatedWorkerContextClient_h
+
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/bindings/struct_ptr.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+#include "public/platform/WebCommon.h"
+#include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
+
+namespace blink {
+
+namespace mojom {
+ class WorkerScriptList;
+}
+
+class WebIsolatedWorkerContextClient {
+public:
+ using DataVector = std::vector<std::unique_ptr<std::vector<char>>>;
+ struct WebScriptData {
+ WebScriptData(const std::string& url, std::unique_ptr<DataVector> data, std::unique_ptr<DataVector> meta_data)
+ : url(url)
+ , data(std::move(data))
+ , meta_data(std::move(meta_data))
+ {
+ }
+ std::string url;
+ std::unique_ptr<DataVector> data;
+ std::unique_ptr<DataVector> meta_data;
+ };
+
+ virtual ~WebIsolatedWorkerContextClient() {}
+ virtual void initializeOnWorkerThread() {}
+ virtual void workerDestroyed() {}
+
+ virtual void connectToRemoteService(const char* name, mojo::ScopedMessagePipeHandle) = 0;
+
+ template <typename Interface>
+ void connectToRemoteService(mojo::InterfaceRequest<Interface> ptr)
+ {
+ connectToRemoteService(Interface::Name_, ptr.PassMessagePipe());
+ }
+
+ virtual std::unique_ptr<std::vector<std::unique_ptr<WebScriptData>>> takeWorkerScriptList() = 0;
+ virtual std::unique_ptr<WebServiceWorkerRegistration::Handle> takeAssociatedRegistration() = 0;
+};
+
+} // namespace blink
+
+#endif // WebIsolatedWorkerContextClient_h
« no previous file with comments | « third_party/WebKit/public/web/modules/serviceworker/WebIsolatedWorker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698