summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech
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/browser/speech
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/browser/speech')
-rw-r--r--chrome/browser/speech/tts_linux.cc6
1 files changed, 6 insertions, 0 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,