| OLD | NEW |
| 1 // Copyright (c) 2011 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_WEBSHAREDWORKER_STUB_H_ | 5 #ifndef CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
| 6 #define CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ | 6 #define CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/worker/webworkerclient_proxy.h" | 10 #include "content/worker/webworkerclient_proxy.h" |
| 11 #include "content/worker/worker_webapplicationcachehost_impl.h" | 11 #include "content/worker/worker_webapplicationcachehost_impl.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "ipc/ipc_channel.h" | 13 #include "ipc/ipc_channel.h" |
| 14 | 14 |
| 15 namespace WebKit { | 15 namespace WebKit { |
| 16 class WebSharedWorker; | 16 class WebSharedWorker; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class SharedWorkerDevToolsAgent; | 19 class SharedWorkerDevToolsAgent; |
| 20 | 20 |
| 21 // This class creates a WebSharedWorker, and translates incoming IPCs to the | 21 // This class creates a WebSharedWorker, and translates incoming IPCs to the |
| 22 // appropriate WebSharedWorker APIs. | 22 // appropriate WebSharedWorker APIs. |
| 23 class WebSharedWorkerStub : public IPC::Channel::Listener { | 23 class WebSharedWorkerStub : public IPC::Channel::Listener { |
| 24 public: | 24 public: |
| 25 WebSharedWorkerStub(const string16& name, int route_id, | 25 WebSharedWorkerStub(const string16& name, int route_id, |
| 26 const WorkerAppCacheInitInfo& appcache_init_info); | 26 const WorkerAppCacheInitInfo& appcache_init_info); |
| 27 | 27 |
| 28 // IPC::Channel::Listener implementation. | 28 // IPC::Channel::Listener implementation. |
| 29 virtual bool OnMessageReceived(const IPC::Message& message); | 29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 30 virtual void OnChannelError(); | 30 virtual void OnChannelError() OVERRIDE; |
| 31 | 31 |
| 32 // Invoked when the WebWorkerClientProxy is shutting down. | 32 // Invoked when the WebWorkerClientProxy is shutting down. |
| 33 void Shutdown(); | 33 void Shutdown(); |
| 34 | 34 |
| 35 // Called after terminating the worker context to make sure that the worker | 35 // Called after terminating the worker context to make sure that the worker |
| 36 // actually terminates (is not stuck in an infinite loop). | 36 // actually terminates (is not stuck in an infinite loop). |
| 37 void EnsureWorkerContextTerminates(); | 37 void EnsureWorkerContextTerminates(); |
| 38 | 38 |
| 39 WebWorkerClientProxy* client() { return &client_; } | 39 WebWorkerClientProxy* client() { return &client_; } |
| 40 | 40 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 67 scoped_ptr<SharedWorkerDevToolsAgent> worker_devtools_agent_; | 67 scoped_ptr<SharedWorkerDevToolsAgent> worker_devtools_agent_; |
| 68 | 68 |
| 69 typedef std::pair<int, int> PendingConnectInfo; | 69 typedef std::pair<int, int> PendingConnectInfo; |
| 70 typedef std::vector<PendingConnectInfo> PendingConnectInfoList; | 70 typedef std::vector<PendingConnectInfo> PendingConnectInfoList; |
| 71 PendingConnectInfoList pending_connects_; | 71 PendingConnectInfoList pending_connects_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub); | 73 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ | 76 #endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
| OLD | NEW |