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