Chromium Code Reviews| Index: content/browser/worker_host/worker_service_impl.cc |
| diff --git a/content/browser/worker_host/worker_service_impl.cc b/content/browser/worker_host/worker_service_impl.cc |
| index f2ac3735ae789c4dca1d7338ad2d67c6510d52c0..72a2c996ead07959705791f68f61ed9ca9744292 100644 |
| --- a/content/browser/worker_host/worker_service_impl.cc |
| +++ b/content/browser/worker_host/worker_service_impl.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/threading/thread.h" |
| #include "content/browser/devtools/worker_devtools_manager.h" |
| #include "content/browser/renderer_host/render_widget_host_impl.h" |
| +#include "content/browser/shared_worker/shared_worker_service_impl.h" |
| #include "content/browser/worker_host/worker_message_filter.h" |
| #include "content/browser/worker_host/worker_process_host.h" |
| #include "content/common/view_messages.h" |
| @@ -228,7 +229,17 @@ void WorkerPrioritySetter::Observe(int type, |
| } |
| WorkerService* WorkerService::GetInstance() { |
| - return WorkerServiceImpl::GetInstance(); |
| + if (EmbeddedSharedWorkerEnabled()) { |
| + return SharedWorkerServiceImpl::GetInstance(); |
| + } else { |
| + return WorkerServiceImpl::GetInstance(); |
| + } |
|
kinuko
2014/03/11 07:40:19
nit: no need of { } for single-line body
horo
2014/03/11 07:49:20
Done.
|
| +} |
| + |
| +bool WorkerService::EmbeddedSharedWorkerEnabled() { |
| + static bool enabled = CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableEmbeddedSharedWorker); |
| + return enabled; |
| } |
| WorkerServiceImpl* WorkerServiceImpl::GetInstance() { |