diff options
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 20 | ||||
-rw-r--r-- | chrome/browser/tab_contents/render_view_host_delegate_helper.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 6 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 2 |
5 files changed, 11 insertions, 21 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index e9bfedb..c13d592 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -316,8 +316,6 @@ bool BrowserRenderProcessHost::Init(bool is_extensions_process, scoped_ptr<CommandLine> cmd_line(new CommandLine(renderer_path)); cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, ASCIIToWide(channel_id)); - if (is_extensions_process) - cmd_line->AppendSwitch(switches::kEnableDatabases); AppendRendererCommandLine(cmd_line.get()); // Spawn the child process asynchronously to avoid blocking the UI thread. @@ -508,6 +506,7 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer( switches::kEnableBenchmarking, switches::kInternalNaCl, switches::kDisableByteRangeSupport, + switches::kDisableDatabases, switches::kDisableDesktopNotifications, switches::kDisableWebSockets, switches::kDisableLocalStorage, @@ -523,12 +522,6 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer( #endif }; - // Propagate the following switches to the renderer command line (along - // with any associated values) only if we're not in incognito mode. - static const char* const not_otr_switch_names[] = { - switches::kEnableDatabases, - }; - for (size_t i = 0; i < arraysize(switch_names); ++i) { if (browser_cmd.HasSwitch(switch_names[i])) { renderer_cmd->AppendSwitchWithValue(switch_names[i], @@ -536,13 +529,10 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer( } } - if (!profile()->IsOffTheRecord()) { - for (size_t i = 0; i < arraysize(not_otr_switch_names); ++i) { - if (browser_cmd.HasSwitch(not_otr_switch_names[i])) { - renderer_cmd->AppendSwitchWithValue(not_otr_switch_names[i], - browser_cmd.GetSwitchValueASCII(not_otr_switch_names[i])); - } - } + // Disable databases in incognito mode. + if (profile()->IsOffTheRecord() && + !browser_cmd.HasSwitch(switches::kDisableDatabases)) { + renderer_cmd->AppendSwitch(switches::kDisableDatabases); } } diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc index 3827a45..b57175c 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -182,7 +182,7 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( web_prefs.local_storage_enabled = !command_line.HasSwitch(switches::kDisableLocalStorage); web_prefs.databases_enabled = - command_line.HasSwitch(switches::kEnableDatabases); + !command_line.HasSwitch(switches::kDisableDatabases); web_prefs.experimental_webgl_enabled = command_line.HasSwitch(switches::kEnableExperimentalWebGL); } diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index f372542..9230067 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -75,6 +75,9 @@ const char kDisableByteRangeSupport[] = "disable-byte-range-support"; // Disables the custom JumpList on Windows 7. const char kDisableCustomJumpList[] = "disable-custom-jumplist"; +// Disables HTML5 DB support. +const char kDisableDatabases[] = "disable-databases"; + // Disables desktop notifications (default enabled on windows). const char kDisableDesktopNotifications[] = "disable-desktop-notifications"; @@ -171,9 +174,6 @@ const char kEnableApplicationCache[] = "enable-application-cache"; // Enables the benchmarking extensions. const char kEnableBenchmarking[] = "enable-benchmarking"; -// Enables HTML5 DB support. -const char kEnableDatabases[] = "enable-databases"; - // Enables extension APIs that are in development. const char kEnableExperimentalExtensionApis[] = "enable-experimental-extension-apis"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 3ab2fb7..1402cb5 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -36,6 +36,7 @@ extern const char kDisableAltWinstation[]; extern const char kDisableAudio[]; extern const char kDisableByteRangeSupport[]; extern const char kDisableCustomJumpList[]; +extern const char kDisableDatabases[]; extern const char kDisableDesktopNotifications[]; extern const char kDisableDevTools[]; extern const char kDisableExtensions[]; @@ -64,7 +65,6 @@ extern const char kDomAutomationController[]; extern const char kDumpHistogramsOnExit[]; extern const char kEnableApplicationCache[]; extern const char kEnableBenchmarking[]; -extern const char kEnableDatabases[]; extern const char kEnableExperimentalExtensionApis[]; extern const char kEnableExperimentalWebGL[]; extern const char kEnableExtensionTimelineApi[]; diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 0ca3603..3474109 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -550,7 +550,7 @@ void RenderThread::EnsureWebKitInitialized() { !command_line.HasSwitch(switches::kDisableWebSockets)); WebRuntimeFeatures::enableDatabase( - command_line.HasSwitch(switches::kEnableDatabases)); + !command_line.HasSwitch(switches::kDisableDatabases)); WebRuntimeFeatures::enableApplicationCache( command_line.HasSwitch(switches::kEnableApplicationCache)); |