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

Side by Side Diff: content/browser/worker_host/worker_process_host.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_process_host.h" 5 #include "content/browser/worker_host/worker_process_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { 276 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) {
277 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( 277 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL(
278 process_->GetData().id, instance.url()); 278 process_->GetData().id, instance.url());
279 279
280 instances_.push_back(instance); 280 instances_.push_back(instance);
281 281
282 WorkerProcessMsg_CreateWorker_Params params; 282 WorkerProcessMsg_CreateWorker_Params params;
283 params.url = instance.url(); 283 params.url = instance.url();
284 params.name = instance.name(); 284 params.name = instance.name();
285 params.content_security_policy = instance.content_security_policy();
286 params.security_policy_type = instance.security_policy_type();
285 params.route_id = instance.worker_route_id(); 287 params.route_id = instance.worker_route_id();
286 params.creator_process_id = instance.parent_process_id(); 288 params.creator_process_id = instance.parent_process_id();
287 params.shared_worker_appcache_id = instance.main_resource_appcache_id(); 289 params.shared_worker_appcache_id = instance.main_resource_appcache_id();
288 Send(new WorkerProcessMsg_CreateWorker(params)); 290 Send(new WorkerProcessMsg_CreateWorker(params));
289 291
290 UpdateTitle(); 292 UpdateTitle();
291 293
292 // Walk all pending filters and let them know the worker has been created 294 // Walk all pending filters and let them know the worker has been created
293 // (could be more than one in the case where we had to queue up worker 295 // (could be more than one in the case where we had to queue up worker
294 // creation because the worker process limit was reached). 296 // creation because the worker process limit was reached).
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 } 572 }
571 573
572 net::URLRequestContext* WorkerProcessHost::GetRequestContext( 574 net::URLRequestContext* WorkerProcessHost::GetRequestContext(
573 ResourceType::Type resource_type) { 575 ResourceType::Type resource_type) {
574 return partition_.url_request_context()->GetURLRequestContext(); 576 return partition_.url_request_context()->GetURLRequestContext();
575 } 577 }
576 578
577 WorkerProcessHost::WorkerInstance::WorkerInstance( 579 WorkerProcessHost::WorkerInstance::WorkerInstance(
578 const GURL& url, 580 const GURL& url,
579 const base::string16& name, 581 const base::string16& name,
582 const base::string16& content_security_policy,
583 blink::WebContentSecurityPolicyType security_policy_type,
580 int worker_route_id, 584 int worker_route_id,
581 int parent_process_id, 585 int parent_process_id,
582 int64 main_resource_appcache_id, 586 int64 main_resource_appcache_id,
583 ResourceContext* resource_context, 587 ResourceContext* resource_context,
584 const WorkerStoragePartition& partition) 588 const WorkerStoragePartition& partition)
585 : url_(url), 589 : url_(url),
586 closed_(false), 590 closed_(false),
587 name_(name), 591 name_(name),
592 content_security_policy_(content_security_policy),
593 security_policy_type_(security_policy_type),
588 worker_route_id_(worker_route_id), 594 worker_route_id_(worker_route_id),
589 parent_process_id_(parent_process_id), 595 parent_process_id_(parent_process_id),
590 main_resource_appcache_id_(main_resource_appcache_id), 596 main_resource_appcache_id_(main_resource_appcache_id),
591 worker_document_set_(new WorkerDocumentSet()), 597 worker_document_set_(new WorkerDocumentSet()),
592 resource_context_(resource_context), 598 resource_context_(resource_context),
593 partition_(partition) { 599 partition_(partition) {
594 DCHECK(resource_context_); 600 DCHECK(resource_context_);
595 } 601 }
596 602
597 WorkerProcessHost::WorkerInstance::WorkerInstance( 603 WorkerProcessHost::WorkerInstance::WorkerInstance(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 return false; 710 return false;
705 } 711 }
706 712
707 WorkerProcessHost::WorkerInstance::FilterInfo 713 WorkerProcessHost::WorkerInstance::FilterInfo
708 WorkerProcessHost::WorkerInstance::GetFilter() const { 714 WorkerProcessHost::WorkerInstance::GetFilter() const {
709 DCHECK(NumFilters() == 1); 715 DCHECK(NumFilters() == 1);
710 return *filters_.begin(); 716 return *filters_.begin();
711 } 717 }
712 718
713 } // namespace content 719 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/worker_host/worker_process_host.h ('k') | content/browser/worker_host/worker_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698