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

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

Issue 1099403008: content: Add SharedBitmap MemoryDumpProvider implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove includes Created 5 years, 7 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
« no previous file with comments | « no previous file | content/common/host_shared_bitmap_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 #include "content/browser/media/media_internals.h" 37 #include "content/browser/media/media_internals.h"
38 #include "content/browser/net/browser_online_state_observer.h" 38 #include "content/browser/net/browser_online_state_observer.h"
39 #include "content/browser/renderer_host/media/media_stream_manager.h" 39 #include "content/browser/renderer_host/media/media_stream_manager.h"
40 #include "content/browser/speech/speech_recognition_manager_impl.h" 40 #include "content/browser/speech/speech_recognition_manager_impl.h"
41 #include "content/browser/startup_task_runner.h" 41 #include "content/browser/startup_task_runner.h"
42 #include "content/browser/time_zone_monitor.h" 42 #include "content/browser/time_zone_monitor.h"
43 #include "content/browser/webui/content_web_ui_controller_factory.h" 43 #include "content/browser/webui/content_web_ui_controller_factory.h"
44 #include "content/browser/webui/url_data_manager.h" 44 #include "content/browser/webui/url_data_manager.h"
45 #include "content/common/content_switches_internal.h" 45 #include "content/common/content_switches_internal.h"
46 #include "content/common/host_discardable_shared_memory_manager.h" 46 #include "content/common/host_discardable_shared_memory_manager.h"
47 #include "content/common/host_shared_bitmap_manager.h"
47 #include "content/public/browser/browser_main_parts.h" 48 #include "content/public/browser/browser_main_parts.h"
48 #include "content/public/browser/browser_shutdown.h" 49 #include "content/public/browser/browser_shutdown.h"
49 #include "content/public/browser/content_browser_client.h" 50 #include "content/public/browser/content_browser_client.h"
50 #include "content/public/browser/render_process_host.h" 51 #include "content/public/browser/render_process_host.h"
51 #include "content/public/browser/tracing_controller.h" 52 #include "content/public/browser/tracing_controller.h"
52 #include "content/public/common/content_switches.h" 53 #include "content/public/common/content_switches.h"
53 #include "content/public/common/main_function_params.h" 54 #include "content/public/common/main_function_params.h"
54 #include "content/public/common/result_codes.h" 55 #include "content/public/common/result_codes.h"
55 #include "crypto/nss_util.h" 56 #include "crypto/nss_util.h"
56 #include "device/battery/battery_status_service.h" 57 #include "device/battery/battery_status_service.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 #endif 576 #endif
576 577
577 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { 578 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) {
578 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); 579 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver");
579 memory_observer_.reset(new MemoryObserver()); 580 memory_observer_.reset(new MemoryObserver());
580 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); 581 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
581 } 582 }
582 583
583 base::trace_event::MemoryDumpManager::GetInstance()->Initialize(); 584 base::trace_event::MemoryDumpManager::GetInstance()->Initialize();
584 585
586 // Enable the dump providers.
587 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
588 HostSharedBitmapManager::current());
589
585 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 590 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
586 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( 591 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController(
587 base::MessageLoop::current()->message_loop_proxy(), 592 base::MessageLoop::current()->message_loop_proxy(),
588 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, 593 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop,
589 ::GetHeapProfile)); 594 ::GetHeapProfile));
590 #endif 595 #endif
591 } 596 }
592 597
593 int BrowserMainLoop::PreCreateThreads() { 598 int BrowserMainLoop::PreCreateThreads() {
594 if (parts_) { 599 if (parts_) {
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 1300
1296 void BrowserMainLoop::EndStartupTracing() { 1301 void BrowserMainLoop::EndStartupTracing() {
1297 is_tracing_startup_ = false; 1302 is_tracing_startup_ = false;
1298 TracingController::GetInstance()->DisableRecording( 1303 TracingController::GetInstance()->DisableRecording(
1299 TracingController::CreateFileSink( 1304 TracingController::CreateFileSink(
1300 startup_trace_file_, 1305 startup_trace_file_,
1301 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1306 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1302 } 1307 }
1303 1308
1304 } // namespace content 1309 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/host_shared_bitmap_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698