Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1417003003: [tracing] Dump child processes' memory metrics in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Rebase and fix nacl Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
35 #include "components/tracing/trace_config_file.h" 36 #include "components/tracing/trace_config_file.h"
36 #include "components/tracing/trace_to_console.h" 37 #include "components/tracing/trace_to_console.h"
37 #include "components/tracing/tracing_switches.h" 38 #include "components/tracing/tracing_switches.h"
38 #include "content/browser/browser_thread_impl.h" 39 #include "content/browser/browser_thread_impl.h"
39 #include "content/browser/device_sensors/device_inertial_sensor_service.h" 40 #include "content/browser/device_sensors/device_inertial_sensor_service.h"
40 #include "content/browser/dom_storage/dom_storage_area.h" 41 #include "content/browser/dom_storage/dom_storage_area.h"
41 #include "content/browser/download/save_file_manager.h" 42 #include "content/browser/download/save_file_manager.h"
42 #include "content/browser/gamepad/gamepad_service.h" 43 #include "content/browser/gamepad/gamepad_service.h"
43 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
44 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 45 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 684
684 if (parsed_command_line_.HasSwitch( 685 if (parsed_command_line_.HasSwitch(
685 switches::kEnableAggressiveDOMStorageFlushing)) { 686 switches::kEnableAggressiveDOMStorageFlushing)) {
686 TRACE_EVENT0("startup", 687 TRACE_EVENT0("startup",
687 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); 688 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay");
688 DOMStorageArea::EnableAggressiveCommitDelay(); 689 DOMStorageArea::EnableAggressiveCommitDelay();
689 } 690 }
690 691
691 // Enable memory-infra dump providers. 692 // Enable memory-infra dump providers.
692 InitSkiaEventTracer(); 693 InitSkiaEventTracer();
694 tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess(
695 base::kNullProcessId);
693 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 696 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
694 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); 697 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr);
695 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 698 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
696 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); 699 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr);
697 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 700 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
698 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); 701 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr);
699 } 702 }
700 703
701 int BrowserMainLoop::PreCreateThreads() { 704 int BrowserMainLoop::PreCreateThreads() {
702 if (parts_) { 705 if (parts_) {
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 DCHECK(is_tracing_startup_for_duration_); 1465 DCHECK(is_tracing_startup_for_duration_);
1463 1466
1464 is_tracing_startup_for_duration_ = false; 1467 is_tracing_startup_for_duration_ = false;
1465 TracingController::GetInstance()->StopTracing( 1468 TracingController::GetInstance()->StopTracing(
1466 TracingController::CreateFileSink( 1469 TracingController::CreateFileSink(
1467 startup_trace_file_, 1470 startup_trace_file_,
1468 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1471 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1469 } 1472 }
1470 1473
1471 } // namespace content 1474 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698