| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 229 } |
| 230 | 230 |
| 231 WorkerService* WorkerService::GetInstance() { | 231 WorkerService* WorkerService::GetInstance() { |
| 232 if (EmbeddedSharedWorkerEnabled()) | 232 if (EmbeddedSharedWorkerEnabled()) |
| 233 return SharedWorkerServiceImpl::GetInstance(); | 233 return SharedWorkerServiceImpl::GetInstance(); |
| 234 else | 234 else |
| 235 return WorkerServiceImpl::GetInstance(); | 235 return WorkerServiceImpl::GetInstance(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 bool WorkerService::EmbeddedSharedWorkerEnabled() { | 238 bool WorkerService::EmbeddedSharedWorkerEnabled() { |
| 239 static bool enabled = CommandLine::ForCurrentProcess()->HasSwitch( | 239 static bool disabled = CommandLine::ForCurrentProcess()->HasSwitch( |
| 240 switches::kEnableEmbeddedSharedWorker); | 240 switches::kDisableEmbeddedSharedWorker); |
| 241 return enabled; | 241 return !disabled; |
| 242 } | 242 } |
| 243 | 243 |
| 244 WorkerServiceImpl* WorkerServiceImpl::GetInstance() { | 244 WorkerServiceImpl* WorkerServiceImpl::GetInstance() { |
| 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 246 return Singleton<WorkerServiceImpl>::get(); | 246 return Singleton<WorkerServiceImpl>::get(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 WorkerServiceImpl::WorkerServiceImpl() | 249 WorkerServiceImpl::WorkerServiceImpl() |
| 250 : priority_setter_(new WorkerPrioritySetter()), | 250 : priority_setter_(new WorkerPrioritySetter()), |
| 251 next_worker_route_id_(0) { | 251 next_worker_route_id_(0) { |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 instance_iter != iter->mutable_instances().end(); | 591 instance_iter != iter->mutable_instances().end(); |
| 592 ++instance_iter) { | 592 ++instance_iter) { |
| 593 if (instance_iter->Matches(url, name, partition, resource_context)) | 593 if (instance_iter->Matches(url, name, partition, resource_context)) |
| 594 return &(*instance_iter); | 594 return &(*instance_iter); |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 return NULL; | 597 return NULL; |
| 598 } | 598 } |
| 599 | 599 |
| 600 } // namespace content | 600 } // namespace content |
| OLD | NEW |