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

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: Move IPC_ENUM_TRAITS(blink::WebContentSecurityPolicyType) to content_param_traits_macros.h. 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_frame_route_id); 325 params.render_frame_route_id);
324 326
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 return instance; 728 return instance;
727 729
728 // No existing pending worker - create a new one. 730 // No existing pending worker - create a new one.
729 WorkerProcessHost::WorkerInstance pending( 731 WorkerProcessHost::WorkerInstance pending(
730 url, true, name, resource_context, partition); 732 url, true, name, resource_context, partition);
731 pending_shared_workers_.push_back(pending); 733 pending_shared_workers_.push_back(pending);
732 return &pending_shared_workers_.back(); 734 return &pending_shared_workers_.back();
733 } 735 }
734 736
735 } // namespace content 737 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/worker_host/worker_process_host.cc ('k') | content/common/content_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698