OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_WORKER_WEBWORKER_CONTEXT_STUB_H_ |
| 6 #define CHROME_WORKER_WEBWORKER_CONTEXT_STUB_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/common/ipc_channel.h" |
| 11 #include "googleurl/src/gurl.h" |
| 12 |
| 13 class WebWorkerContextProxy; |
| 14 class WorkerThread; |
| 15 |
| 16 // This class receives IPCs from the renderer and calls the WebKit |
| 17 // implementation of WorkerContextProxy with the data. The data |
| 18 // is converted from Chrome to WebKit types using a wrapper object. |
| 19 class WebWorkerContextStub : public IPC::Channel::Listener { |
| 20 public: |
| 21 WebWorkerContextStub(const GURL& url, int route_id); |
| 22 ~WebWorkerContextStub(); |
| 23 |
| 24 // IPC::Channel::Listener implementation. |
| 25 virtual void OnMessageReceived(const IPC::Message& message); |
| 26 |
| 27 int route_id() { return route_id_; } |
| 28 |
| 29 private: |
| 30 void OnStartContext(const std::string& user_agent, |
| 31 const std::string& source_code); |
| 32 |
| 33 GURL url_; |
| 34 int route_id_; |
| 35 |
| 36 WorkerThread* thread_; |
| 37 |
| 38 scoped_ptr<WebWorkerContextProxy> wrapper_; |
| 39 |
| 40 DISALLOW_EVIL_CONSTRUCTORS(WebWorkerContextStub); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_WORKER_WEBWORKER_CONTEXT_STUB_H_ |
OLD | NEW |