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" |
11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "content/browser/debugger/worker_devtools_manager.h" | 13 #include "content/browser/debugger/worker_devtools_manager.h" |
14 #include "content/browser/worker_host/worker_message_filter.h" | 14 #include "content/browser/worker_host/worker_message_filter.h" |
15 #include "content/browser/worker_host/worker_process_host.h" | 15 #include "content/browser/worker_host/worker_process_host.h" |
16 #include "content/common/view_messages.h" | 16 #include "content/common/view_messages.h" |
17 #include "content/common/worker_messages.h" | 17 #include "content/common/worker_messages.h" |
18 #include "content/public/browser/child_process_data.h" | 18 #include "content/public/browser/child_process_data.h" |
19 #include "content/public/browser/resource_context.h" | 19 #include "content/public/browser/resource_context.h" |
20 #include "content/public/browser/worker_service_observer.h" | 20 #include "content/public/browser/worker_service_observer.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "content/public/common/process_type.h" | 22 #include "content/public/common/process_type.h" |
23 #include "net/base/registry_controlled_domain.h" | 23 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 const int WorkerServiceImpl::kMaxWorkerProcessesWhenSharing = 10; | 27 const int WorkerServiceImpl::kMaxWorkerProcessesWhenSharing = 10; |
28 const int WorkerServiceImpl::kMaxWorkersWhenSeparate = 64; | 28 const int WorkerServiceImpl::kMaxWorkersWhenSeparate = 64; |
29 const int WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate = 16; | 29 const int WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate = 16; |
30 | 30 |
31 WorkerService* WorkerService::GetInstance() { | 31 WorkerService* WorkerService::GetInstance() { |
32 return WorkerServiceImpl::GetInstance(); | 32 return WorkerServiceImpl::GetInstance(); |
33 } | 33 } |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 if (instance) | 562 if (instance) |
563 return instance; | 563 return instance; |
564 | 564 |
565 // No existing pending worker - create a new one. | 565 // No existing pending worker - create a new one. |
566 WorkerProcessHost::WorkerInstance pending(url, true, name, resource_context); | 566 WorkerProcessHost::WorkerInstance pending(url, true, name, resource_context); |
567 pending_shared_workers_.push_back(pending); | 567 pending_shared_workers_.push_back(pending); |
568 return &pending_shared_workers_.back(); | 568 return &pending_shared_workers_.back(); |
569 } | 569 } |
570 | 570 |
571 } // namespace content | 571 } // namespace content |
OLD | NEW |