OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBSHAREDWORKER_STUB_H_ | 5 #ifndef CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
6 #define CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ | 6 #define CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/worker/webworker_stub_base.h" | 9 #include "content/worker/webworker_stub_base.h" |
10 #include "content/worker/webworkerclient_proxy.h" | 10 #include "content/worker/webworkerclient_proxy.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 | 12 |
13 namespace WebKit { | 13 namespace WebKit { |
14 class WebSharedWorker; | 14 class WebSharedWorker; |
15 } | 15 } |
16 | 16 |
| 17 class WorkerDevToolsAgent; |
| 18 |
17 // This class creates a WebSharedWorker, and translates incoming IPCs to the | 19 // This class creates a WebSharedWorker, and translates incoming IPCs to the |
18 // appropriate WebSharedWorker APIs. | 20 // appropriate WebSharedWorker APIs. |
19 class WebSharedWorkerStub : public WebWorkerStubBase { | 21 class WebSharedWorkerStub : public WebWorkerStubBase { |
20 public: | 22 public: |
21 WebSharedWorkerStub(const string16& name, int route_id, | 23 WebSharedWorkerStub(const string16& name, int route_id, |
22 const WorkerAppCacheInitInfo& appcache_init_info); | 24 const WorkerAppCacheInitInfo& appcache_init_info); |
23 | 25 |
24 // IPC::Channel::Listener implementation. | 26 // IPC::Channel::Listener implementation. |
25 virtual bool OnMessageReceived(const IPC::Message& message); | 27 virtual bool OnMessageReceived(const IPC::Message& message); |
26 virtual void OnChannelError(); | 28 virtual void OnChannelError(); |
27 | 29 |
28 virtual const GURL& url() const; | 30 virtual const GURL& url() const; |
29 | 31 |
30 private: | 32 private: |
31 virtual ~WebSharedWorkerStub(); | 33 virtual ~WebSharedWorkerStub(); |
32 | 34 |
33 void OnConnect(int sent_message_port_id, int routing_id); | 35 void OnConnect(int sent_message_port_id, int routing_id); |
34 void OnStartWorkerContext( | 36 void OnStartWorkerContext( |
35 const GURL& url, const string16& user_agent, const string16& source_code); | 37 const GURL& url, const string16& user_agent, const string16& source_code); |
36 void OnTerminateWorkerContext(); | 38 void OnTerminateWorkerContext(); |
37 | 39 |
38 WebKit::WebSharedWorker* impl_; | 40 WebKit::WebSharedWorker* impl_; |
39 string16 name_; | 41 string16 name_; |
40 bool started_; | 42 bool started_; |
41 GURL url_; | 43 GURL url_; |
| 44 scoped_ptr<WorkerDevToolsAgent> worker_devtools_agent_; |
42 | 45 |
43 typedef std::pair<int, int> PendingConnectInfo; | 46 typedef std::pair<int, int> PendingConnectInfo; |
44 typedef std::vector<PendingConnectInfo> PendingConnectInfoList; | 47 typedef std::vector<PendingConnectInfo> PendingConnectInfoList; |
45 PendingConnectInfoList pending_connects_; | 48 PendingConnectInfoList pending_connects_; |
46 | 49 |
47 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub); | 50 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub); |
48 }; | 51 }; |
49 | 52 |
50 #endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ | 53 #endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
OLD | NEW |