| 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/websharedworkerclient_proxy.h" | 10 #include "content/worker/websharedworkerclient_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 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorker.h" |
| 14 | 15 |
| 15 namespace WebKit { | 16 namespace WebKit { |
| 16 class WebSharedWorker; | 17 class WebSharedWorker; |
| 17 } | 18 } |
| 18 | 19 |
| 19 class SharedWorkerDevToolsAgent; | 20 class SharedWorkerDevToolsAgent; |
| 20 | 21 |
| 21 // This class creates a WebSharedWorker, and translates incoming IPCs to the | 22 // This class creates a WebSharedWorker, and translates incoming IPCs to the |
| 22 // appropriate WebSharedWorker APIs. | 23 // appropriate WebSharedWorker APIs. |
| 23 class WebSharedWorkerStub : public IPC::Channel::Listener { | 24 class WebSharedWorkerStub : public IPC::Channel::Listener { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // Returns the script url of this worker. | 46 // Returns the script url of this worker. |
| 46 const GURL& url(); | 47 const GURL& url(); |
| 47 | 48 |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 virtual ~WebSharedWorkerStub(); | 51 virtual ~WebSharedWorkerStub(); |
| 51 | 52 |
| 52 void OnConnect(int sent_message_port_id, int routing_id); | 53 void OnConnect(int sent_message_port_id, int routing_id); |
| 53 void OnStartWorkerContext( | 54 void OnStartWorkerContext( |
| 54 const GURL& url, const string16& user_agent, const string16& source_code); | 55 const GURL& url, const string16& user_agent, const string16& source_code, |
| 56 const string16& content_security_policy, |
| 57 WebKit::WebContentSecurityPolicyType policy_type); |
| 58 |
| 55 void OnTerminateWorkerContext(); | 59 void OnTerminateWorkerContext(); |
| 56 | 60 |
| 57 int route_id_; | 61 int route_id_; |
| 58 WorkerAppCacheInitInfo appcache_init_info_; | 62 WorkerAppCacheInitInfo appcache_init_info_; |
| 59 | 63 |
| 60 // WebSharedWorkerClient that responds to outgoing API calls | 64 // WebSharedWorkerClient that responds to outgoing API calls |
| 61 // from the worker object. | 65 // from the worker object. |
| 62 WebSharedWorkerClientProxy client_; | 66 WebSharedWorkerClientProxy client_; |
| 63 | 67 |
| 64 WebKit::WebSharedWorker* impl_; | 68 WebKit::WebSharedWorker* impl_; |
| 65 string16 name_; | 69 string16 name_; |
| 66 bool started_; | 70 bool started_; |
| 67 GURL url_; | 71 GURL url_; |
| 68 scoped_ptr<SharedWorkerDevToolsAgent> worker_devtools_agent_; | 72 scoped_ptr<SharedWorkerDevToolsAgent> worker_devtools_agent_; |
| 69 | 73 |
| 70 typedef std::pair<int, int> PendingConnectInfo; | 74 typedef std::pair<int, int> PendingConnectInfo; |
| 71 typedef std::vector<PendingConnectInfo> PendingConnectInfoList; | 75 typedef std::vector<PendingConnectInfo> PendingConnectInfoList; |
| 72 PendingConnectInfoList pending_connects_; | 76 PendingConnectInfoList pending_connects_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub); | 78 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 #endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ | 81 #endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_ |
| OLD | NEW |