| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 const WebString&) override; | 95 const WebString&) override; |
| 96 void resumeStartup() override; | 96 void resumeStartup() override; |
| 97 WebDevToolsAgentClient::WebKitClientMessageLoop* createClientMessageLoop() | 97 WebDevToolsAgentClient::WebKitClientMessageLoop* createClientMessageLoop() |
| 98 override; | 98 override; |
| 99 | 99 |
| 100 void onScriptLoaderFinished(); | 100 void onScriptLoaderFinished(); |
| 101 void startWorkerThread(); | 101 void startWorkerThread(); |
| 102 | 102 |
| 103 // WorkerLoaderProxyProvider | 103 // WorkerLoaderProxyProvider |
| 104 void postTaskToLoader(const WebTraceLocation&, | 104 void postTaskToLoader(const WebTraceLocation&, |
| 105 std::unique_ptr<ExecutionContextTask>) override; | 105 std::unique_ptr<WTF::CrossThreadClosure>) override; |
| 106 void postTaskToWorkerGlobalScope( | 106 void postTaskToWorkerGlobalScope( |
| 107 const WebTraceLocation&, | 107 const WebTraceLocation&, |
| 108 std::unique_ptr<WTF::CrossThreadClosure>) override; | 108 std::unique_ptr<WTF::CrossThreadClosure>) override; |
| 109 ExecutionContext* getLoaderExecutionContext() override; |
| 109 | 110 |
| 110 WebEmbeddedWorkerStartData m_workerStartData; | 111 WebEmbeddedWorkerStartData m_workerStartData; |
| 111 | 112 |
| 112 std::unique_ptr<WebServiceWorkerContextClient> m_workerContextClient; | 113 std::unique_ptr<WebServiceWorkerContextClient> m_workerContextClient; |
| 113 | 114 |
| 114 // This is kept until startWorkerContext is called, and then passed on | 115 // This is kept until startWorkerContext is called, and then passed on |
| 115 // to WorkerContext. | 116 // to WorkerContext. |
| 116 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; | 117 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; |
| 117 | 118 |
| 118 // We retain ownership of this one which is for use on the | 119 // We retain ownership of this one which is for use on the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 130 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 131 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
| 131 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; | 132 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; |
| 132 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; | 133 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; |
| 133 | 134 |
| 134 // 'shadow page' - created to proxy loading requests from the worker. | 135 // 'shadow page' - created to proxy loading requests from the worker. |
| 135 // Both WebView and WebFrame objects are close()'ed (where they're | 136 // Both WebView and WebFrame objects are close()'ed (where they're |
| 136 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they | 137 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they |
| 137 // are guaranteed to exist while this object is around. | 138 // are guaranteed to exist while this object is around. |
| 138 WebView* m_webView; | 139 WebView* m_webView; |
| 139 | 140 |
| 140 // Accessed cross-thread when worker thread posts tasks to the parent. | 141 Persistent<WebLocalFrameImpl> m_mainFrame; |
| 141 // | |
| 142 // TODO: avoid reaching into the local frame object when posting. | |
| 143 CrossThreadPersistent<WebLocalFrameImpl> m_mainFrame; | |
| 144 | 142 |
| 145 bool m_loadingShadowPage; | 143 bool m_loadingShadowPage; |
| 146 bool m_askedToTerminate; | 144 bool m_askedToTerminate; |
| 147 | 145 |
| 148 enum WaitingForDebuggerState { WaitingForDebugger, NotWaitingForDebugger }; | 146 enum WaitingForDebuggerState { WaitingForDebugger, NotWaitingForDebugger }; |
| 149 | 147 |
| 150 enum { | 148 enum { |
| 151 DontPauseAfterDownload, | 149 DontPauseAfterDownload, |
| 152 DoPauseAfterDownload, | 150 DoPauseAfterDownload, |
| 153 IsPausedAfterDownload | 151 IsPausedAfterDownload |
| 154 } m_pauseAfterDownloadState; | 152 } m_pauseAfterDownloadState; |
| 155 | 153 |
| 156 WaitingForDebuggerState m_waitingForDebuggerState; | 154 WaitingForDebuggerState m_waitingForDebuggerState; |
| 157 }; | 155 }; |
| 158 | 156 |
| 159 } // namespace blink | 157 } // namespace blink |
| 160 | 158 |
| 161 #endif // WebEmbeddedWorkerImpl_h | 159 #endif // WebEmbeddedWorkerImpl_h |
| OLD | NEW |