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

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

Issue 1333873002: [tracing] Fix MemoryDumpManager to support startup tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re dsinclair #5 (nits, invert Initialize args) Created 5 years, 3 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 "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"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); 635 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
636 } 636 }
637 637
638 if (parsed_command_line_.HasSwitch( 638 if (parsed_command_line_.HasSwitch(
639 switches::kEnableAggressiveDOMStorageFlushing)) { 639 switches::kEnableAggressiveDOMStorageFlushing)) {
640 TRACE_EVENT0("startup", 640 TRACE_EVENT0("startup",
641 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); 641 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay");
642 DOMStorageArea::EnableAggressiveCommitDelay(); 642 DOMStorageArea::EnableAggressiveCommitDelay();
643 } 643 }
644 644
645 base::trace_event::MemoryDumpManager::GetInstance()->Initialize(); 645 // Enable memory-infra dump providers.
646
647 // Enable the dump providers.
648 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 646 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
649 HostSharedBitmapManager::current()); 647 HostSharedBitmapManager::current());
650 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 648 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
651 skia::SkiaMemoryDumpProvider::GetInstance()); 649 skia::SkiaMemoryDumpProvider::GetInstance());
652 650
653 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 651 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
654 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( 652 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController(
655 base::MessageLoop::current()->task_runner(), 653 base::MessageLoop::current()->task_runner(),
656 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, 654 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop,
657 ::GetHeapProfile)); 655 ::GetHeapProfile));
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 DCHECK(is_tracing_startup_for_duration_); 1378 DCHECK(is_tracing_startup_for_duration_);
1381 1379
1382 is_tracing_startup_for_duration_ = false; 1380 is_tracing_startup_for_duration_ = false;
1383 TracingController::GetInstance()->DisableRecording( 1381 TracingController::GetInstance()->DisableRecording(
1384 TracingController::CreateFileSink( 1382 TracingController::CreateFileSink(
1385 startup_trace_file_, 1383 startup_trace_file_,
1386 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1384 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1387 } 1385 }
1388 1386
1389 } // namespace content 1387 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/child_memory_dump_manager_delegate_impl.cc ('k') | content/browser/tracing/memory_tracing_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698