| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 , public WebDevToolsAgentClient | 73 , public WebDevToolsAgentClient |
| 74 , private WorkerLoaderProxyProvider { | 74 , private WorkerLoaderProxyProvider { |
| 75 public: | 75 public: |
| 76 explicit WebSharedWorkerImpl(WebSharedWorkerClient*); | 76 explicit WebSharedWorkerImpl(WebSharedWorkerClient*); |
| 77 | 77 |
| 78 // WorkerReportingProxy methods: | 78 // WorkerReportingProxy methods: |
| 79 void reportException(const WTF::String&, std::unique_ptr<SourceLocation>, in
t exceptionId) override; | 79 void reportException(const WTF::String&, std::unique_ptr<SourceLocation>, in
t exceptionId) override; |
| 80 void reportConsoleMessage(MessageSource, MessageLevel, const String& message
, SourceLocation*) override; | 80 void reportConsoleMessage(MessageSource, MessageLevel, const String& message
, SourceLocation*) override; |
| 81 void postMessageToPageInspector(const WTF::String&) override; | 81 void postMessageToPageInspector(const WTF::String&) override; |
| 82 void didEvaluateWorkerScript(bool success) override { } | 82 void didEvaluateWorkerScript(bool success) override { } |
| 83 void workerGlobalScopeClosed() override; | 83 void didCloseWorkerGlobalScope() override; |
| 84 void workerThreadTerminated() override; | |
| 85 void willDestroyWorkerGlobalScope() override { } | 84 void willDestroyWorkerGlobalScope() override { } |
| 85 void didTerminateWorkerThread() override; |
| 86 | 86 |
| 87 // WebFrameClient methods to support resource loading thru the 'shadow page'
. | 87 // WebFrameClient methods to support resource loading thru the 'shadow page'
. |
| 88 WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostC
lient*) override; | 88 WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostC
lient*) override; |
| 89 void willSendRequest(WebLocalFrame*, WebURLRequest&) override; | 89 void willSendRequest(WebLocalFrame*, WebURLRequest&) override; |
| 90 void didFinishDocumentLoad(WebLocalFrame*) override; | 90 void didFinishDocumentLoad(WebLocalFrame*) override; |
| 91 bool isControlledByServiceWorker(WebDataSource&) override; | 91 bool isControlledByServiceWorker(WebDataSource&) override; |
| 92 int64_t serviceWorkerID(WebDataSource&) override; | 92 int64_t serviceWorkerID(WebDataSource&) override; |
| 93 InterfaceProvider* interfaceProvider() override; | 93 InterfaceProvider* interfaceProvider() override; |
| 94 | 94 |
| 95 // WebDevToolsAgentClient overrides. | 95 // WebDevToolsAgentClient overrides. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 117 void terminateWorkerThread(); | 117 void terminateWorkerThread(); |
| 118 | 118 |
| 119 // Creates the shadow loader used for worker network requests. | 119 // Creates the shadow loader used for worker network requests. |
| 120 void initializeLoader(); | 120 void initializeLoader(); |
| 121 | 121 |
| 122 void loadShadowPage(); | 122 void loadShadowPage(); |
| 123 void didReceiveScriptLoaderResponse(); | 123 void didReceiveScriptLoaderResponse(); |
| 124 void onScriptLoaderFinished(); | 124 void onScriptLoaderFinished(); |
| 125 | 125 |
| 126 static void connectTask(WebMessagePortChannelUniquePtr, ExecutionContext*); | 126 static void connectTask(WebMessagePortChannelUniquePtr, ExecutionContext*); |
| 127 |
| 127 // Tasks that are run on the main thread. | 128 // Tasks that are run on the main thread. |
| 128 void workerGlobalScopeClosedOnMainThread(); | 129 void didCloseWorkerGlobalScopeOnMainThread(); |
| 129 void workerThreadTerminatedOnMainThread(); | 130 void didTerminateWorkerThreadOnMainThread(); |
| 130 | 131 |
| 131 void postMessageToPageInspectorOnMainThread(const String& message); | 132 void postMessageToPageInspectorOnMainThread(const String& message); |
| 132 | 133 |
| 133 // WorkerLoaderProxyProvider | 134 // WorkerLoaderProxyProvider |
| 134 void postTaskToLoader(const WebTraceLocation&, std::unique_ptr<ExecutionCont
extTask>) override; | 135 void postTaskToLoader(const WebTraceLocation&, std::unique_ptr<ExecutionCont
extTask>) override; |
| 135 void postTaskToWorkerGlobalScope(const WebTraceLocation&, std::unique_ptr<Ex
ecutionContextTask>) override; | 136 void postTaskToWorkerGlobalScope(const WebTraceLocation&, std::unique_ptr<Ex
ecutionContextTask>) override; |
| 136 | 137 |
| 137 // 'shadow page' - created to proxy loading requests from the worker. | 138 // 'shadow page' - created to proxy loading requests from the worker. |
| 138 Persistent<ExecutionContext> m_loadingDocument; | 139 Persistent<ExecutionContext> m_loadingDocument; |
| 139 WebView* m_webView; | 140 WebView* m_webView; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 160 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 161 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
| 161 | 162 |
| 162 WebURL m_url; | 163 WebURL m_url; |
| 163 WebString m_name; | 164 WebString m_name; |
| 164 WebAddressSpace m_creationAddressSpace; | 165 WebAddressSpace m_creationAddressSpace; |
| 165 }; | 166 }; |
| 166 | 167 |
| 167 } // namespace blink | 168 } // namespace blink |
| 168 | 169 |
| 169 #endif // WebSharedWorkerImpl_h | 170 #endif // WebSharedWorkerImpl_h |
| OLD | NEW |