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

Side by Side Diff: third_party/WebKit/Source/web/WebIsolatedWorkerImpl.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
OLDNEW
(Empty)
1
2 #ifndef WebIsolatedWorkerImpl_h
3 #define WebIsolatedWorkerImpl_h
4
5 #include <memory>
6
7 #include "core/workers/WorkerLoaderProxy.h"
8 #include "public/platform/WebCommon.h"
9 #include "public/web/modules/serviceworker/WebIsolatedWorker.h"
10 #include "public/web/WebFrameClient.h"
11
12 namespace blink {
13
14 class WebIsolatedWorkerContextClient;
15 class WorkerBackingThread;
16 class WebView;
17 class WebLocalFrameImpl;
18 class IsolatedWorkerThread;
19 class IsolatedWorkerReportingProxy;
20
21 class WebIsolatedWorkerImpl : public WebIsolatedWorker {
22 public:
23 WebIsolatedWorkerImpl(std::unique_ptr<WebIsolatedWorkerContextClient>);
24 ~WebIsolatedWorkerImpl() override;
25 void startWorker(int64_t versionID, WebURL scopeURL, WebURL scriptURL) overr ide;
26 IsolatedWorkerThread* thread() { return m_workerThread.get(); }
27
28 private:
29 class MainThreadProxy final : public ThreadSafeRefCounted<MainThreadProxy>, public WebFrameClient, public WorkerLoaderProxyProvider {
30 public:
31 MainThreadProxy(WebIsolatedWorkerImpl* worker, KURL scopeURL);
32 ~MainThreadProxy();
33 void detach();
34
35 private:
36 void initializeOnMainThread(KURL scopeURL);
37
38 // WorkerLoaderProxyProvider
39 void postTaskToLoader(const WebTraceLocation&, std::unique_ptr<Execution ContextTask>) override;
40 void postTaskToWorkerGlobalScope(const WebTraceLocation&, std::unique_pt r<ExecutionContextTask>) override;
41
42 // WebFrameClient overrides.
43 void willSendRequest(WebLocalFrame*, WebURLRequest&) override;
44 void didFinishDocumentLoad(WebLocalFrame*) override;
45
46 Mutex m_lock_for_worker;
47 Mutex m_lock_for_document;
48 WebIsolatedWorkerImpl* m_worker = nullptr;
49 KURL m_scopeURL;
50 WebView* m_webView = nullptr;
51 Persistent<WebLocalFrameImpl> m_mainFrame;
52 bool m_shadowPageLoadStarted = false;
53 bool m_shadowPageLoaded = false;
54 std::vector<std::unique_ptr<ExecutionContextTask>> m_pending_tasks;
55 };
56
57 std::unique_ptr<WorkerBackingThread> m_workerBackingThread;
58
59 RefPtr<MainThreadProxy> m_mainThreadProxy;
60 RefPtr<WorkerLoaderProxy> m_loaderProxy;
61 std::unique_ptr<IsolatedWorkerReportingProxy> m_workerGlobalScopeProxy;
62 std::unique_ptr<IsolatedWorkerThread> m_workerThread;
63 };
64
65 } // namespace blink
66
67 #endif // WebIsolatedWorkerImpl_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | third_party/WebKit/Source/web/WebIsolatedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698