| 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 WebKit { | 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 | 24 |
| 25 // This class receives IPCs from the renderer and calls the WebCore::Worker | 25 // 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 | 26 // 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 | 27 // 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 | 28 // IPCs that are sent to the renderer, where they're converted back to function |
| 29 // calls by WebWorkerProxy. | 29 // calls by WebWorkerProxy. |
| 30 class WebSharedWorkerClientProxy : public WebKit::WebSharedWorkerClient { | 30 class WebSharedWorkerClientProxy : public blink::WebSharedWorkerClient { |
| 31 public: | 31 public: |
| 32 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub); | 32 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub); |
| 33 virtual ~WebSharedWorkerClientProxy(); | 33 virtual ~WebSharedWorkerClientProxy(); |
| 34 | 34 |
| 35 // WebSharedWorkerClient implementation. | 35 // WebSharedWorkerClient implementation. |
| 36 virtual void workerContextClosed(); | 36 virtual void workerContextClosed(); |
| 37 virtual void workerContextDestroyed(); | 37 virtual void workerContextDestroyed(); |
| 38 | 38 |
| 39 virtual WebKit::WebNotificationPresenter* notificationPresenter(); | 39 virtual blink::WebNotificationPresenter* notificationPresenter(); |
| 40 | 40 |
| 41 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( | 41 virtual blink::WebApplicationCacheHost* createApplicationCacheHost( |
| 42 WebKit::WebApplicationCacheHostClient* client); | 42 blink::WebApplicationCacheHostClient* client); |
| 43 virtual WebKit::WebWorkerPermissionClientProxy* | 43 virtual blink::WebWorkerPermissionClientProxy* |
| 44 createWorkerPermissionClientProxy( | 44 createWorkerPermissionClientProxy( |
| 45 const WebKit::WebSecurityOrigin& origin); | 45 const blink::WebSecurityOrigin& origin); |
| 46 | 46 |
| 47 // TODO(kinuko): Deprecate these methods. | 47 // TODO(kinuko): Deprecate these methods. |
| 48 virtual bool allowDatabase(WebKit::WebFrame* frame, | 48 virtual bool allowDatabase(blink::WebFrame* frame, |
| 49 const WebKit::WebString& name, | 49 const blink::WebString& name, |
| 50 const WebKit::WebString& display_name, | 50 const blink::WebString& display_name, |
| 51 unsigned long estimated_size); | 51 unsigned long estimated_size); |
| 52 virtual bool allowFileSystem(); | 52 virtual bool allowFileSystem(); |
| 53 virtual bool allowIndexedDB(const WebKit::WebString&); | 53 virtual bool allowIndexedDB(const blink::WebString&); |
| 54 | 54 |
| 55 virtual void dispatchDevToolsMessage(const WebKit::WebString&); | 55 virtual void dispatchDevToolsMessage(const blink::WebString&); |
| 56 virtual void saveDevToolsAgentState(const WebKit::WebString&); | 56 virtual void saveDevToolsAgentState(const blink::WebString&); |
| 57 | 57 |
| 58 void EnsureWorkerContextTerminates(); | 58 void EnsureWorkerContextTerminates(); |
| 59 | 59 |
| 60 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { | 60 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { |
| 61 devtools_agent_ = devtools_agent; | 61 devtools_agent_ = devtools_agent; |
| 62 } | 62 } |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 bool Send(IPC::Message* message); | 65 bool Send(IPC::Message* message); |
| 66 | 66 |
| 67 int route_id_; | 67 int route_id_; |
| 68 int appcache_host_id_; | 68 int appcache_host_id_; |
| 69 WebSharedWorkerStub* stub_; | 69 WebSharedWorkerStub* stub_; |
| 70 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_; | 70 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_; |
| 71 SharedWorkerDevToolsAgent* devtools_agent_; | 71 SharedWorkerDevToolsAgent* devtools_agent_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy); | 73 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| 77 | 77 |
| 78 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 78 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
| OLD | NEW |