OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 5 #include "content/browser/worker_host/worker_service.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/sys_info.h" | 10 #include "base/sys_info.h" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/render_messages.h" | |
14 #include "chrome/common/render_messages_params.h" | |
15 #include "content/browser/worker_host/worker_message_filter.h" | 13 #include "content/browser/worker_host/worker_message_filter.h" |
16 #include "content/browser/worker_host/worker_process_host.h" | 14 #include "content/browser/worker_host/worker_process_host.h" |
| 15 #include "content/common/view_messages.h" |
17 #include "content/common/worker_messages.h" | 16 #include "content/common/worker_messages.h" |
18 #include "net/base/registry_controlled_domain.h" | 17 #include "net/base/registry_controlled_domain.h" |
19 | 18 |
20 const int WorkerService::kMaxWorkerProcessesWhenSharing = 10; | 19 const int WorkerService::kMaxWorkerProcessesWhenSharing = 10; |
21 const int WorkerService::kMaxWorkersWhenSeparate = 64; | 20 const int WorkerService::kMaxWorkersWhenSeparate = 64; |
22 const int WorkerService::kMaxWorkersPerTabWhenSeparate = 16; | 21 const int WorkerService::kMaxWorkersPerTabWhenSeparate = 16; |
23 | 22 |
24 WorkerService* WorkerService::GetInstance() { | 23 WorkerService* WorkerService::GetInstance() { |
25 return Singleton<WorkerService>::get(); | 24 return Singleton<WorkerService>::get(); |
26 } | 25 } |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 FindPendingInstance(url, name, incognito); | 548 FindPendingInstance(url, name, incognito); |
550 if (instance) | 549 if (instance) |
551 return instance; | 550 return instance; |
552 | 551 |
553 // No existing pending worker - create a new one. | 552 // No existing pending worker - create a new one. |
554 WorkerProcessHost::WorkerInstance pending( | 553 WorkerProcessHost::WorkerInstance pending( |
555 url, true, incognito, name, MSG_ROUTING_NONE, 0, 0, 0, NULL); | 554 url, true, incognito, name, MSG_ROUTING_NONE, 0, 0, 0, NULL); |
556 pending_shared_workers_.push_back(pending); | 555 pending_shared_workers_.push_back(pending); |
557 return &pending_shared_workers_.back(); | 556 return &pending_shared_workers_.back(); |
558 } | 557 } |
OLD | NEW |