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

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

Issue 213423008: Add pause_on_start flag to WorkerProcessMsg_CreateWorker_Params. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated yurys's comment Created 6 years, 9 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 // TODO(atwilson): This won't work if the message is from a worker process. 402 // TODO(atwilson): This won't work if the message is from a worker process.
403 // We don't support that yet though (this message is only sent from 403 // We don't support that yet though (this message is only sent from
404 // renderers) but when we do, we'll need to add code to pass in the current 404 // renderers) but when we do, we'll need to add code to pass in the current
405 // worker's document set for nested workers. 405 // worker's document set for nested workers.
406 if (!worker->Init(first_filter->render_process_id(), 406 if (!worker->Init(first_filter->render_process_id(),
407 instance.render_frame_id())) { 407 instance.render_frame_id())) {
408 delete worker; 408 delete worker;
409 return false; 409 return false;
410 } 410 }
411 411
412 worker->CreateWorker(instance); 412 worker->CreateWorker(
413 instance,
414 WorkerDevToolsManager::GetInstance()->WorkerCreated(worker, instance));
413 FOR_EACH_OBSERVER( 415 FOR_EACH_OBSERVER(
414 WorkerServiceObserver, observers_, 416 WorkerServiceObserver, observers_,
415 WorkerCreated(instance.url(), instance.name(), worker->GetData().id, 417 WorkerCreated(instance.url(), instance.name(), worker->GetData().id,
416 instance.worker_route_id())); 418 instance.worker_route_id()));
417 WorkerDevToolsManager::GetInstance()->WorkerCreated(worker, instance);
418 return true; 419 return true;
419 } 420 }
420 421
421 bool WorkerServiceImpl::CanCreateWorkerProcess( 422 bool WorkerServiceImpl::CanCreateWorkerProcess(
422 const WorkerProcessHost::WorkerInstance& instance) { 423 const WorkerProcessHost::WorkerInstance& instance) {
423 // Worker can be fired off if *any* parent has room. 424 // Worker can be fired off if *any* parent has room.
424 const WorkerDocumentSet::DocumentInfoSet& parents = 425 const WorkerDocumentSet::DocumentInfoSet& parents =
425 instance.worker_document_set()->documents(); 426 instance.worker_document_set()->documents();
426 427
427 for (WorkerDocumentSet::DocumentInfoSet::const_iterator parent_iter = 428 for (WorkerDocumentSet::DocumentInfoSet::const_iterator parent_iter =
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 instance_iter != iter->mutable_instances().end(); 591 instance_iter != iter->mutable_instances().end();
591 ++instance_iter) { 592 ++instance_iter) {
592 if (instance_iter->Matches(url, name, partition, resource_context)) 593 if (instance_iter->Matches(url, name, partition, resource_context))
593 return &(*instance_iter); 594 return &(*instance_iter);
594 } 595 }
595 } 596 }
596 return NULL; 597 return NULL;
597 } 598 }
598 599
599 } // namespace content 600 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/worker_host/worker_process_host.cc ('k') | content/child/shared_worker_devtools_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698