| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_WORKER_WEBWORKER_STUB_H_ | 5 #ifndef CHROME_WORKER_WEBWORKER_STUB_H_ |
| 6 #define CHROME_WORKER_WEBWORKER_STUB_H_ | 6 #define CHROME_WORKER_WEBWORKER_STUB_H_ |
| 7 | 7 |
| 8 #include "chrome/worker/webworker_stub_base.h" | 8 #include "chrome/worker/webworker_stub_base.h" |
| 9 #include "chrome/worker/webworkerclient_proxy.h" | 9 #include "chrome/worker/webworkerclient_proxy.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 11 | 11 |
| 12 namespace WebKit { | 12 namespace WebKit { |
| 13 class WebWorker; | 13 class WebWorker; |
| 14 } | 14 } |
| 15 | 15 |
| 16 // This class creates a WebWorker, and translates incoming IPCs to the | 16 // This class creates a WebWorker, and translates incoming IPCs to the |
| 17 // appropriate WebWorker APIs. | 17 // appropriate WebWorker APIs. |
| 18 class WebWorkerStub : public WebWorkerStubBase { | 18 class WebWorkerStub : public WebWorkerStubBase { |
| 19 public: | 19 public: |
| 20 WebWorkerStub(const GURL& url, int route_id); | 20 WebWorkerStub(const GURL& url, int route_id, |
| 21 const WorkerAppCacheInitInfo& appcache_init_info); |
| 21 | 22 |
| 22 // IPC::Channel::Listener implementation. | 23 // IPC::Channel::Listener implementation. |
| 23 virtual void OnMessageReceived(const IPC::Message& message); | 24 virtual void OnMessageReceived(const IPC::Message& message); |
| 24 virtual void OnChannelError(); | 25 virtual void OnChannelError(); |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 virtual ~WebWorkerStub(); | 28 virtual ~WebWorkerStub(); |
| 28 | 29 |
| 29 void OnTerminateWorkerContext(); | 30 void OnTerminateWorkerContext(); |
| 30 void OnPostMessage(const string16& message, | 31 void OnPostMessage(const string16& message, |
| 31 const std::vector<int>& sent_message_port_ids, | 32 const std::vector<int>& sent_message_port_ids, |
| 32 const std::vector<int>& new_routing_ids); | 33 const std::vector<int>& new_routing_ids); |
| 33 | 34 |
| 34 WebKit::WebWorker* impl_; | 35 WebKit::WebWorker* impl_; |
| 35 | 36 |
| 36 DISALLOW_COPY_AND_ASSIGN(WebWorkerStub); | 37 DISALLOW_COPY_AND_ASSIGN(WebWorkerStub); |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 #endif // CHROME_WORKER_WEBWORKER_STUB_H_ | 40 #endif // CHROME_WORKER_WEBWORKER_STUB_H_ |
| OLD | NEW |