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_RENDERER_WEBWORKER_CONTEXT_PROXY_H_ |
| 6 #define CHROME_RENDERER_WEBWORKER_CONTEXT_PROXY_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "webkit/glue/webworker.h" |
| 10 |
| 11 class GURL; |
| 12 class RenderView; |
| 13 |
| 14 namespace IPC { |
| 15 class Message; |
| 16 } |
| 17 |
| 18 // This class provides an implementation of WebWorkerContextProxy that the |
| 19 // renderer provides to the glue. The implementation knows how to convert |
| 20 // the WebWorkerContextProxy function calls into IPC messages that call a |
| 21 // WebWorkerContextStub object in the worker process (which then calls |
| 22 // WebKit's WorkerContextProxy implementation). |
| 23 class WebWorkerContextProxyImpl : public WebWorkerContextProxy { |
| 24 public: |
| 25 WebWorkerContextProxyImpl(RenderView* render_view); |
| 26 virtual ~WebWorkerContextProxyImpl(); |
| 27 virtual void StartWorkerContext(const GURL& script_url, |
| 28 const std::string& user_agent, |
| 29 const std::string& source_code); |
| 30 virtual void TerminateWorkerContext(); |
| 31 virtual void PostMessageToWorkerContext(const std::string&); |
| 32 virtual bool HasPendingActivity() const; |
| 33 virtual void WorkerObjectDestroyed(); |
| 34 |
| 35 private: |
| 36 bool Send(IPC::Message* msg); |
| 37 |
| 38 RenderView* render_view_; |
| 39 int route_id_; |
| 40 DISALLOW_EVIL_CONSTRUCTORS(WebWorkerContextProxyImpl); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_RENDERER_WEBWORKER_CONTEXT_PROXY_H_ |
OLD | NEW |