Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: content/browser/worker_host/worker_service_impl.cc

Issue 154263004: Add commandline flag for ServiceWroker in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add render_process_host_impl.cc worker_service_impl.cc worker_service.h Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/browser/worker_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/browser/worker_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698