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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/pending_task.h" | 13 #include "base/pending_task.h" |
14 #include "base/power_monitor/power_monitor.h" | 14 #include "base/power_monitor/power_monitor.h" |
15 #include "base/power_monitor/power_monitor_device_source.h" | 15 #include "base/power_monitor/power_monitor_device_source.h" |
16 #include "base/process/process_metrics.h" | 16 #include "base/process/process_metrics.h" |
17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/system_monitor/system_monitor.h" | 19 #include "base/system_monitor/system_monitor.h" |
20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
21 #include "base/threading/thread_restrictions.h" | 21 #include "base/threading/thread_restrictions.h" |
22 #include "base/timer/hi_res_timer_manager.h" | 22 #include "base/timer/hi_res_timer_manager.h" |
23 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
24 #include "content/browser/browser_thread_impl.h" | 24 #include "content/browser/browser_thread_impl.h" |
25 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 25 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
| 26 #include "content/browser/dom_storage/dom_storage_area.h" |
26 #include "content/browser/download/save_file_manager.h" | 27 #include "content/browser/download/save_file_manager.h" |
27 #include "content/browser/gamepad/gamepad_service.h" | 28 #include "content/browser/gamepad/gamepad_service.h" |
28 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 29 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
29 #include "content/browser/gpu/compositor_util.h" | 30 #include "content/browser/gpu/compositor_util.h" |
30 #include "content/browser/gpu/gpu_data_manager_impl.h" | 31 #include "content/browser/gpu/gpu_data_manager_impl.h" |
31 #include "content/browser/gpu/gpu_process_host.h" | 32 #include "content/browser/gpu/gpu_process_host.h" |
32 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 33 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
33 #include "content/browser/histogram_synchronizer.h" | 34 #include "content/browser/histogram_synchronizer.h" |
34 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 35 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
35 #include "content/browser/media/media_internals.h" | 36 #include "content/browser/media/media_internals.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 ScreenOrientationProvider::SetDelegate(screen_orientation_delegate_.get()); | 567 ScreenOrientationProvider::SetDelegate(screen_orientation_delegate_.get()); |
567 } | 568 } |
568 #endif | 569 #endif |
569 | 570 |
570 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { | 571 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { |
571 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); | 572 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); |
572 memory_observer_.reset(new MemoryObserver()); | 573 memory_observer_.reset(new MemoryObserver()); |
573 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); | 574 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); |
574 } | 575 } |
575 | 576 |
| 577 if (parsed_command_line_.HasSwitch( |
| 578 switches::kEnableAggressiveDOMStorageFlushing)) { |
| 579 TRACE_EVENT0("startup", |
| 580 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); |
| 581 DOMStorageArea::EnableAggressiveCommitDelay(); |
| 582 } |
| 583 |
576 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 584 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
577 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( | 585 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( |
578 base::MessageLoop::current()->message_loop_proxy(), | 586 base::MessageLoop::current()->message_loop_proxy(), |
579 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, | 587 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, |
580 ::GetHeapProfile)); | 588 ::GetHeapProfile)); |
581 #endif | 589 #endif |
582 } | 590 } |
583 | 591 |
584 int BrowserMainLoop::PreCreateThreads() { | 592 int BrowserMainLoop::PreCreateThreads() { |
585 if (parts_) { | 593 if (parts_) { |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 | 1285 |
1278 void BrowserMainLoop::EndStartupTracing() { | 1286 void BrowserMainLoop::EndStartupTracing() { |
1279 is_tracing_startup_ = false; | 1287 is_tracing_startup_ = false; |
1280 TracingController::GetInstance()->DisableRecording( | 1288 TracingController::GetInstance()->DisableRecording( |
1281 TracingController::CreateFileSink( | 1289 TracingController::CreateFileSink( |
1282 startup_trace_file_, | 1290 startup_trace_file_, |
1283 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1291 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1284 } | 1292 } |
1285 | 1293 |
1286 } // namespace content | 1294 } // namespace content |
OLD | NEW |