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

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: Created 7 years 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { 273 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) {
274 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( 274 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL(
275 process_->GetData().id, instance.url()); 275 process_->GetData().id, instance.url());
276 276
277 instances_.push_back(instance); 277 instances_.push_back(instance);
278 278
279 WorkerProcessMsg_CreateWorker_Params params; 279 WorkerProcessMsg_CreateWorker_Params params;
280 params.url = instance.url(); 280 params.url = instance.url();
281 params.name = instance.name(); 281 params.name = instance.name();
282 params.content_security_policy = instance.content_security_policy();
283 params.security_policy_type = instance.security_policy_type();
282 params.route_id = instance.worker_route_id(); 284 params.route_id = instance.worker_route_id();
283 params.creator_process_id = instance.parent_process_id(); 285 params.creator_process_id = instance.parent_process_id();
284 params.shared_worker_appcache_id = instance.main_resource_appcache_id(); 286 params.shared_worker_appcache_id = instance.main_resource_appcache_id();
285 Send(new WorkerProcessMsg_CreateWorker(params)); 287 Send(new WorkerProcessMsg_CreateWorker(params));
286 288
287 UpdateTitle(); 289 UpdateTitle();
288 290
289 // Walk all pending filters and let them know the worker has been created 291 // Walk all pending filters and let them know the worker has been created
290 // (could be more than one in the case where we had to queue up worker 292 // (could be more than one in the case where we had to queue up worker
291 // creation because the worker process limit was reached). 293 // creation because the worker process limit was reached).
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 568 }
567 569
568 net::URLRequestContext* WorkerProcessHost::GetRequestContext( 570 net::URLRequestContext* WorkerProcessHost::GetRequestContext(
569 ResourceType::Type resource_type) { 571 ResourceType::Type resource_type) {
570 return partition_.url_request_context()->GetURLRequestContext(); 572 return partition_.url_request_context()->GetURLRequestContext();
571 } 573 }
572 574
573 WorkerProcessHost::WorkerInstance::WorkerInstance( 575 WorkerProcessHost::WorkerInstance::WorkerInstance(
574 const GURL& url, 576 const GURL& url,
575 const base::string16& name, 577 const base::string16& name,
578 const base::string16& content_security_policy,
579 blink::WebContentSecurityPolicyType security_policy_type,
576 int worker_route_id, 580 int worker_route_id,
577 int parent_process_id, 581 int parent_process_id,
578 int64 main_resource_appcache_id, 582 int64 main_resource_appcache_id,
579 ResourceContext* resource_context, 583 ResourceContext* resource_context,
580 const WorkerStoragePartition& partition) 584 const WorkerStoragePartition& partition)
581 : url_(url), 585 : url_(url),
582 closed_(false), 586 closed_(false),
583 name_(name), 587 name_(name),
588 content_security_policy_(content_security_policy),
589 security_policy_type_(security_policy_type),
584 worker_route_id_(worker_route_id), 590 worker_route_id_(worker_route_id),
585 parent_process_id_(parent_process_id), 591 parent_process_id_(parent_process_id),
586 main_resource_appcache_id_(main_resource_appcache_id), 592 main_resource_appcache_id_(main_resource_appcache_id),
587 worker_document_set_(new WorkerDocumentSet()), 593 worker_document_set_(new WorkerDocumentSet()),
588 resource_context_(resource_context), 594 resource_context_(resource_context),
589 partition_(partition) { 595 partition_(partition) {
590 DCHECK(resource_context_); 596 DCHECK(resource_context_);
591 } 597 }
592 598
593 WorkerProcessHost::WorkerInstance::WorkerInstance( 599 WorkerProcessHost::WorkerInstance::WorkerInstance(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 return false; 706 return false;
701 } 707 }
702 708
703 WorkerProcessHost::WorkerInstance::FilterInfo 709 WorkerProcessHost::WorkerInstance::FilterInfo
704 WorkerProcessHost::WorkerInstance::GetFilter() const { 710 WorkerProcessHost::WorkerInstance::GetFilter() const {
705 DCHECK(NumFilters() == 1); 711 DCHECK(NumFilters() == 1);
706 return *filters_.begin(); 712 return *filters_.begin();
707 } 713 }
708 714
709 } // namespace content 715 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698