Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1495)

Side by Side Diff: content/browser/worker_host/worker_service_impl.cc

Issue 115713004: Move the worker script loading code to the worker process (phase:2/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stop using forward reference to enum type. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698