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

Side by Side 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, 3 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 #ifndef WebIsolatedWorkerContextClient_h
3 #define WebIsolatedWorkerContextClient_h
4
5 #include "mojo/public/cpp/bindings/interface_request.h"
6 #include "mojo/public/cpp/bindings/struct_ptr.h"
7 #include "mojo/public/cpp/system/message_pipe.h"
8 #include "public/platform/WebCommon.h"
9 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
10
11 namespace blink {
12
13 namespace mojom {
14 class WorkerScriptList;
15 }
16
17 class WebIsolatedWorkerContextClient {
18 public:
19 using DataVector = std::vector<std::unique_ptr<std::vector<char>>>;
20 struct WebScriptData {
21 WebScriptData(const std::string& url, std::unique_ptr<DataVector> data, std::unique_ptr<DataVector> meta_data)
22 : url(url)
23 , data(std::move(data))
24 , meta_data(std::move(meta_data))
25 {
26 }
27 std::string url;
28 std::unique_ptr<DataVector> data;
29 std::unique_ptr<DataVector> meta_data;
30 };
31
32 virtual ~WebIsolatedWorkerContextClient() {}
33 virtual void initializeOnWorkerThread() {}
34 virtual void workerDestroyed() {}
35
36 virtual void connectToRemoteService(const char* name, mojo::ScopedMessagePip eHandle) = 0;
37
38 template <typename Interface>
39 void connectToRemoteService(mojo::InterfaceRequest<Interface> ptr)
40 {
41 connectToRemoteService(Interface::Name_, ptr.PassMessagePipe());
42 }
43
44 virtual std::unique_ptr<std::vector<std::unique_ptr<WebScriptData>>> takeWor kerScriptList() = 0;
45 virtual std::unique_ptr<WebServiceWorkerRegistration::Handle> takeAssociated Registration() = 0;
46 };
47
48 } // namespace blink
49
50 #endif // WebIsolatedWorkerContextClient_h
OLDNEW
« 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