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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "content/public/browser/browser_shutdown.h" | 45 #include "content/public/browser/browser_shutdown.h" |
46 #include "content/public/browser/compositor_util.h" | 46 #include "content/public/browser/compositor_util.h" |
47 #include "content/public/browser/content_browser_client.h" | 47 #include "content/public/browser/content_browser_client.h" |
48 #include "content/public/browser/render_process_host.h" | 48 #include "content/public/browser/render_process_host.h" |
49 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
50 #include "content/public/common/main_function_params.h" | 50 #include "content/public/common/main_function_params.h" |
51 #include "content/public/common/result_codes.h" | 51 #include "content/public/common/result_codes.h" |
52 #include "crypto/nss_util.h" | 52 #include "crypto/nss_util.h" |
53 #include "media/audio/audio_manager.h" | 53 #include "media/audio/audio_manager.h" |
54 #include "media/base/media.h" | 54 #include "media/base/media.h" |
| 55 #include "media/base/user_input_monitor.h" |
55 #include "media/midi/midi_manager.h" | 56 #include "media/midi/midi_manager.h" |
56 #include "net/base/network_change_notifier.h" | 57 #include "net/base/network_change_notifier.h" |
57 #include "net/socket/client_socket_factory.h" | 58 #include "net/socket/client_socket_factory.h" |
58 #include "net/ssl/ssl_config_service.h" | 59 #include "net/ssl/ssl_config_service.h" |
59 #include "ui/base/clipboard/clipboard.h" | 60 #include "ui/base/clipboard/clipboard.h" |
60 | 61 |
61 #if defined(USE_AURA) | 62 #if defined(USE_AURA) |
62 #include "content/browser/aura/image_transport_factory.h" | 63 #include "content/browser/aura/image_transport_factory.h" |
63 #endif | 64 #endif |
64 | 65 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 // otherwise we'll trigger the assertion about doing IO on the UI thread. | 866 // otherwise we'll trigger the assertion about doing IO on the UI thread. |
866 GpuDataManagerImpl::GetInstance()->Initialize(); | 867 GpuDataManagerImpl::GetInstance()->Initialize(); |
867 | 868 |
868 { | 869 { |
869 TRACE_EVENT0("startup", | 870 TRACE_EVENT0("startup", |
870 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); | 871 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); |
871 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl( | 872 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl( |
872 audio_manager_.get(), media_stream_manager_.get())); | 873 audio_manager_.get(), media_stream_manager_.get())); |
873 } | 874 } |
874 | 875 |
| 876 { |
| 877 TRACE_EVENT0( |
| 878 "startup", |
| 879 "BrowserMainLoop::BrowserThreadsStarted::InitUserInputMonitor"); |
| 880 user_input_monitor_ = media::UserInputMonitor::Create( |
| 881 io_thread_->message_loop_proxy(), main_thread_->message_loop_proxy()); |
| 882 } |
| 883 |
875 // Alert the clipboard class to which threads are allowed to access the | 884 // Alert the clipboard class to which threads are allowed to access the |
876 // clipboard: | 885 // clipboard: |
877 std::vector<base::PlatformThreadId> allowed_clipboard_threads; | 886 std::vector<base::PlatformThreadId> allowed_clipboard_threads; |
878 // The current thread is the UI thread. | 887 // The current thread is the UI thread. |
879 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); | 888 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); |
880 #if defined(OS_WIN) | 889 #if defined(OS_WIN) |
881 // On Windows, clipboards are also used on the File or IO threads. | 890 // On Windows, clipboards are also used on the File or IO threads. |
882 allowed_clipboard_threads.push_back(file_thread_->thread_id()); | 891 allowed_clipboard_threads.push_back(file_thread_->thread_id()); |
883 allowed_clipboard_threads.push_back(io_thread_->thread_id()); | 892 allowed_clipboard_threads.push_back(io_thread_->thread_id()); |
884 #endif | 893 #endif |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 if (parameters_.ui_task) | 968 if (parameters_.ui_task) |
960 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 969 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
961 *parameters_.ui_task); | 970 *parameters_.ui_task); |
962 | 971 |
963 base::RunLoop run_loop; | 972 base::RunLoop run_loop; |
964 run_loop.Run(); | 973 run_loop.Run(); |
965 #endif | 974 #endif |
966 } | 975 } |
967 | 976 |
968 } // namespace content | 977 } // namespace content |
OLD | NEW |