| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/public/browser/browser_main_parts.h" | 42 #include "content/public/browser/browser_main_parts.h" |
| 43 #include "content/public/browser/browser_shutdown.h" | 43 #include "content/public/browser/browser_shutdown.h" |
| 44 #include "content/public/browser/compositor_util.h" | 44 #include "content/public/browser/compositor_util.h" |
| 45 #include "content/public/browser/content_browser_client.h" | 45 #include "content/public/browser/content_browser_client.h" |
| 46 #include "content/public/browser/render_process_host.h" | 46 #include "content/public/browser/render_process_host.h" |
| 47 #include "content/public/common/content_switches.h" | 47 #include "content/public/common/content_switches.h" |
| 48 #include "content/public/common/main_function_params.h" | 48 #include "content/public/common/main_function_params.h" |
| 49 #include "content/public/common/result_codes.h" | 49 #include "content/public/common/result_codes.h" |
| 50 #include "crypto/nss_util.h" | 50 #include "crypto/nss_util.h" |
| 51 #include "media/audio/audio_manager.h" | 51 #include "media/audio/audio_manager.h" |
| 52 #include "media/audio/key_press_monitor.h" |
| 52 #include "media/base/media.h" | 53 #include "media/base/media.h" |
| 53 #include "media/midi/midi_manager.h" | 54 #include "media/midi/midi_manager.h" |
| 54 #include "net/base/network_change_notifier.h" | 55 #include "net/base/network_change_notifier.h" |
| 55 #include "net/socket/client_socket_factory.h" | 56 #include "net/socket/client_socket_factory.h" |
| 56 #include "net/ssl/ssl_config_service.h" | 57 #include "net/ssl/ssl_config_service.h" |
| 57 #include "ui/base/clipboard/clipboard.h" | 58 #include "ui/base/clipboard/clipboard.h" |
| 58 | 59 |
| 59 #if defined(USE_AURA) | 60 #if defined(USE_AURA) |
| 60 #include "content/browser/aura/image_transport_factory.h" | 61 #include "content/browser/aura/image_transport_factory.h" |
| 61 #endif | 62 #endif |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 // otherwise we'll trigger the assertion about doing IO on the UI thread. | 858 // otherwise we'll trigger the assertion about doing IO on the UI thread. |
| 858 GpuDataManagerImpl::GetInstance()->Initialize(); | 859 GpuDataManagerImpl::GetInstance()->Initialize(); |
| 859 | 860 |
| 860 { | 861 { |
| 861 TRACE_EVENT0("startup", | 862 TRACE_EVENT0("startup", |
| 862 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); | 863 "BrowserMainLoop::BrowserThreadsStarted:InitSpeechRecognition"); |
| 863 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl( | 864 speech_recognition_manager_.reset(new SpeechRecognitionManagerImpl( |
| 864 audio_manager_.get(), media_stream_manager_.get())); | 865 audio_manager_.get(), media_stream_manager_.get())); |
| 865 } | 866 } |
| 866 | 867 |
| 868 { |
| 869 TRACE_EVENT0("startup", |
| 870 "BrowserMainLoop::BrowserThreadsStarted::InitKeyPressMonitor"); |
| 871 key_press_monitor_.reset( |
| 872 new media::KeyPressMonitor(audio_manager_->GetMessageLoop(), |
| 873 io_thread_->message_loop_proxy(), |
| 874 main_thread_->message_loop_proxy())); |
| 875 } |
| 876 |
| 867 // Alert the clipboard class to which threads are allowed to access the | 877 // Alert the clipboard class to which threads are allowed to access the |
| 868 // clipboard: | 878 // clipboard: |
| 869 std::vector<base::PlatformThreadId> allowed_clipboard_threads; | 879 std::vector<base::PlatformThreadId> allowed_clipboard_threads; |
| 870 // The current thread is the UI thread. | 880 // The current thread is the UI thread. |
| 871 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); | 881 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); |
| 872 #if defined(OS_WIN) | 882 #if defined(OS_WIN) |
| 873 // On Windows, clipboards are also used on the File or IO threads. | 883 // On Windows, clipboards are also used on the File or IO threads. |
| 874 allowed_clipboard_threads.push_back(file_thread_->thread_id()); | 884 allowed_clipboard_threads.push_back(file_thread_->thread_id()); |
| 875 allowed_clipboard_threads.push_back(io_thread_->thread_id()); | 885 allowed_clipboard_threads.push_back(io_thread_->thread_id()); |
| 876 #endif | 886 #endif |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 if (parameters_.ui_task) | 961 if (parameters_.ui_task) |
| 952 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 962 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
| 953 *parameters_.ui_task); | 963 *parameters_.ui_task); |
| 954 | 964 |
| 955 base::RunLoop run_loop; | 965 base::RunLoop run_loop; |
| 956 run_loop.Run(); | 966 run_loop.Run(); |
| 957 #endif | 967 #endif |
| 958 } | 968 } |
| 959 | 969 |
| 960 } // namespace content | 970 } // namespace content |
| OLD | NEW |