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 <algorithm> | 6 #include <algorithm> |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 const std::string& events_label, | 665 const std::string& events_label, |
666 const scoped_refptr<base::RefCountedString>& events_str_ptr) { | 666 const scoped_refptr<base::RefCountedString>& events_str_ptr) { |
667 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 667 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
668 | 668 |
669 if (trace_data_sink_.get() && events_str_ptr && | 669 if (trace_data_sink_.get() && events_str_ptr && |
670 !events_str_ptr->data().empty()) { | 670 !events_str_ptr->data().empty()) { |
671 if (agent_name == kETWTracingAgentName) { | 671 if (agent_name == kETWTracingAgentName) { |
672 // The Windows kernel events are kept into a JSON format stored as string | 672 // The Windows kernel events are kept into a JSON format stored as string |
673 // and must not be escaped. | 673 // and must not be escaped. |
674 trace_data_sink_->AddAgentTrace(events_label, events_str_ptr->data()); | 674 trace_data_sink_->AddAgentTrace(events_label, events_str_ptr->data()); |
675 } else if (agent_name != kArcTracingAgentName) { | 675 } else if (agent_name == kArcTracingAgentName) { |
676 // ARC trace data is obtained via systrace. Ignore the empty data. | 676 // The ARC events are kept into a JSON format stored as string |
677 // Quote other trace data as JSON strings and merge them into | 677 // and must not be escaped. |
678 // |trace_data_sink_|. | 678 trace_data_sink_->AddTraceChunk(events_str_ptr->data()); |
| 679 } else { |
679 trace_data_sink_->AddAgentTrace( | 680 trace_data_sink_->AddAgentTrace( |
680 events_label, base::GetQuotedJSONString(events_str_ptr->data())); | 681 events_label, base::GetQuotedJSONString(events_str_ptr->data())); |
681 } | 682 } |
682 } | 683 } |
683 std::vector<std::string> category_groups; | 684 std::vector<std::string> category_groups; |
684 OnStopTracingAcked(NULL, category_groups); | 685 OnStopTracingAcked(NULL, category_groups); |
685 } | 686 } |
686 | 687 |
687 void TracingControllerImpl::OnTraceDataCollected( | 688 void TracingControllerImpl::OnTraceDataCollected( |
688 const scoped_refptr<base::RefCountedString>& events_str_ptr) { | 689 const scoped_refptr<base::RefCountedString>& events_str_ptr) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 void TracingControllerImpl::RemoveTraceMessageFilterObserver( | 910 void TracingControllerImpl::RemoveTraceMessageFilterObserver( |
910 TraceMessageFilterObserver* observer) { | 911 TraceMessageFilterObserver* observer) { |
911 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 912 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
912 trace_message_filter_observers_.RemoveObserver(observer); | 913 trace_message_filter_observers_.RemoveObserver(observer); |
913 | 914 |
914 for (auto& filter : trace_message_filters_) | 915 for (auto& filter : trace_message_filters_) |
915 observer->OnTraceMessageFilterRemoved(filter.get()); | 916 observer->OnTraceMessageFilterRemoved(filter.get()); |
916 } | 917 } |
917 | 918 |
918 } // namespace content | 919 } // namespace content |
OLD | NEW |