| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_WORKER_WEBWORKER_STUB_H_ | |
| 6 #define CONTENT_WORKER_WEBWORKER_STUB_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "content/worker/webworker_stub_base.h" | |
| 13 #include "content/worker/webworkerclient_proxy.h" | |
| 14 #include "googleurl/src/gurl.h" | |
| 15 | |
| 16 namespace WebKit { | |
| 17 class WebWorker; | |
| 18 } | |
| 19 | |
| 20 // This class creates a WebWorker, and translates incoming IPCs to the | |
| 21 // appropriate WebWorker APIs. | |
| 22 class WebWorkerStub : public WebWorkerStubBase { | |
| 23 public: | |
| 24 WebWorkerStub(const GURL& url, int route_id, | |
| 25 const WorkerAppCacheInitInfo& appcache_init_info); | |
| 26 | |
| 27 // IPC::Channel::Listener implementation. | |
| 28 virtual bool OnMessageReceived(const IPC::Message& message); | |
| 29 virtual void OnChannelError(); | |
| 30 | |
| 31 virtual const GURL& url() const; | |
| 32 | |
| 33 private: | |
| 34 virtual ~WebWorkerStub(); | |
| 35 | |
| 36 void OnTerminateWorkerContext(); | |
| 37 void OnPostMessage(const string16& message, | |
| 38 const std::vector<int>& sent_message_port_ids, | |
| 39 const std::vector<int>& new_routing_ids); | |
| 40 | |
| 41 WebKit::WebWorker* impl_; | |
| 42 GURL url_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(WebWorkerStub); | |
| 45 }; | |
| 46 | |
| 47 #endif // CONTENT_WORKER_WEBWORKER_STUB_H_ | |
| OLD | NEW |