Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_RENDERER_SHARED_WORKER_EMBEDDED_SHARED_WORKER_STUB_H | |
| 6 #define CONTENT_RENDERER_SHARED_WORKER_EMBEDDED_SHARED_WORKER_STUB_H | |
| 7 | |
| 8 #include "content/child/child_message_filter.h" | |
| 9 #include "content/child/scoped_child_process_reference.h" | |
| 10 #include "ipc/ipc_listener.h" | |
| 11 #include "third_party/WebKit/public/platform/WebString.h" | |
| 12 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" | |
| 13 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" | |
| 14 #include "url/gurl.h" | |
| 15 | |
| 16 namespace blink { | |
| 17 class WebApplicationCacheHost; | |
| 18 class WebApplicationCacheHostClient; | |
| 19 class WebMessagePortChannel; | |
| 20 class WebNotificationPresenter; | |
| 21 class WebSecurityOrigin; | |
| 22 class WebSharedWorker; | |
| 23 class WebWorkerPermissionClientProxy; | |
| 24 } | |
| 25 | |
| 26 namespace content { | |
| 27 class EmbeddedSharedWorkerDevToolsAgent; | |
| 28 class WebMessagePortChannelImpl; | |
| 29 | |
| 30 class EmbeddedSharedWorkerStub : public IPC::Listener , | |
|
kinuko
2014/02/12 11:49:33
nit: weird space before ','
horo
2014/02/13 05:30:01
Done.
| |
| 31 public blink::WebSharedWorkerClient { | |
| 32 public: | |
| 33 EmbeddedSharedWorkerStub( | |
| 34 const GURL& url, | |
| 35 const base::string16& name, | |
| 36 const base::string16& content_security_policy, | |
| 37 blink::WebContentSecurityPolicyType security_policy_type, | |
| 38 int route_id); | |
| 39 | |
| 40 // IPC::Listener implementation. | |
| 41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 42 virtual void OnChannelError() OVERRIDE; | |
| 43 | |
| 44 // blink::WebSharedWorkerClient implementation. | |
| 45 virtual void workerContextClosed() OVERRIDE; | |
| 46 virtual void workerContextDestroyed() OVERRIDE; | |
| 47 virtual void workerScriptLoaded() OVERRIDE; | |
| 48 virtual void workerScriptLoadFailed() OVERRIDE; | |
| 49 virtual void selectAppCacheID(long long) OVERRIDE; | |
| 50 virtual blink::WebNotificationPresenter* notificationPresenter() OVERRIDE; | |
| 51 virtual blink::WebApplicationCacheHost* createApplicationCacheHost( | |
| 52 blink::WebApplicationCacheHostClient*) OVERRIDE; | |
| 53 virtual blink::WebWorkerPermissionClientProxy* | |
| 54 createWorkerPermissionClientProxy( | |
| 55 const blink::WebSecurityOrigin& origin) OVERRIDE; | |
| 56 virtual void dispatchDevToolsMessage( | |
| 57 const blink::WebString& message) OVERRIDE; | |
| 58 virtual void saveDevToolsAgentState(const blink::WebString& state) OVERRIDE; | |
| 59 | |
| 60 private: | |
| 61 virtual ~EmbeddedSharedWorkerStub(); | |
| 62 | |
| 63 void Shutdown(); | |
| 64 bool Send(IPC::Message* message); | |
| 65 | |
| 66 void OnConnect(int sent_message_port_id, int routing_id); | |
| 67 void OnTerminateWorkerContext(); | |
| 68 | |
| 69 int route_id_; | |
| 70 base::string16 name_; | |
| 71 bool runing_; | |
| 72 GURL url_; | |
| 73 blink::WebSharedWorker* impl_; | |
| 74 scoped_ptr<EmbeddedSharedWorkerDevToolsAgent> worker_devtools_agent_; | |
| 75 | |
| 76 typedef std::vector<WebMessagePortChannelImpl*> PendingChannelList; | |
| 77 PendingChannelList pending_channels_; | |
| 78 | |
| 79 ScopedChildProcessReference process_ref_; | |
| 80 DISALLOW_COPY_AND_ASSIGN(EmbeddedSharedWorkerStub); | |
| 81 }; | |
| 82 | |
| 83 } // namespace content | |
| 84 | |
| 85 #endif // CONTENT_RENDERER_SHARED_WORKER_EMBEDDED_SHARED_WORKER_STUB_H | |
| OLD | NEW |