OLD | NEW |
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/memory_allocator_dump_guid.h" |
11 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
12 #include "content/browser/tracing/file_tracing_provider_impl.h" | 13 #include "content/browser/tracing/file_tracing_provider_impl.h" |
13 #include "content/browser/tracing/trace_message_filter.h" | 14 #include "content/browser/tracing/trace_message_filter.h" |
14 #include "content/browser/tracing/tracing_ui.h" | 15 #include "content/browser/tracing/tracing_ui.h" |
15 #include "content/common/child_process_messages.h" | 16 #include "content/common/child_process_messages.h" |
16 #include "content/public/browser/browser_message_filter.h" | 17 #include "content/public/browser/browser_message_filter.h" |
| 18 #include "content/public/common/child_process_host.h" |
17 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
18 | 20 |
19 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
20 #include "chromeos/dbus/dbus_thread_manager.h" | 22 #include "chromeos/dbus/dbus_thread_manager.h" |
21 #include "chromeos/dbus/debug_daemon_client.h" | 23 #include "chromeos/dbus/debug_daemon_client.h" |
22 #endif | 24 #endif |
23 | 25 |
24 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
25 #include "content/browser/tracing/etw_system_event_consumer_win.h" | 27 #include "content/browser/tracing/etw_system_event_consumer_win.h" |
26 #endif | 28 #endif |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 chromeos::DBusThreadManager::Get()->GetDebugDaemonClient()-> | 130 chromeos::DBusThreadManager::Get()->GetDebugDaemonClient()-> |
129 StartSystemTracing(); | 131 StartSystemTracing(); |
130 is_system_tracing_ = true; | 132 is_system_tracing_ = true; |
131 #elif defined(OS_WIN) | 133 #elif defined(OS_WIN) |
132 DCHECK(!is_system_tracing_); | 134 DCHECK(!is_system_tracing_); |
133 is_system_tracing_ = | 135 is_system_tracing_ = |
134 EtwSystemEventConsumer::GetInstance()->StartSystemTracing(); | 136 EtwSystemEventConsumer::GetInstance()->StartSystemTracing(); |
135 #endif | 137 #endif |
136 } | 138 } |
137 | 139 |
| 140 // Set the child process id for the browser process as invalid id. |
| 141 base::trace_event::MemoryAllocatorDumpGuid::SetUniqueChildProcessId( |
| 142 ChildProcessHost::kInvalidUniqueID); |
138 | 143 |
139 base::Closure on_enable_recording_done_callback = | 144 base::Closure on_enable_recording_done_callback = |
140 base::Bind(&TracingControllerImpl::OnEnableRecordingDone, | 145 base::Bind(&TracingControllerImpl::OnEnableRecordingDone, |
141 base::Unretained(this), | 146 base::Unretained(this), |
142 trace_config, callback); | 147 trace_config, callback); |
143 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 148 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
144 base::Bind(&TracingControllerImpl::SetEnabledOnFileThread, | 149 base::Bind(&TracingControllerImpl::SetEnabledOnFileThread, |
145 base::Unretained(this), | 150 base::Unretained(this), |
146 trace_config, | 151 trace_config, |
147 base::trace_event::TraceLog::RECORDING_MODE, | 152 base::trace_event::TraceLog::RECORDING_MODE, |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 is_monitoring_ = is_monitoring; | 864 is_monitoring_ = is_monitoring; |
860 #if !defined(OS_ANDROID) | 865 #if !defined(OS_ANDROID) |
861 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); | 866 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); |
862 it != tracing_uis_.end(); it++) { | 867 it != tracing_uis_.end(); it++) { |
863 (*it)->OnMonitoringStateChanged(is_monitoring); | 868 (*it)->OnMonitoringStateChanged(is_monitoring); |
864 } | 869 } |
865 #endif | 870 #endif |
866 } | 871 } |
867 | 872 |
868 } // namespace content | 873 } // namespace content |
OLD | NEW |