OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/worker/websharedworker_stub.h" | 5 #include "content/worker/websharedworker_stub.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "content/child/child_process.h" | 8 #include "content/child/child_process.h" |
9 #include "content/child/child_thread.h" | 9 #include "content/child/child_thread.h" |
10 #include "content/child/fileapi/file_system_dispatcher.h" | 10 #include "content/child/fileapi/file_system_dispatcher.h" |
11 #include "content/child/webmessageportchannel_impl.h" | 11 #include "content/child/webmessageportchannel_impl.h" |
12 #include "content/common/worker_messages.h" | 12 #include "content/common/worker_messages.h" |
13 #include "content/worker/shared_worker_devtools_agent.h" | 13 #include "content/worker/shared_worker_devtools_agent.h" |
14 #include "content/worker/worker_thread.h" | 14 #include "content/worker/worker_thread.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorker.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorker.h" |
16 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
17 #include "third_party/WebKit/public/platform/WebURL.h" | 17 #include "third_party/WebKit/public/platform/WebURL.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 WebSharedWorkerStub::WebSharedWorkerStub( | 21 WebSharedWorkerStub::WebSharedWorkerStub( |
22 const string16& name, int route_id, | 22 const string16& name, |
| 23 int route_id, |
23 const WorkerAppCacheInitInfo& appcache_init_info) | 24 const WorkerAppCacheInitInfo& appcache_init_info) |
24 : route_id_(route_id), | 25 : route_id_(route_id), |
25 appcache_init_info_(appcache_init_info), | 26 appcache_init_info_(appcache_init_info), |
26 client_(route_id, this), | 27 client_(route_id, this), |
27 name_(name), | 28 name_(name), |
28 started_(false), | 29 started_(false) { |
29 worker_devtools_agent_(NULL) { | |
30 | 30 |
31 WorkerThread* worker_thread = WorkerThread::current(); | 31 WorkerThread* worker_thread = WorkerThread::current(); |
32 DCHECK(worker_thread); | 32 DCHECK(worker_thread); |
33 worker_thread->AddWorkerStub(this); | 33 worker_thread->AddWorkerStub(this); |
34 // Start processing incoming IPCs for this worker. | 34 // Start processing incoming IPCs for this worker. |
35 worker_thread->AddRoute(route_id_, this); | 35 worker_thread->AddRoute(route_id_, this); |
36 ChildProcess::current()->AddRefProcess(); | 36 ChildProcess::current()->AddRefProcess(); |
37 | 37 |
38 // TODO(atwilson): Add support for NaCl when they support MessagePorts. | 38 // TODO(atwilson): Add support for NaCl when they support MessagePorts. |
39 impl_ = WebKit::WebSharedWorker::create(client()); | 39 impl_ = WebKit::WebSharedWorker::create(client()); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 void WebSharedWorkerStub::OnTerminateWorkerContext() { | 123 void WebSharedWorkerStub::OnTerminateWorkerContext() { |
124 impl_->terminateWorkerContext(); | 124 impl_->terminateWorkerContext(); |
125 | 125 |
126 // Call the client to make sure context exits. | 126 // Call the client to make sure context exits. |
127 EnsureWorkerContextTerminates(); | 127 EnsureWorkerContextTerminates(); |
128 started_ = false; | 128 started_ = false; |
129 } | 129 } |
130 | 130 |
131 } // namespace content | 131 } // namespace content |
OLD | NEW |