OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" | 5 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "content/child/appcache/appcache_dispatcher.h" | 8 #include "content/child/appcache/appcache_dispatcher.h" |
9 #include "content/child/appcache/web_application_cache_host_impl.h" | 9 #include "content/child/appcache/web_application_cache_host_impl.h" |
10 #include "content/child/scoped_child_process_reference.h" | 10 #include "content/child/scoped_child_process_reference.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }; | 54 }; |
55 } | 55 } |
56 | 56 |
57 EmbeddedSharedWorkerStub::EmbeddedSharedWorkerStub( | 57 EmbeddedSharedWorkerStub::EmbeddedSharedWorkerStub( |
58 const GURL& url, | 58 const GURL& url, |
59 const base::string16& name, | 59 const base::string16& name, |
60 const base::string16& content_security_policy, | 60 const base::string16& content_security_policy, |
61 blink::WebContentSecurityPolicyType security_policy_type, | 61 blink::WebContentSecurityPolicyType security_policy_type, |
62 bool pause_on_start, | 62 bool pause_on_start, |
63 int route_id) | 63 int route_id) |
64 : route_id_(route_id), name_(name), runing_(false), url_(url) { | 64 : route_id_(route_id), |
| 65 name_(name), |
| 66 runing_(false), |
| 67 url_(url), |
| 68 app_cache_host_(nullptr) { |
65 RenderThreadImpl::current()->AddEmbeddedWorkerRoute(route_id_, this); | 69 RenderThreadImpl::current()->AddEmbeddedWorkerRoute(route_id_, this); |
66 impl_ = blink::WebSharedWorker::create(this); | 70 impl_ = blink::WebSharedWorker::create(this); |
67 if (pause_on_start) { | 71 if (pause_on_start) { |
68 // Pause worker context when it starts and wait until either DevTools client | 72 // Pause worker context when it starts and wait until either DevTools client |
69 // is attached or explicit resume notification is received. | 73 // is attached or explicit resume notification is received. |
70 impl_->pauseWorkerContextOnStart(); | 74 impl_->pauseWorkerContextOnStart(); |
71 } | 75 } |
72 worker_devtools_agent_.reset( | 76 worker_devtools_agent_.reset( |
73 new SharedWorkerDevToolsAgent(route_id, impl_)); | 77 new SharedWorkerDevToolsAgent(route_id, impl_)); |
74 impl_->startWorkerContext(url, name_, | 78 impl_->startWorkerContext(url, name_, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 pending_channels_.push_back(channel); | 212 pending_channels_.push_back(channel); |
209 } | 213 } |
210 } | 214 } |
211 | 215 |
212 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 216 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
213 runing_ = false; | 217 runing_ = false; |
214 impl_->terminateWorkerContext(); | 218 impl_->terminateWorkerContext(); |
215 } | 219 } |
216 | 220 |
217 } // namespace content | 221 } // namespace content |
OLD | NEW |