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

Side by Side Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 1072133006: Add granular file tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@do-initialize
Patch Set: comment 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 | « content/browser/tracing/tracing_controller_impl.h ('k') | content/content_browser.gypi » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "content/browser/tracing/tracing_controller_impl.h" 4 #include "content/browser/tracing/tracing_controller_impl.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/json/string_escape.h" 8 #include "base/json/string_escape.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/trace_event/trace_event.h" 11 #include "base/trace_event/trace_event.h"
12 #include "content/browser/tracing/file_tracing_provider_impl.h"
12 #include "content/browser/tracing/trace_message_filter.h" 13 #include "content/browser/tracing/trace_message_filter.h"
13 #include "content/browser/tracing/tracing_ui.h" 14 #include "content/browser/tracing/tracing_ui.h"
14 #include "content/common/child_process_messages.h" 15 #include "content/common/child_process_messages.h"
15 #include "content/public/browser/browser_message_filter.h" 16 #include "content/public/browser/browser_message_filter.h"
16 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
17 18
18 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
19 #include "chromeos/dbus/dbus_thread_manager.h" 20 #include "chromeos/dbus/dbus_thread_manager.h"
20 #include "chromeos/dbus/debug_daemon_client.h" 21 #include "chromeos/dbus/debug_daemon_client.h"
21 #endif 22 #endif
(...skipping 28 matching lines...) Expand all
50 pending_memory_dump_ack_count_(0), 51 pending_memory_dump_ack_count_(0),
51 failed_memory_dump_count_(0), 52 failed_memory_dump_count_(0),
52 // Tracing may have been enabled by ContentMainRunner if kTraceStartup 53 // Tracing may have been enabled by ContentMainRunner if kTraceStartup
53 // is specified in command line. 54 // is specified in command line.
54 #if defined(OS_CHROMEOS) || defined(OS_WIN) 55 #if defined(OS_CHROMEOS) || defined(OS_WIN)
55 is_system_tracing_(false), 56 is_system_tracing_(false),
56 #endif 57 #endif
57 is_recording_(TraceLog::GetInstance()->IsEnabled()), 58 is_recording_(TraceLog::GetInstance()->IsEnabled()),
58 is_monitoring_(false) { 59 is_monitoring_(false) {
59 base::trace_event::MemoryDumpManager::GetInstance()->SetDelegate(this); 60 base::trace_event::MemoryDumpManager::GetInstance()->SetDelegate(this);
61
62 // Deliberately leaked, like this class.
63 base::FileTracing::SetProvider(new FileTracingProviderImpl);
60 } 64 }
61 65
62 TracingControllerImpl::~TracingControllerImpl() { 66 TracingControllerImpl::~TracingControllerImpl() {
63 // This is a Leaky instance. 67 // This is a Leaky instance.
64 NOTREACHED(); 68 NOTREACHED();
65 } 69 }
66 70
67 TracingControllerImpl* TracingControllerImpl::GetInstance() { 71 TracingControllerImpl* TracingControllerImpl::GetInstance() {
68 return g_controller.Pointer(); 72 return g_controller.Pointer();
69 } 73 }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 is_monitoring_ = is_monitoring; 874 is_monitoring_ = is_monitoring;
871 #if !defined(OS_ANDROID) 875 #if !defined(OS_ANDROID)
872 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); 876 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin();
873 it != tracing_uis_.end(); it++) { 877 it != tracing_uis_.end(); it++) {
874 (*it)->OnMonitoringStateChanged(is_monitoring); 878 (*it)->OnMonitoringStateChanged(is_monitoring);
875 } 879 }
876 #endif 880 #endif
877 } 881 }
878 882
879 } // namespace content 883 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/tracing_controller_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698