| Index: third_party/WebKit/Source/web/WebIsolatedWorkerImpl.h
|
| diff --git a/third_party/WebKit/Source/web/WebIsolatedWorkerImpl.h b/third_party/WebKit/Source/web/WebIsolatedWorkerImpl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7b14f0451f908e8b78f9f5f994c952c546791d4b
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/web/WebIsolatedWorkerImpl.h
|
| @@ -0,0 +1,67 @@
|
| +
|
| +#ifndef WebIsolatedWorkerImpl_h
|
| +#define WebIsolatedWorkerImpl_h
|
| +
|
| +#include <memory>
|
| +
|
| +#include "core/workers/WorkerLoaderProxy.h"
|
| +#include "public/platform/WebCommon.h"
|
| +#include "public/web/modules/serviceworker/WebIsolatedWorker.h"
|
| +#include "public/web/WebFrameClient.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class WebIsolatedWorkerContextClient;
|
| +class WorkerBackingThread;
|
| +class WebView;
|
| +class WebLocalFrameImpl;
|
| +class IsolatedWorkerThread;
|
| +class IsolatedWorkerReportingProxy;
|
| +
|
| +class WebIsolatedWorkerImpl : public WebIsolatedWorker {
|
| +public:
|
| + WebIsolatedWorkerImpl(std::unique_ptr<WebIsolatedWorkerContextClient>);
|
| + ~WebIsolatedWorkerImpl() override;
|
| + void startWorker(int64_t versionID, WebURL scopeURL, WebURL scriptURL) override;
|
| + IsolatedWorkerThread* thread() { return m_workerThread.get(); }
|
| +
|
| +private:
|
| + class MainThreadProxy final : public ThreadSafeRefCounted<MainThreadProxy>, public WebFrameClient, public WorkerLoaderProxyProvider {
|
| + public:
|
| + MainThreadProxy(WebIsolatedWorkerImpl* worker, KURL scopeURL);
|
| + ~MainThreadProxy();
|
| + void detach();
|
| +
|
| + private:
|
| + void initializeOnMainThread(KURL scopeURL);
|
| +
|
| + // WorkerLoaderProxyProvider
|
| + void postTaskToLoader(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) override;
|
| + void postTaskToWorkerGlobalScope(const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>) override;
|
| +
|
| + // WebFrameClient overrides.
|
| + void willSendRequest(WebLocalFrame*, WebURLRequest&) override;
|
| + void didFinishDocumentLoad(WebLocalFrame*) override;
|
| +
|
| + Mutex m_lock_for_worker;
|
| + Mutex m_lock_for_document;
|
| + WebIsolatedWorkerImpl* m_worker = nullptr;
|
| + KURL m_scopeURL;
|
| + WebView* m_webView = nullptr;
|
| + Persistent<WebLocalFrameImpl> m_mainFrame;
|
| + bool m_shadowPageLoadStarted = false;
|
| + bool m_shadowPageLoaded = false;
|
| + std::vector<std::unique_ptr<ExecutionContextTask>> m_pending_tasks;
|
| + };
|
| +
|
| + std::unique_ptr<WorkerBackingThread> m_workerBackingThread;
|
| +
|
| + RefPtr<MainThreadProxy> m_mainThreadProxy;
|
| + RefPtr<WorkerLoaderProxy> m_loaderProxy;
|
| + std::unique_ptr<IsolatedWorkerReportingProxy> m_workerGlobalScopeProxy;
|
| + std::unique_ptr<IsolatedWorkerThread> m_workerThread;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // WebIsolatedWorkerImpl_h
|
|
|