Chromium Code Reviews| 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" |
| 11 #include "base/memory/memory_pressure_monitor.h" | 11 #include "base/memory/memory_pressure_monitor.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/pending_task.h" | 14 #include "base/pending_task.h" |
| 15 #include "base/power_monitor/power_monitor.h" | 15 #include "base/power_monitor/power_monitor.h" |
| 16 #include "base/power_monitor/power_monitor_device_source.h" | 16 #include "base/power_monitor/power_monitor_device_source.h" |
| 17 #include "base/process/process_metrics.h" | 17 #include "base/process/process_metrics.h" |
| 18 #include "base/profiler/scoped_profile.h" | 18 #include "base/profiler/scoped_profile.h" |
| 19 #include "base/run_loop.h" | 19 #include "base/run_loop.h" |
| 20 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
| 23 #include "base/system_monitor/system_monitor.h" | 23 #include "base/system_monitor/system_monitor.h" |
| 24 #include "base/thread_task_runner_handle.h" | 24 #include "base/thread_task_runner_handle.h" |
| 25 #include "base/threading/thread_restrictions.h" | 25 #include "base/threading/thread_restrictions.h" |
| 26 #include "base/timer/hi_res_timer_manager.h" | 26 #include "base/timer/hi_res_timer_manager.h" |
| 27 #include "base/trace_event/memory_dump_manager.h" | 27 #include "base/trace_event/memory_dump_manager.h" |
| 28 #include "base/trace_event/trace_event.h" | 28 #include "base/trace_event/trace_event.h" |
| 29 #include "base/trace_event/trace_event_etw_export_win.h" | |
| 29 #include "content/browser/browser_thread_impl.h" | 30 #include "content/browser/browser_thread_impl.h" |
| 30 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 31 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
| 31 #include "content/browser/dom_storage/dom_storage_area.h" | 32 #include "content/browser/dom_storage/dom_storage_area.h" |
| 32 #include "content/browser/download/save_file_manager.h" | 33 #include "content/browser/download/save_file_manager.h" |
| 33 #include "content/browser/gamepad/gamepad_service.h" | 34 #include "content/browser/gamepad/gamepad_service.h" |
| 34 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 35 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 35 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 36 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 36 #include "content/browser/gpu/compositor_util.h" | 37 #include "content/browser/gpu/compositor_util.h" |
| 37 #include "content/browser/gpu/gpu_data_manager_impl.h" | 38 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 38 #include "content/browser/gpu/gpu_process_host.h" | 39 #include "content/browser/gpu/gpu_process_host.h" |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 GpuDataManagerImpl::GetInstance()->Initialize(); | 691 GpuDataManagerImpl::GetInstance()->Initialize(); |
| 691 } | 692 } |
| 692 | 693 |
| 693 #if !defined(OS_IOS) && (!defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)) | 694 #if !defined(OS_IOS) && (!defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)) |
| 694 // Single-process is an unsupported and not fully tested mode, so | 695 // Single-process is an unsupported and not fully tested mode, so |
| 695 // don't enable it for official Chrome builds (except on Android). | 696 // don't enable it for official Chrome builds (except on Android). |
| 696 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) | 697 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) |
| 697 RenderProcessHost::SetRunRendererInProcess(true); | 698 RenderProcessHost::SetRunRendererInProcess(true); |
| 698 #endif | 699 #endif |
| 699 | 700 |
| 701 #if defined(OS_WIN) | |
| 702 // Starts a timer to poll the ETW keyword (flags), that checks if a consumer | |
| 703 // is listening and if the categories have changed. | |
| 704 base::trace_event::TraceEventETWExport::StartKeywordUpdateTimer(); | |
|
brucedawson
2015/06/26 22:24:24
Does this get called in just the browser or in all
| |
| 705 #endif | |
| 706 | |
| 700 return result_code_; | 707 return result_code_; |
| 701 } | 708 } |
| 702 | 709 |
| 703 void BrowserMainLoop::CreateStartupTasks() { | 710 void BrowserMainLoop::CreateStartupTasks() { |
| 704 TRACE_EVENT0("startup", "BrowserMainLoop::CreateStartupTasks"); | 711 TRACE_EVENT0("startup", "BrowserMainLoop::CreateStartupTasks"); |
| 705 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::CreateStartupTasks"); | 712 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::CreateStartupTasks"); |
| 706 | 713 |
| 707 // First time through, we really want to create all the tasks | 714 // First time through, we really want to create all the tasks |
| 708 if (!startup_task_runner_.get()) { | 715 if (!startup_task_runner_.get()) { |
| 709 #if defined(OS_ANDROID) | 716 #if defined(OS_ANDROID) |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1349 DCHECK(is_tracing_startup_); | 1356 DCHECK(is_tracing_startup_); |
| 1350 | 1357 |
| 1351 is_tracing_startup_ = false; | 1358 is_tracing_startup_ = false; |
| 1352 TracingController::GetInstance()->DisableRecording( | 1359 TracingController::GetInstance()->DisableRecording( |
| 1353 TracingController::CreateFileSink( | 1360 TracingController::CreateFileSink( |
| 1354 startup_trace_file_, | 1361 startup_trace_file_, |
| 1355 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1362 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1356 } | 1363 } |
| 1357 | 1364 |
| 1358 } // namespace content | 1365 } // namespace content |
| OLD | NEW |