summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-25 02:35:51 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-25 02:35:51 +0000
commite99a988a6345c7a1fabee2779918d0b0a152456a (patch)
tree684a8403b053730ec66ec11c5d6e616c44cd964e /chrome
parent308520c2909416eab488103bc5e4531c7a90dbfe (diff)
downloadchromium_src-e99a988a6345c7a1fabee2779918d0b0a152456a.zip
chromium_src-e99a988a6345c7a1fabee2779918d0b0a152456a.tar.gz
chromium_src-e99a988a6345c7a1fabee2779918d0b0a152456a.tar.bz2
Only enable speech dispatcher on Linux with an explicit switch.
Now that the speechSynthesis api is part of the drive-by web, we don't want just visiting a malicious site to be able to cause speech-dispatcher to crash. BUG=327295,333003 Review URL: https://codereview.chromium.org/209393004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/speech/tts_linux.cc6
-rw-r--r--chrome/browser/ui/startup/bad_flags_prompt.cc10
-rw-r--r--chrome/common/chrome_switches.cc5
-rw-r--r--chrome/common/chrome_switches.h1
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