Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: net/log/test_net_log_util.cc

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/test_net_log_util.h" 5 #include "net/log/test_net_log_util.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "net/log/net_log.h"
10
9 namespace net { 11 namespace net {
10 12
11 namespace { 13 namespace {
12 14
13 // Takes the list of entries and an offset, and returns an index into the array. 15 // Takes the list of entries and an offset, and returns an index into the array.
14 // If |offset| is positive, just returns |offset|. If it's negative, it 16 // If |offset| is positive, just returns |offset|. If it's negative, it
15 // indicates a position relative to the end of the array. 17 // indicates a position relative to the end of the array.
16 size_t GetIndex(const TestNetLogEntry::List& entries, int offset) { 18 size_t GetIndex(const TestNetLogEntry::List& entries, int offset) {
17 if (offset >= 0) 19 if (offset >= 0)
18 return static_cast<size_t>(offset); 20 return static_cast<size_t>(offset);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 for (; i < entries.size(); ++i) { 117 for (; i < entries.size(); ++i) {
116 const TestNetLogEntry& entry = entries[i]; 118 const TestNetLogEntry& entry = entries[i];
117 if (entry.type == expected_event && entry.phase == expected_phase) 119 if (entry.type == expected_event && entry.phase == expected_phase)
118 break; 120 break;
119 } 121 }
120 EXPECT_LT(i, entries.size()); 122 EXPECT_LT(i, entries.size());
121 return i; 123 return i;
122 } 124 }
123 125
124 } // namespace net 126 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698