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/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/memory_pressure_monitor.h" | 12 #include "base/memory/memory_pressure_monitor.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/pending_task.h" | 15 #include "base/pending_task.h" |
16 #include "base/power_monitor/power_monitor.h" | 16 #include "base/power_monitor/power_monitor.h" |
17 #include "base/power_monitor/power_monitor_device_source.h" | 17 #include "base/power_monitor/power_monitor_device_source.h" |
18 #include "base/process/process_metrics.h" | 18 #include "base/process/process_metrics.h" |
19 #include "base/profiler/scoped_profile.h" | 19 #include "base/profiler/scoped_profile.h" |
20 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
21 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
24 #include "base/system_monitor/system_monitor.h" | 24 #include "base/system_monitor/system_monitor.h" |
25 #include "base/thread_task_runner_handle.h" | 25 #include "base/thread_task_runner_handle.h" |
26 #include "base/threading/thread_restrictions.h" | 26 #include "base/threading/thread_restrictions.h" |
27 #include "base/timer/hi_res_timer_manager.h" | 27 #include "base/timer/hi_res_timer_manager.h" |
28 #include "base/trace_event/memory_dump_manager.h" | 28 #include "base/trace_event/memory_dump_manager.h" |
29 #include "base/trace_event/trace_event.h" | 29 #include "base/trace_event/trace_event.h" |
| 30 #include "components/tracing/process_metrics_memory_dump_provider.h" |
30 #include "components/tracing/trace_config_file.h" | 31 #include "components/tracing/trace_config_file.h" |
31 #include "components/tracing/tracing_switches.h" | 32 #include "components/tracing/tracing_switches.h" |
32 #include "content/browser/browser_thread_impl.h" | 33 #include "content/browser/browser_thread_impl.h" |
33 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 34 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
34 #include "content/browser/dom_storage/dom_storage_area.h" | 35 #include "content/browser/dom_storage/dom_storage_area.h" |
35 #include "content/browser/download/save_file_manager.h" | 36 #include "content/browser/download/save_file_manager.h" |
36 #include "content/browser/gamepad/gamepad_service.h" | 37 #include "content/browser/gamepad/gamepad_service.h" |
37 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 38 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
38 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 39 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
39 #include "content/browser/gpu/compositor_util.h" | 40 #include "content/browser/gpu/compositor_util.h" |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 668 |
668 if (parsed_command_line_.HasSwitch( | 669 if (parsed_command_line_.HasSwitch( |
669 switches::kEnableAggressiveDOMStorageFlushing)) { | 670 switches::kEnableAggressiveDOMStorageFlushing)) { |
670 TRACE_EVENT0("startup", | 671 TRACE_EVENT0("startup", |
671 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); | 672 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); |
672 DOMStorageArea::EnableAggressiveCommitDelay(); | 673 DOMStorageArea::EnableAggressiveCommitDelay(); |
673 } | 674 } |
674 | 675 |
675 // Enable memory-infra dump providers. | 676 // Enable memory-infra dump providers. |
676 InitSkiaEventTracer(); | 677 InitSkiaEventTracer(); |
| 678 tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess( |
| 679 base::kNullProcessHandle); |
677 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 680 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
678 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); | 681 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); |
679 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 682 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
680 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); | 683 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); |
681 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 684 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
682 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); | 685 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); |
683 | 686 |
684 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 687 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
685 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( | 688 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( |
686 base::MessageLoop::current()->task_runner(), | 689 base::MessageLoop::current()->task_runner(), |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 DCHECK(is_tracing_startup_for_duration_); | 1452 DCHECK(is_tracing_startup_for_duration_); |
1450 | 1453 |
1451 is_tracing_startup_for_duration_ = false; | 1454 is_tracing_startup_for_duration_ = false; |
1452 TracingController::GetInstance()->StopTracing( | 1455 TracingController::GetInstance()->StopTracing( |
1453 TracingController::CreateFileSink( | 1456 TracingController::CreateFileSink( |
1454 startup_trace_file_, | 1457 startup_trace_file_, |
1455 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1458 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1456 } | 1459 } |
1457 | 1460 |
1458 } // namespace content | 1461 } // namespace content |
OLD | NEW |