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/worker_thread.h" | 5 #include "content/worker/worker_thread.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/threading/thread_local.h" | 9 #include "base/threading/thread_local.h" |
10 #include "content/child/appcache/appcache_dispatcher.h" | 10 #include "content/child/appcache/appcache_dispatcher.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 return handled; | 114 return handled; |
115 } | 115 } |
116 | 116 |
117 void WorkerThread::OnCreateWorker( | 117 void WorkerThread::OnCreateWorker( |
118 const WorkerProcessMsg_CreateWorker_Params& params) { | 118 const WorkerProcessMsg_CreateWorker_Params& params) { |
119 WorkerAppCacheInitInfo appcache_init_info( | 119 WorkerAppCacheInitInfo appcache_init_info( |
120 params.creator_process_id, | 120 params.creator_process_id, |
121 params.shared_worker_appcache_id); | 121 params.shared_worker_appcache_id); |
122 | 122 |
123 // WebSharedWorkerStub own themselves. | 123 // WebSharedWorkerStub own themselves. |
124 new WebSharedWorkerStub(params.name, params.route_id, appcache_init_info); | 124 new WebSharedWorkerStub( |
| 125 params.url, |
| 126 params.name, |
| 127 params.content_security_policy, |
| 128 params.security_policy_type, |
| 129 params.route_id, |
| 130 appcache_init_info); |
125 } | 131 } |
126 | 132 |
127 // The browser process is likely dead. Terminate all workers. | 133 // The browser process is likely dead. Terminate all workers. |
128 void WorkerThread::OnChannelError() { | 134 void WorkerThread::OnChannelError() { |
129 set_on_channel_error_called(true); | 135 set_on_channel_error_called(true); |
130 | 136 |
131 for (WorkerStubsList::iterator it = worker_stubs_.begin(); | 137 for (WorkerStubsList::iterator it = worker_stubs_.begin(); |
132 it != worker_stubs_.end(); ++it) { | 138 it != worker_stubs_.end(); ++it) { |
133 (*it)->OnChannelError(); | 139 (*it)->OnChannelError(); |
134 } | 140 } |
135 } | 141 } |
136 | 142 |
137 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { | 143 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { |
138 worker_stubs_.erase(stub); | 144 worker_stubs_.erase(stub); |
139 } | 145 } |
140 | 146 |
141 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { | 147 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { |
142 worker_stubs_.insert(stub); | 148 worker_stubs_.insert(stub); |
143 } | 149 } |
144 | 150 |
145 } // namespace content | 151 } // namespace content |
OLD | NEW |