| 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/log/trace_net_log_observer.h" | 5 #include "net/log/trace_net_log_observer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 continue; | 120 continue; |
| 121 } | 121 } |
| 122 std::string category; | 122 std::string category; |
| 123 if (!dict->GetString("cat", &category)) { | 123 if (!dict->GetString("cat", &category)) { |
| 124 ADD_FAILURE() | 124 ADD_FAILURE() |
| 125 << "Unexpected item without a category field in trace_events"; | 125 << "Unexpected item without a category field in trace_events"; |
| 126 continue; | 126 continue; |
| 127 } | 127 } |
| 128 if (category != kNetLogTracingCategory) | 128 if (category != kNetLogTracingCategory) |
| 129 continue; | 129 continue; |
| 130 filtered_trace_events->Append(dict->DeepCopy()); | 130 filtered_trace_events->Append(dict->CreateDeepCopy()); |
| 131 } | 131 } |
| 132 return filtered_trace_events; | 132 return filtered_trace_events; |
| 133 } | 133 } |
| 134 | 134 |
| 135 base::ListValue* trace_events() const { return trace_events_.get(); } | 135 base::ListValue* trace_events() const { return trace_events_.get(); } |
| 136 | 136 |
| 137 TestNetLog* net_log() { return &net_log_; } | 137 TestNetLog* net_log() { return &net_log_; } |
| 138 | 138 |
| 139 TraceNetLogObserver* trace_net_log_observer() const { | 139 TraceNetLogObserver* trace_net_log_observer() const { |
| 140 return trace_net_log_observer_.get(); | 140 return trace_net_log_observer_.get(); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 EXPECT_TRUE(item1->GetString("args.params.foo", &item1_params)); | 366 EXPECT_TRUE(item1->GetString("args.params.foo", &item1_params)); |
| 367 EXPECT_EQ("bar", item1_params); | 367 EXPECT_EQ("bar", item1_params); |
| 368 | 368 |
| 369 EXPECT_TRUE(item2->GetString("args.params", &item2_params)); | 369 EXPECT_TRUE(item2->GetString("args.params", &item2_params)); |
| 370 EXPECT_TRUE(item2_params.empty()); | 370 EXPECT_TRUE(item2_params.empty()); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace | 373 } // namespace |
| 374 | 374 |
| 375 } // namespace net | 375 } // namespace net |
| OLD | NEW |