OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |