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

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

Issue 2675713002: Switch Speech Recognition to asynchronous callback-based AudioManager interactions. (Closed)
Patch Set: 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/gpu_data_manager_observer.h" 85 #include "content/public/browser/gpu_data_manager_observer.h"
86 #include "content/public/browser/render_process_host.h" 86 #include "content/public/browser/render_process_host.h"
87 #include "content/public/browser/tracing_controller.h" 87 #include "content/public/browser/tracing_controller.h"
88 #include "content/public/common/content_client.h" 88 #include "content/public/common/content_client.h"
89 #include "content/public/common/content_features.h" 89 #include "content/public/common/content_features.h"
90 #include "content/public/common/content_switches.h" 90 #include "content/public/common/content_switches.h"
91 #include "content/public/common/main_function_params.h" 91 #include "content/public/common/main_function_params.h"
92 #include "content/public/common/result_codes.h" 92 #include "content/public/common/result_codes.h"
93 #include "device/battery/battery_status_service.h" 93 #include "device/battery/battery_status_service.h"
94 #include "device/gamepad/gamepad_service.h" 94 #include "device/gamepad/gamepad_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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 // MediaStreamManager needs the IO thread to be created. 1532 // MediaStreamManager needs the IO thread to be created.
1532 { 1533 {
1533 TRACE_EVENT0("startup", 1534 TRACE_EVENT0("startup",
1534 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager"); 1535 "BrowserMainLoop::BrowserThreadsStarted:InitMediaStreamManager");
1535 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); 1536 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get()));
1536 } 1537 }
1537 1538
1538 { 1539 {
1539 TRACE_EVENT0("startup", 1540 TRACE_EVENT0("startup",
1540 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); 1541 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition");
1541 speech_recognition_manager_.reset( 1542 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl(
1542 new SpeechRecognitionManagerImpl(media_stream_manager_.get())); 1543 audio_system_.get(), media_stream_manager_.get()));
1543 } 1544 }
1544 1545
1545 { 1546 {
1546 TRACE_EVENT0( 1547 TRACE_EVENT0(
1547 "startup", 1548 "startup",
1548 "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor"); 1549 "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor");
1549 user_input_monitor_ = media::UserInputMonitor::Create( 1550 user_input_monitor_ = media::UserInputMonitor::Create(
1550 io_thread_->task_runner(), main_thread_->task_runner()); 1551 io_thread_->task_runner(), main_thread_->task_runner());
1551 } 1552 }
1552 1553
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 1792
1792 audio_manager_ = GetContentClient()->browser()->CreateAudioManager( 1793 audio_manager_ = GetContentClient()->browser()->CreateAudioManager(
1793 MediaInternals::GetInstance()); 1794 MediaInternals::GetInstance());
1794 if (!audio_manager_) { 1795 if (!audio_manager_) {
1795 audio_thread_ = base::MakeUnique<AudioManagerThread>(); 1796 audio_thread_ = base::MakeUnique<AudioManagerThread>();
1796 audio_manager_ = media::AudioManager::Create( 1797 audio_manager_ = media::AudioManager::Create(
1797 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), 1798 audio_thread_->task_runner(), audio_thread_->worker_task_runner(),
1798 MediaInternals::GetInstance()); 1799 MediaInternals::GetInstance());
1799 } 1800 }
1800 CHECK(audio_manager_); 1801 CHECK(audio_manager_);
1802
1803 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1804 CHECK(audio_system_);
1801 } 1805 }
1802 1806
1803 } // namespace content 1807 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698