diff options
-rw-r--r-- | chrome/browser/speech/tts_linux.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/startup/bad_flags_prompt.cc | 10 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 5 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 |
4 files changed, 20 insertions, 2 deletions
diff --git a/chrome/browser/speech/tts_linux.cc b/chrome/browser/speech/tts_linux.cc index 4d43a8e..44946ff 100644 --- a/chrome/browser/speech/tts_linux.cc +++ b/chrome/browser/speech/tts_linux.cc @@ -6,11 +6,13 @@ #include <map> +#include "base/command_line.h" #include "base/debug/leak_annotations.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/synchronization/lock.h" #include "chrome/browser/speech/tts_platform.h" +#include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_thread.h" #include "library_loaders/libspeechd.h" @@ -93,6 +95,10 @@ SPDNotificationType TtsPlatformImplLinux::current_notification_ = TtsPlatformImplLinux::TtsPlatformImplLinux() : utterance_id_(0) { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (!command_line.HasSwitch(switches::kEnableSpeechDispatcher)) + return; + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, base::Bind(&TtsPlatformImplLinux::Initialize, diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc index 5779c99..4236f62 100644 --- a/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/chrome/browser/ui/startup/bad_flags_prompt.cc @@ -51,9 +51,9 @@ void ShowBadFlagsPrompt(Browser* browser) { // These flags undermine HTTPS / connection security. switches::kDisableUserMediaSecurity, - #if defined(ENABLE_WEBRTC) +#if defined(ENABLE_WEBRTC) switches::kDisableWebRtcEncryption, - #endif +#endif switches::kIgnoreCertificateErrors, switches::kReduceSecurityForTesting, switches::kSyncAllowInsecureXmppConnection, @@ -65,6 +65,12 @@ void ShowBadFlagsPrompt(Browser* browser) { // This flag gives extensions more powers. extensions::switches::kExtensionsOnChromeURLs, + +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + // Speech dispatcher is buggy, it can crash and it can make Chrome freeze. + // http://crbug.com/327295 + switches::kEnableSpeechDispatcher, +#endif NULL }; diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 7a7a709..762ea47 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1444,6 +1444,11 @@ const char kPasswordStore[] = "password-store"; // and sanity checks are made to avoid corrupting the profile. // The browser exits after migration is complete. const char kMigrateDataDirForSxS[] = "migrate-data-dir-for-sxs"; + +// Allows sending text-to-speech requests to speech-dispatcher, a common +// Linux speech service. Because it's buggy, the user must explicitly +// enable it so that visiting a random webpage can't cause instability. +const char kEnableSpeechDispatcher[] = "enable-speech-dispatcher"; #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_MACOSX) diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 0244e27..71aec2a 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -405,6 +405,7 @@ extern const char kPasswordStore[]; #endif #if defined(OS_LINUX) && !defined(OS_CHROMEOS) +extern const char kEnableSpeechDispatcher[]; extern const char kMigrateDataDirForSxS[]; #endif |