OLD | NEW |
---|---|
1 // Copyright (c) 2009 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_WEBWORKER_STUB_H_ | 5 #ifndef CONTENT_WORKER_WEBWORKER_STUB_H_ |
6 #define CONTENT_WORKER_WEBWORKER_STUB_H_ | 6 #define CONTENT_WORKER_WEBWORKER_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/scoped_ptr.h" | |
Dmitry Titov
2011/05/25 01:38:44
not used.
yurys
2011/05/25 17:28:29
In the new version it is used.
| |
9 #include "content/worker/webworker_stub_base.h" | 10 #include "content/worker/webworker_stub_base.h" |
10 #include "content/worker/webworkerclient_proxy.h" | 11 #include "content/worker/webworkerclient_proxy.h" |
11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
12 | 13 |
13 namespace WebKit { | 14 namespace WebKit { |
14 class WebWorker; | 15 class WebWorker; |
15 } | 16 } |
16 | 17 |
17 // This class creates a WebWorker, and translates incoming IPCs to the | 18 // This class creates a WebWorker, and translates incoming IPCs to the |
18 // appropriate WebWorker APIs. | 19 // appropriate WebWorker APIs. |
19 class WebWorkerStub : public WebWorkerStubBase { | 20 class WebWorkerStub : public WebWorkerStubBase { |
20 public: | 21 public: |
21 WebWorkerStub(const GURL& url, int route_id, | 22 WebWorkerStub(const GURL& url, int route_id, |
22 const WorkerAppCacheInitInfo& appcache_init_info); | 23 const WorkerAppCacheInitInfo& appcache_init_info); |
23 | 24 |
24 // IPC::Channel::Listener implementation. | 25 // IPC::Channel::Listener implementation. |
25 virtual bool OnMessageReceived(const IPC::Message& message); | 26 virtual bool OnMessageReceived(const IPC::Message& message); |
26 virtual void OnChannelError(); | 27 virtual void OnChannelError(); |
27 | 28 |
28 virtual const GURL& url() const; | 29 virtual const GURL& url() const; |
29 | 30 |
31 class DevToolsDelegate { | |
32 public: | |
33 virtual bool OnMessageReceived(const IPC::Message& message) = 0; | |
34 virtual void WebWorkerStubDestroyed() = 0; | |
35 }; | |
36 void set_devtools_delegate(DevToolsDelegate*); | |
37 | |
30 private: | 38 private: |
31 virtual ~WebWorkerStub(); | 39 virtual ~WebWorkerStub(); |
32 | 40 |
33 void OnTerminateWorkerContext(); | 41 void OnTerminateWorkerContext(); |
34 void OnPostMessage(const string16& message, | 42 void OnPostMessage(const string16& message, |
35 const std::vector<int>& sent_message_port_ids, | 43 const std::vector<int>& sent_message_port_ids, |
36 const std::vector<int>& new_routing_ids); | 44 const std::vector<int>& new_routing_ids); |
37 | 45 |
38 WebKit::WebWorker* impl_; | 46 WebKit::WebWorker* impl_; |
39 GURL url_; | 47 GURL url_; |
48 DevToolsDelegate* devtools_delegate_; | |
40 | 49 |
41 DISALLOW_COPY_AND_ASSIGN(WebWorkerStub); | 50 DISALLOW_COPY_AND_ASSIGN(WebWorkerStub); |
42 }; | 51 }; |
43 | 52 |
44 #endif // CONTENT_WORKER_WEBWORKER_STUB_H_ | 53 #endif // CONTENT_WORKER_WEBWORKER_STUB_H_ |
OLD | NEW |