| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include <memory> | 36 #include <memory> |
| 37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 38 #include "public/platform/WebContentSecurityPolicy.h" | 38 #include "public/platform/WebContentSecurityPolicy.h" |
| 39 #include "public/web/WebDevToolsAgentClient.h" | 39 #include "public/web/WebDevToolsAgentClient.h" |
| 40 #include "public/web/WebEmbeddedWorker.h" | 40 #include "public/web/WebEmbeddedWorker.h" |
| 41 #include "public/web/WebEmbeddedWorkerStartData.h" | 41 #include "public/web/WebEmbeddedWorkerStartData.h" |
| 42 #include "public/web/WebFrameClient.h" | 42 #include "public/web/WebFrameClient.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class ThreadableLoadingContext; |
| 46 class ParentFrameTaskRunners; | 47 class ParentFrameTaskRunners; |
| 47 class ServiceWorkerGlobalScopeProxy; | 48 class ServiceWorkerGlobalScopeProxy; |
| 48 class WebLocalFrameImpl; | 49 class WebLocalFrameImpl; |
| 49 class WebServiceWorkerNetworkProvider; | 50 class WebServiceWorkerNetworkProvider; |
| 50 class WebView; | 51 class WebView; |
| 51 class WorkerInspectorProxy; | 52 class WorkerInspectorProxy; |
| 52 class WorkerScriptLoader; | 53 class WorkerScriptLoader; |
| 53 class WorkerThread; | 54 class WorkerThread; |
| 54 | 55 |
| 55 class WebEmbeddedWorkerImpl final : public WebEmbeddedWorker, | 56 class WebEmbeddedWorkerImpl final : public WebEmbeddedWorker, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 100 |
| 100 void onScriptLoaderFinished(); | 101 void onScriptLoaderFinished(); |
| 101 void startWorkerThread(); | 102 void startWorkerThread(); |
| 102 | 103 |
| 103 // WorkerLoaderProxyProvider | 104 // WorkerLoaderProxyProvider |
| 104 void postTaskToLoader(const WebTraceLocation&, | 105 void postTaskToLoader(const WebTraceLocation&, |
| 105 std::unique_ptr<WTF::CrossThreadClosure>) override; | 106 std::unique_ptr<WTF::CrossThreadClosure>) override; |
| 106 void postTaskToWorkerGlobalScope( | 107 void postTaskToWorkerGlobalScope( |
| 107 const WebTraceLocation&, | 108 const WebTraceLocation&, |
| 108 std::unique_ptr<WTF::CrossThreadClosure>) override; | 109 std::unique_ptr<WTF::CrossThreadClosure>) override; |
| 109 ExecutionContext* getLoaderExecutionContext() override; | 110 ThreadableLoadingContext* getThreadableLoadingContext() override; |
| 110 | 111 |
| 111 WebEmbeddedWorkerStartData m_workerStartData; | 112 WebEmbeddedWorkerStartData m_workerStartData; |
| 112 | 113 |
| 113 std::unique_ptr<WebServiceWorkerContextClient> m_workerContextClient; | 114 std::unique_ptr<WebServiceWorkerContextClient> m_workerContextClient; |
| 114 | 115 |
| 115 // This is kept until startWorkerContext is called, and then passed on | 116 // This is kept until startWorkerContext is called, and then passed on |
| 116 // to WorkerContext. | 117 // to WorkerContext. |
| 117 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; | 118 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; |
| 118 | 119 |
| 119 // We retain ownership of this one which is for use on the | 120 // We retain ownership of this one which is for use on the |
| (...skipping 12 matching lines...) Expand all Loading... |
| 132 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; | 133 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; |
| 133 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; | 134 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; |
| 134 | 135 |
| 135 // 'shadow page' - created to proxy loading requests from the worker. | 136 // 'shadow page' - created to proxy loading requests from the worker. |
| 136 // Both WebView and WebFrame objects are close()'ed (where they're | 137 // Both WebView and WebFrame objects are close()'ed (where they're |
| 137 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they | 138 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they |
| 138 // are guaranteed to exist while this object is around. | 139 // are guaranteed to exist while this object is around. |
| 139 WebView* m_webView; | 140 WebView* m_webView; |
| 140 | 141 |
| 141 Persistent<WebLocalFrameImpl> m_mainFrame; | 142 Persistent<WebLocalFrameImpl> m_mainFrame; |
| 143 Persistent<ThreadableLoadingContext> m_loadingContext; |
| 142 | 144 |
| 143 bool m_loadingShadowPage; | 145 bool m_loadingShadowPage; |
| 144 bool m_askedToTerminate; | 146 bool m_askedToTerminate; |
| 145 | 147 |
| 146 enum WaitingForDebuggerState { WaitingForDebugger, NotWaitingForDebugger }; | 148 enum WaitingForDebuggerState { WaitingForDebugger, NotWaitingForDebugger }; |
| 147 | 149 |
| 148 enum { | 150 enum { |
| 149 DontPauseAfterDownload, | 151 DontPauseAfterDownload, |
| 150 DoPauseAfterDownload, | 152 DoPauseAfterDownload, |
| 151 IsPausedAfterDownload | 153 IsPausedAfterDownload |
| 152 } m_pauseAfterDownloadState; | 154 } m_pauseAfterDownloadState; |
| 153 | 155 |
| 154 WaitingForDebuggerState m_waitingForDebuggerState; | 156 WaitingForDebuggerState m_waitingForDebuggerState; |
| 155 }; | 157 }; |
| 156 | 158 |
| 157 } // namespace blink | 159 } // namespace blink |
| 158 | 160 |
| 159 #endif // WebEmbeddedWorkerImpl_h | 161 #endif // WebEmbeddedWorkerImpl_h |
| OLD | NEW |