Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2675713002: Switch Speech Recognition to asynchronous callback-based AudioManager interactions. (Closed)
Patch Set: review comments addressed Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #include "content/public/browser/render_process_host.h" 85 #include "content/public/browser/render_process_host.h"
86 #include "content/public/browser/tracing_controller.h" 86 #include "content/public/browser/tracing_controller.h"
87 #include "content/public/common/content_client.h" 87 #include "content/public/common/content_client.h"
88 #include "content/public/common/content_features.h" 88 #include "content/public/common/content_features.h"
89 #include "content/public/common/content_switches.h" 89 #include "content/public/common/content_switches.h"
90 #include "content/public/common/main_function_params.h" 90 #include "content/public/common/main_function_params.h"
91 #include "content/public/common/result_codes.h" 91 #include "content/public/common/result_codes.h"
92 #include "device/battery/battery_status_service.h" 92 #include "device/battery/battery_status_service.h"
93 #include "device/gamepad/gamepad_service.h" 93 #include "device/gamepad/gamepad_service.h"
94 #include "device/sensors/device_sensor_service.h" 94 #include "device/sensors/device_sensor_service.h"
95 #include "media/audio/audio_system_impl.h"
95 #include "media/base/media.h" 96 #include "media/base/media.h"
96 #include "media/base/user_input_monitor.h" 97 #include "media/base/user_input_monitor.h"
97 #include "media/midi/midi_service.h" 98 #include "media/midi/midi_service.h"
98 #include "mojo/edk/embedder/embedder.h" 99 #include "mojo/edk/embedder/embedder.h"
99 #include "mojo/edk/embedder/scoped_ipc_support.h" 100 #include "mojo/edk/embedder/scoped_ipc_support.h"
100 #include "net/base/network_change_notifier.h" 101 #include "net/base/network_change_notifier.h"
101 #include "net/socket/client_socket_factory.h" 102 #include "net/socket/client_socket_factory.h"
102 #include "net/ssl/ssl_config_service.h" 103 #include "net/ssl/ssl_config_service.h"
103 #include "ppapi/features/features.h" 104 #include "ppapi/features/features.h"
104 #include "services/service_manager/runner/common/client_util.h" 105 #include "services/service_manager/runner/common/client_util.h"
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 // MediaStreamManager needs the IO thread to be created. 1531 // MediaStreamManager needs the IO thread to be created.
1531 { 1532 {
1532 TRACE_EVENT0("startup", 1533 TRACE_EVENT0("startup",
1533 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager"); 1534 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager");
1534 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); 1535 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get()));
1535 } 1536 }
1536 1537
1537 { 1538 {
1538 TRACE_EVENT0("startup", 1539 TRACE_EVENT0("startup",
1539 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); 1540 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition");
1540 speech_recognition_manager_.reset( 1541 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl(
Avi (use Gerrit) 2017/02/06 16:14:21 base::MakeUnique?
o1ka 2017/02/06 16:40:06 Unfortunately this won't compile: for some reason
1541 new SpeechRecognitionManagerImpl(media_stream_manager_.get())); 1542 audio_system_.get(), media_stream_manager_.get()));
1542 } 1543 }
1543 1544
1544 { 1545 {
1545 TRACE_EVENT0( 1546 TRACE_EVENT0(
1546 "startup", 1547 "startup",
1547 "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor"); 1548 "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor");
1548 user_input_monitor_ = media::UserInputMonitor::Create( 1549 user_input_monitor_ = media::UserInputMonitor::Create(
1549 io_thread_->task_runner(), main_thread_->task_runner()); 1550 io_thread_->task_runner(), main_thread_->task_runner());
1550 } 1551 }
1551 1552
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 1791
1791 audio_manager_ = GetContentClient()->browser()->CreateAudioManager( 1792 audio_manager_ = GetContentClient()->browser()->CreateAudioManager(
1792 MediaInternals::GetInstance()); 1793 MediaInternals::GetInstance());
1793 if (!audio_manager_) { 1794 if (!audio_manager_) {
1794 audio_thread_ = base::MakeUnique<AudioManagerThread>(); 1795 audio_thread_ = base::MakeUnique<AudioManagerThread>();
1795 audio_manager_ = media::AudioManager::Create( 1796 audio_manager_ = media::AudioManager::Create(
1796 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), 1797 audio_thread_->task_runner(), audio_thread_->worker_task_runner(),
1797 MediaInternals::GetInstance()); 1798 MediaInternals::GetInstance());
1798 } 1799 }
1799 CHECK(audio_manager_); 1800 CHECK(audio_manager_);
1801
1802 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1803 CHECK(audio_system_);
1800 } 1804 }
1801 1805
1802 } // namespace content 1806 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/speech/speech_recognition_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698