| 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/browser/worker_host/worker_service_impl.h" | 5 #include "content/browser/worker_host/worker_service_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 ResourceContext* resource_context, | 305 ResourceContext* resource_context, |
| 306 const WorkerStoragePartition& partition) { | 306 const WorkerStoragePartition& partition) { |
| 307 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 307 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 308 // Generate a unique route id for the browser-worker communication that's | 308 // Generate a unique route id for the browser-worker communication that's |
| 309 // unique among all worker processes. That way when the worker process sends | 309 // unique among all worker processes. That way when the worker process sends |
| 310 // a wrapped IPC message through us, we know which WorkerProcessHost to give | 310 // a wrapped IPC message through us, we know which WorkerProcessHost to give |
| 311 // it to. | 311 // it to. |
| 312 WorkerProcessHost::WorkerInstance instance( | 312 WorkerProcessHost::WorkerInstance instance( |
| 313 params.url, | 313 params.url, |
| 314 params.name, | 314 params.name, |
| 315 params.content_security_policy, |
| 316 params.security_policy_type, |
| 315 next_worker_route_id(), | 317 next_worker_route_id(), |
| 316 0, | 318 0, |
| 317 params.script_resource_appcache_id, | 319 params.script_resource_appcache_id, |
| 318 resource_context, | 320 resource_context, |
| 319 partition); | 321 partition); |
| 320 instance.AddFilter(filter, route_id); | 322 instance.AddFilter(filter, route_id); |
| 321 instance.worker_document_set()->Add( | 323 instance.worker_document_set()->Add( |
| 322 filter, params.document_id, filter->render_process_id(), | 324 filter, params.document_id, filter->render_process_id(), |
| 323 params.render_view_route_id, params.render_frame_route_id); | 325 params.render_view_route_id, params.render_frame_route_id); |
| 324 | 326 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 return instance; | 730 return instance; |
| 729 | 731 |
| 730 // No existing pending worker - create a new one. | 732 // No existing pending worker - create a new one. |
| 731 WorkerProcessHost::WorkerInstance pending( | 733 WorkerProcessHost::WorkerInstance pending( |
| 732 url, true, name, resource_context, partition); | 734 url, true, name, resource_context, partition); |
| 733 pending_shared_workers_.push_back(pending); | 735 pending_shared_workers_.push_back(pending); |
| 734 return &pending_shared_workers_.back(); | 736 return &pending_shared_workers_.back(); |
| 735 } | 737 } |
| 736 | 738 |
| 737 } // namespace content | 739 } // namespace content |
| OLD | NEW |