| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/base/trace_net_log_observer.h" | 5 #include "net/base/trace_net_log_observer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 << "Unexpected item without a category field in trace_events"; | 120 << "Unexpected item without a category field in trace_events"; |
| 121 continue; | 121 continue; |
| 122 } | 122 } |
| 123 if (category != "netlog") | 123 if (category != "netlog") |
| 124 continue; | 124 continue; |
| 125 filtered_trace_events->Append(dict->DeepCopy()); | 125 filtered_trace_events->Append(dict->DeepCopy()); |
| 126 } | 126 } |
| 127 return filtered_trace_events.Pass(); | 127 return filtered_trace_events.Pass(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 base::ListValue* trace_events() const { | 130 base::ListValue* trace_events() const { return trace_events_.get(); } |
| 131 return trace_events_.get(); | |
| 132 } | |
| 133 | 131 |
| 134 CapturingNetLog* net_log() { | 132 CapturingNetLog* net_log() { return &net_log_; } |
| 135 return &net_log_; | |
| 136 } | |
| 137 | 133 |
| 138 TraceNetLogObserver* trace_net_log_observer() const { | 134 TraceNetLogObserver* trace_net_log_observer() const { |
| 139 return trace_net_log_observer_.get(); | 135 return trace_net_log_observer_.get(); |
| 140 } | 136 } |
| 141 | 137 |
| 142 private: | 138 private: |
| 143 scoped_ptr<base::ListValue> trace_events_; | 139 scoped_ptr<base::ListValue> trace_events_; |
| 144 base::debug::TraceResultBuffer trace_buffer_; | 140 base::debug::TraceResultBuffer trace_buffer_; |
| 145 base::debug::TraceResultBuffer::SimpleOutput json_output_; | 141 base::debug::TraceResultBuffer::SimpleOutput json_output_; |
| 146 CapturingNetLog net_log_; | 142 CapturingNetLog net_log_; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 EXPECT_TRUE(item1->GetString("args.params.foo", &item1_params)); | 361 EXPECT_TRUE(item1->GetString("args.params.foo", &item1_params)); |
| 366 EXPECT_EQ("bar", item1_params); | 362 EXPECT_EQ("bar", item1_params); |
| 367 | 363 |
| 368 EXPECT_TRUE(item2->GetString("args.params", &item2_params)); | 364 EXPECT_TRUE(item2->GetString("args.params", &item2_params)); |
| 369 EXPECT_TRUE(item2_params.empty()); | 365 EXPECT_TRUE(item2_params.empty()); |
| 370 } | 366 } |
| 371 | 367 |
| 372 } // namespace | 368 } // namespace |
| 373 | 369 |
| 374 } // namespace net | 370 } // namespace net |
| OLD | NEW |