| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 5 #ifndef CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
| 6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
| 11 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" | 11 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 class WebApplicationCacheHost; | 14 class WebApplicationCacheHost; |
| 15 class WebApplicationCacheHostClient; | 15 class WebApplicationCacheHostClient; |
| 16 class WebFrame; | 16 class WebFrame; |
| 17 class WebSecurityOrigin; | 17 class WebSecurityOrigin; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 class SharedWorkerDevToolsAgent; | 22 class SharedWorkerDevToolsAgent; |
| 23 class WebSharedWorkerStub; | 23 class WebSharedWorkerStub; |
| 24 class WorkerWebApplicationCacheHostImpl; |
| 24 | 25 |
| 25 // This class receives IPCs from the renderer and calls the WebCore::Worker | 26 // This class receives IPCs from the renderer and calls the WebCore::Worker |
| 26 // implementation (after the data types have been converted by glue code). It | 27 // implementation (after the data types have been converted by glue code). It |
| 27 // is also called by the worker code and converts these function calls into | 28 // is also called by the worker code and converts these function calls into |
| 28 // IPCs that are sent to the renderer, where they're converted back to function | 29 // IPCs that are sent to the renderer, where they're converted back to function |
| 29 // calls by WebWorkerProxy. | 30 // calls by WebWorkerProxy. |
| 30 class WebSharedWorkerClientProxy : public blink::WebSharedWorkerClient { | 31 class WebSharedWorkerClientProxy : public blink::WebSharedWorkerClient { |
| 31 public: | 32 public: |
| 32 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub); | 33 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub); |
| 33 virtual ~WebSharedWorkerClientProxy(); | 34 virtual ~WebSharedWorkerClientProxy(); |
| 34 | 35 |
| 35 // WebSharedWorkerClient implementation. | 36 // WebSharedWorkerClient implementation. |
| 36 virtual void workerContextClosed(); | 37 virtual void workerContextClosed(); |
| 37 virtual void workerContextDestroyed(); | 38 virtual void workerContextDestroyed(); |
| 39 virtual void workerScriptLoaded(); |
| 40 virtual void workerScriptLoadFailed(); |
| 41 virtual void selectAppCacheID(long long app_cache_id); |
| 38 | 42 |
| 39 virtual blink::WebNotificationPresenter* notificationPresenter(); | 43 virtual blink::WebNotificationPresenter* notificationPresenter(); |
| 40 | 44 |
| 41 virtual blink::WebApplicationCacheHost* createApplicationCacheHost( | 45 virtual blink::WebApplicationCacheHost* createApplicationCacheHost( |
| 42 blink::WebApplicationCacheHostClient* client); | 46 blink::WebApplicationCacheHostClient* client); |
| 43 virtual blink::WebWorkerPermissionClientProxy* | 47 virtual blink::WebWorkerPermissionClientProxy* |
| 44 createWorkerPermissionClientProxy( | 48 createWorkerPermissionClientProxy( |
| 45 const blink::WebSecurityOrigin& origin); | 49 const blink::WebSecurityOrigin& origin); |
| 46 | 50 |
| 47 virtual void dispatchDevToolsMessage(const blink::WebString&); | 51 virtual void dispatchDevToolsMessage(const blink::WebString&); |
| 48 virtual void saveDevToolsAgentState(const blink::WebString&); | 52 virtual void saveDevToolsAgentState(const blink::WebString&); |
| 49 | 53 |
| 50 void EnsureWorkerContextTerminates(); | 54 void EnsureWorkerContextTerminates(); |
| 51 | 55 |
| 52 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { | 56 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { |
| 53 devtools_agent_ = devtools_agent; | 57 devtools_agent_ = devtools_agent; |
| 54 } | 58 } |
| 55 | 59 |
| 56 private: | 60 private: |
| 57 bool Send(IPC::Message* message); | 61 bool Send(IPC::Message* message); |
| 58 | 62 |
| 59 int route_id_; | 63 int route_id_; |
| 60 int appcache_host_id_; | 64 int appcache_host_id_; |
| 61 WebSharedWorkerStub* stub_; | 65 WebSharedWorkerStub* stub_; |
| 62 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_; | 66 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_; |
| 63 SharedWorkerDevToolsAgent* devtools_agent_; | 67 SharedWorkerDevToolsAgent* devtools_agent_; |
| 68 WorkerWebApplicationCacheHostImpl* app_cache_host_; |
| 64 | 69 |
| 65 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy); | 70 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy); |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 } // namespace content | 73 } // namespace content |
| 69 | 74 |
| 70 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 75 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
| OLD | NEW |