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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/single_thread_task_runner.h" | 25 #include "base/single_thread_task_runner.h" |
26 #include "base/strings/string_number_conversions.h" | 26 #include "base/strings/string_number_conversions.h" |
27 #include "base/strings/string_split.h" | 27 #include "base/strings/string_split.h" |
28 #include "base/system_monitor/system_monitor.h" | 28 #include "base/system_monitor/system_monitor.h" |
29 #include "base/thread_task_runner_handle.h" | 29 #include "base/thread_task_runner_handle.h" |
30 #include "base/threading/thread_restrictions.h" | 30 #include "base/threading/thread_restrictions.h" |
31 #include "base/timer/hi_res_timer_manager.h" | 31 #include "base/timer/hi_res_timer_manager.h" |
32 #include "base/trace_event/memory_dump_manager.h" | 32 #include "base/trace_event/memory_dump_manager.h" |
33 #include "base/trace_event/trace_event.h" | 33 #include "base/trace_event/trace_event.h" |
34 #include "build/build_config.h" | 34 #include "build/build_config.h" |
35 #include "components/tracing/process_metrics_memory_dump_provider.h" | |
36 #include "components/tracing/trace_config_file.h" | 35 #include "components/tracing/trace_config_file.h" |
37 #include "components/tracing/trace_to_console.h" | 36 #include "components/tracing/trace_to_console.h" |
38 #include "components/tracing/tracing_switches.h" | 37 #include "components/tracing/tracing_switches.h" |
39 #include "content/browser/browser_thread_impl.h" | 38 #include "content/browser/browser_thread_impl.h" |
40 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 39 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
41 #include "content/browser/dom_storage/dom_storage_area.h" | 40 #include "content/browser/dom_storage/dom_storage_area.h" |
42 #include "content/browser/download/save_file_manager.h" | 41 #include "content/browser/download/save_file_manager.h" |
43 #include "content/browser/gamepad/gamepad_service.h" | 42 #include "content/browser/gamepad/gamepad_service.h" |
44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 43 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
45 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 44 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 | 683 |
685 if (parsed_command_line_.HasSwitch( | 684 if (parsed_command_line_.HasSwitch( |
686 switches::kEnableAggressiveDOMStorageFlushing)) { | 685 switches::kEnableAggressiveDOMStorageFlushing)) { |
687 TRACE_EVENT0("startup", | 686 TRACE_EVENT0("startup", |
688 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); | 687 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); |
689 DOMStorageArea::EnableAggressiveCommitDelay(); | 688 DOMStorageArea::EnableAggressiveCommitDelay(); |
690 } | 689 } |
691 | 690 |
692 // Enable memory-infra dump providers. | 691 // Enable memory-infra dump providers. |
693 InitSkiaEventTracer(); | 692 InitSkiaEventTracer(); |
694 tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess( | |
695 base::kNullProcessId); | |
696 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 693 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
697 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); | 694 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); |
698 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 695 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
699 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); | 696 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); |
700 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 697 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
701 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); | 698 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); |
702 } | 699 } |
703 | 700 |
704 int BrowserMainLoop::PreCreateThreads() { | 701 int BrowserMainLoop::PreCreateThreads() { |
705 if (parts_) { | 702 if (parts_) { |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 DCHECK(is_tracing_startup_for_duration_); | 1462 DCHECK(is_tracing_startup_for_duration_); |
1466 | 1463 |
1467 is_tracing_startup_for_duration_ = false; | 1464 is_tracing_startup_for_duration_ = false; |
1468 TracingController::GetInstance()->StopTracing( | 1465 TracingController::GetInstance()->StopTracing( |
1469 TracingController::CreateFileSink( | 1466 TracingController::CreateFileSink( |
1470 startup_trace_file_, | 1467 startup_trace_file_, |
1471 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1468 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1472 } | 1469 } |
1473 | 1470 |
1474 } // namespace content | 1471 } // namespace content |
OLD | NEW |