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/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
12 #include "content/browser/tracing/trace_message_filter.h" | 12 #include "content/browser/tracing/trace_message_filter.h" |
13 #include "content/browser/tracing/tracing_ui.h" | 13 #include "content/browser/tracing/tracing_ui.h" |
14 #include "content/common/child_process_messages.h" | 14 #include "content/common/child_process_messages.h" |
15 #include "content/public/browser/browser_message_filter.h" | 15 #include "content/public/browser/browser_message_filter.h" |
16 #include "content/public/common/content_client.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 |
22 | 23 |
23 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
24 #include "content/browser/tracing/etw_system_event_consumer_win.h" | 25 #include "content/browser/tracing/etw_system_event_consumer_win.h" |
25 #endif | 26 #endif |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 90 |
90 void TracingControllerImpl::SetEnabledOnFileThread( | 91 void TracingControllerImpl::SetEnabledOnFileThread( |
91 const CategoryFilter& category_filter, | 92 const CategoryFilter& category_filter, |
92 int mode, | 93 int mode, |
93 const TraceOptions& trace_options, | 94 const TraceOptions& trace_options, |
94 const base::Closure& callback) { | 95 const base::Closure& callback) { |
95 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 96 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
96 | 97 |
97 TraceLog::GetInstance()->SetEnabled( | 98 TraceLog::GetInstance()->SetEnabled( |
98 category_filter, static_cast<TraceLog::Mode>(mode), trace_options); | 99 category_filter, static_cast<TraceLog::Mode>(mode), trace_options); |
100 if (trace_options.enable_args_whitelist) { | |
101 TraceLog::GetInstance()->SetEventFilterPredicate( | |
102 GetContentClient()->GetTraceEventFilterPredicate()); | |
jam
2015/05/12 23:16:32
why do you need to change content? seems like chr
oystein (OOO til 10th of July)
2015/05/12 23:25:12
Tracing is primarily a content/ concept; there's n
| |
103 } | |
104 | |
99 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); | 105 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); |
100 } | 106 } |
101 | 107 |
102 void TracingControllerImpl::SetDisabledOnFileThread( | 108 void TracingControllerImpl::SetDisabledOnFileThread( |
103 const base::Closure& callback) { | 109 const base::Closure& callback) { |
104 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 110 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
105 | 111 |
106 TraceLog::GetInstance()->SetDisabled(); | 112 TraceLog::GetInstance()->SetDisabled(); |
107 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); | 113 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); |
108 } | 114 } |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
870 is_monitoring_ = is_monitoring; | 876 is_monitoring_ = is_monitoring; |
871 #if !defined(OS_ANDROID) | 877 #if !defined(OS_ANDROID) |
872 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); | 878 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); |
873 it != tracing_uis_.end(); it++) { | 879 it != tracing_uis_.end(); it++) { |
874 (*it)->OnMonitoringStateChanged(is_monitoring); | 880 (*it)->OnMonitoringStateChanged(is_monitoring); |
875 } | 881 } |
876 #endif | 882 #endif |
877 } | 883 } |
878 | 884 |
879 } // namespace content | 885 } // namespace content |
OLD | NEW |