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

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

Issue 986503002: components/metrics: Add runtime memory leak detector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix error in leak analyzer logic Created 5 years, 6 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/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 memory_observer_.reset(new MemoryObserver()); 580 memory_observer_.reset(new MemoryObserver());
581 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); 581 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
582 } 582 }
583 583
584 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 584 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
585 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( 585 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController(
586 base::MessageLoop::current()->message_loop_proxy(), 586 base::MessageLoop::current()->message_loop_proxy(),
587 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, 587 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop,
588 ::GetHeapProfile)); 588 ::GetHeapProfile));
589 #endif 589 #endif
590
591 #if defined (ENABLE_LEAK_DETECTOR)
592 LeakDetectorDummy();
593 #endif
590 } 594 }
591 595
592 int BrowserMainLoop::PreCreateThreads() { 596 int BrowserMainLoop::PreCreateThreads() {
593 if (parts_) { 597 if (parts_) {
594 TRACE_EVENT0("startup", 598 TRACE_EVENT0("startup",
595 "BrowserMainLoop::CreateThreads:PreCreateThreads"); 599 "BrowserMainLoop::CreateThreads:PreCreateThreads");
596 result_code_ = parts_->PreCreateThreads(); 600 result_code_ = parts_->PreCreateThreads();
597 } 601 }
598 602
599 #if defined(OS_CHROMEOS) 603 #if defined(OS_CHROMEOS)
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 1278
1275 void BrowserMainLoop::EndStartupTracing() { 1279 void BrowserMainLoop::EndStartupTracing() {
1276 is_tracing_startup_ = false; 1280 is_tracing_startup_ = false;
1277 TracingController::GetInstance()->DisableRecording( 1281 TracingController::GetInstance()->DisableRecording(
1278 TracingController::CreateFileSink( 1282 TracingController::CreateFileSink(
1279 startup_trace_file_, 1283 startup_trace_file_,
1280 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1284 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1281 } 1285 }
1282 1286
1283 } // namespace content 1287 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698