summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc5
-rw-r--r--webkit/api/src/SharedWorkerRepository.cpp6
5 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 4c2701a3..348f21b 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -528,6 +528,7 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer(
switches::kDisableWebSockets,
switches::kEnableLocalStorage,
switches::kEnableSessionStorage,
+ switches::kEnableSharedWorkers,
switches::kEnableDesktopNotifications,
// We propagate the Chrome Frame command line here as well in case the
// renderer is not run in the sandbox.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 60736d2..76df0e3 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -217,6 +217,9 @@ const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox";
// Enable session storage. Still buggy.
const char kEnableSessionStorage[] = "enable-session-storage";
+// Enable shared workers. Functionality not yet complete.
+const char kEnableSharedWorkers[] = "enable-shared-workers";
+
// Enables StatsTable, logging statistics to a global named shared memory table.
const char kEnableStatsTable[] = "enable-stats-table";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 2d387cd..d42347b 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -77,6 +77,7 @@ extern const char kEnableRemoteFonts[];
extern const char kEnableRendererAccessibility[];
extern const char kEnableSeccompSandbox[];
extern const char kEnableSessionStorage[];
+extern const char kEnableSharedWorkers[];
extern const char kEnableStatsTable[];
extern const char kEnableTabtastic2[];
extern const char kEnableUserDataDirProfiles[];
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index 612277b..d671a3f 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -368,7 +368,12 @@ long long RendererWebKitClientImpl::databaseGetFileSize(
WebKit::WebSharedWorkerRepository*
RendererWebKitClientImpl::sharedWorkerRepository() {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableSharedWorkers)) {
return &shared_worker_repository_;
+ } else {
+ return NULL;
+ }
}
//------------------------------------------------------------------------------
diff --git a/webkit/api/src/SharedWorkerRepository.cpp b/webkit/api/src/SharedWorkerRepository.cpp
index 194e75a..6de831b 100644
--- a/webkit/api/src/SharedWorkerRepository.cpp
+++ b/webkit/api/src/SharedWorkerRepository.cpp
@@ -116,10 +116,8 @@ void SharedWorkerScriptLoader::notifyFinished()
bool SharedWorkerRepository::isAvailable()
{
- // SharedWorkers are disabled for now until the implementation is further along.
- // FIXME(atwilson): Add code to check for a runtime flag like so:
- // return commandLineFlag && WebKit::webKitClient()->sharedWorkerRepository();
- return false;
+ // Allow the WebKitClient to determine if SharedWorkers are available.
+ return WebKit::webKitClient()->sharedWorkerRepository();
}
static WebSharedWorkerRepository::DocumentID getId(void* document)