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/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "content/browser/net/browser_online_state_observer.h" | 46 #include "content/browser/net/browser_online_state_observer.h" |
47 #include "content/browser/renderer_host/media/media_stream_manager.h" | 47 #include "content/browser/renderer_host/media/media_stream_manager.h" |
48 #include "content/browser/speech/speech_recognition_manager_impl.h" | 48 #include "content/browser/speech/speech_recognition_manager_impl.h" |
49 #include "content/browser/startup_task_runner.h" | 49 #include "content/browser/startup_task_runner.h" |
50 #include "content/browser/time_zone_monitor.h" | 50 #include "content/browser/time_zone_monitor.h" |
51 #include "content/browser/webui/content_web_ui_controller_factory.h" | 51 #include "content/browser/webui/content_web_ui_controller_factory.h" |
52 #include "content/browser/webui/url_data_manager.h" | 52 #include "content/browser/webui/url_data_manager.h" |
53 #include "content/common/content_switches_internal.h" | 53 #include "content/common/content_switches_internal.h" |
54 #include "content/common/host_discardable_shared_memory_manager.h" | 54 #include "content/common/host_discardable_shared_memory_manager.h" |
55 #include "content/common/host_shared_bitmap_manager.h" | 55 #include "content/common/host_shared_bitmap_manager.h" |
| 56 #include "content/common/resource_messages.h" |
56 #include "content/public/browser/browser_main_parts.h" | 57 #include "content/public/browser/browser_main_parts.h" |
57 #include "content/public/browser/content_browser_client.h" | 58 #include "content/public/browser/content_browser_client.h" |
58 #include "content/public/browser/render_process_host.h" | 59 #include "content/public/browser/render_process_host.h" |
59 #include "content/public/browser/tracing_controller.h" | 60 #include "content/public/browser/tracing_controller.h" |
60 #include "content/public/common/content_switches.h" | 61 #include "content/public/common/content_switches.h" |
61 #include "content/public/common/main_function_params.h" | 62 #include "content/public/common/main_function_params.h" |
62 #include "content/public/common/result_codes.h" | 63 #include "content/public/common/result_codes.h" |
63 #include "crypto/nss_util.h" | 64 #include "crypto/nss_util.h" |
64 #include "device/battery/battery_status_service.h" | 65 #include "device/battery/battery_status_service.h" |
| 66 #include "ipc/ipc_channel.h" |
65 #include "media/audio/audio_manager.h" | 67 #include "media/audio/audio_manager.h" |
66 #include "media/base/media.h" | 68 #include "media/base/media.h" |
67 #include "media/base/user_input_monitor.h" | 69 #include "media/base/user_input_monitor.h" |
68 #include "media/midi/midi_manager.h" | 70 #include "media/midi/midi_manager.h" |
69 #include "net/base/network_change_notifier.h" | 71 #include "net/base/network_change_notifier.h" |
70 #include "net/socket/client_socket_factory.h" | 72 #include "net/socket/client_socket_factory.h" |
71 #include "net/ssl/ssl_config_service.h" | 73 #include "net/ssl/ssl_config_service.h" |
72 #include "skia/ext/skia_memory_dump_provider.h" | 74 #include "skia/ext/skia_memory_dump_provider.h" |
73 #include "ui/base/clipboard/clipboard.h" | 75 #include "ui/base/clipboard/clipboard.h" |
74 | 76 |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 void BrowserMainLoop::InitializeMainThread() { | 1110 void BrowserMainLoop::InitializeMainThread() { |
1109 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeMainThread"); | 1111 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeMainThread"); |
1110 static const char kThreadName[] = "CrBrowserMain"; | 1112 static const char kThreadName[] = "CrBrowserMain"; |
1111 base::PlatformThread::SetName(kThreadName); | 1113 base::PlatformThread::SetName(kThreadName); |
1112 if (main_message_loop_) | 1114 if (main_message_loop_) |
1113 main_message_loop_->set_thread_name(kThreadName); | 1115 main_message_loop_->set_thread_name(kThreadName); |
1114 | 1116 |
1115 // Register the main thread by instantiating it, but don't call any methods. | 1117 // Register the main thread by instantiating it, but don't call any methods. |
1116 main_thread_.reset( | 1118 main_thread_.reset( |
1117 new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); | 1119 new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); |
| 1120 |
| 1121 // TODO(erikchen): Temporary code to help track http://crbug.com/527588. |
| 1122 IPC::Channel::SetMessageVerifier( |
| 1123 &content::CheckContentsOfDataReceivedMessage); |
1118 } | 1124 } |
1119 | 1125 |
1120 int BrowserMainLoop::BrowserThreadsStarted() { | 1126 int BrowserMainLoop::BrowserThreadsStarted() { |
1121 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); | 1127 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); |
1122 | 1128 |
1123 #if !defined(OS_IOS) | 1129 #if !defined(OS_IOS) |
1124 indexed_db_thread_.reset(new base::Thread("IndexedDB")); | 1130 indexed_db_thread_.reset(new base::Thread("IndexedDB")); |
1125 indexed_db_thread_->Start(); | 1131 indexed_db_thread_->Start(); |
1126 #endif | 1132 #endif |
1127 | 1133 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 DCHECK(is_tracing_startup_for_duration_); | 1386 DCHECK(is_tracing_startup_for_duration_); |
1381 | 1387 |
1382 is_tracing_startup_for_duration_ = false; | 1388 is_tracing_startup_for_duration_ = false; |
1383 TracingController::GetInstance()->DisableRecording( | 1389 TracingController::GetInstance()->DisableRecording( |
1384 TracingController::CreateFileSink( | 1390 TracingController::CreateFileSink( |
1385 startup_trace_file_, | 1391 startup_trace_file_, |
1386 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1392 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1387 } | 1393 } |
1388 | 1394 |
1389 } // namespace content | 1395 } // namespace content |
OLD | NEW |