| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <math.h> | 5 #include <math.h> |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplLinux); | 89 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplLinux); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 // static | 92 // static |
| 93 SPDNotificationType TtsPlatformImplLinux::current_notification_ = | 93 SPDNotificationType TtsPlatformImplLinux::current_notification_ = |
| 94 SPD_EVENT_END; | 94 SPD_EVENT_END; |
| 95 | 95 |
| 96 TtsPlatformImplLinux::TtsPlatformImplLinux() | 96 TtsPlatformImplLinux::TtsPlatformImplLinux() |
| 97 : utterance_id_(0) { | 97 : utterance_id_(0) { |
| 98 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 99 if (!command_line.HasSwitch(switches::kEnableSpeechDispatcher)) | |
| 100 return; | |
| 101 | |
| 102 BrowserThread::PostTask(BrowserThread::FILE, | 98 BrowserThread::PostTask(BrowserThread::FILE, |
| 103 FROM_HERE, | 99 FROM_HERE, |
| 104 base::Bind(&TtsPlatformImplLinux::Initialize, | 100 base::Bind(&TtsPlatformImplLinux::Initialize, |
| 105 base::Unretained(this))); | 101 base::Unretained(this))); |
| 106 } | 102 } |
| 107 | 103 |
| 108 void TtsPlatformImplLinux::Initialize() { | 104 void TtsPlatformImplLinux::Initialize() { |
| 109 base::AutoLock lock(initialization_lock_); | 105 base::AutoLock lock(initialization_lock_); |
| 110 | 106 |
| 111 if (!libspeechd_loader_.Load("libspeechd.so.2")) | 107 if (!libspeechd_loader_.Load("libspeechd.so.2")) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // static | 339 // static |
| 344 TtsPlatformImplLinux* TtsPlatformImplLinux::GetInstance() { | 340 TtsPlatformImplLinux* TtsPlatformImplLinux::GetInstance() { |
| 345 return Singleton<TtsPlatformImplLinux, | 341 return Singleton<TtsPlatformImplLinux, |
| 346 LeakySingletonTraits<TtsPlatformImplLinux> >::get(); | 342 LeakySingletonTraits<TtsPlatformImplLinux> >::get(); |
| 347 } | 343 } |
| 348 | 344 |
| 349 // static | 345 // static |
| 350 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { | 346 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { |
| 351 return TtsPlatformImplLinux::GetInstance(); | 347 return TtsPlatformImplLinux::GetInstance(); |
| 352 } | 348 } |
| OLD | NEW |