diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 23:31:38 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 23:31:38 +0000 |
commit | ce6564de3870a55541b8c71b635eb8b3ff20f313 (patch) | |
tree | 7b3d859970f1d3878873ded09b982f09a698cbb9 | |
parent | 1e0e74b3fb524d65666cddebe723db855021a706 (diff) | |
download | chromium_src-ce6564de3870a55541b8c71b635eb8b3ff20f313.zip chromium_src-ce6564de3870a55541b8c71b635eb8b3ff20f313.tar.gz chromium_src-ce6564de3870a55541b8c71b635eb8b3ff20f313.tar.bz2 |
Added support for --enable-shared-workers
Added a --enable-shared-workers flag, and return false from SharedWorkerRepository::isAvailable() if it is not set.
BUG=26233
TEST=None (unit tests do not run yet)
Review URL: http://codereview.chromium.org/372004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31162 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 1 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/renderer/renderer_webkitclient_impl.cc | 5 | ||||
-rw-r--r-- | webkit/api/src/SharedWorkerRepository.cpp | 6 |
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) |