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

Side by Side Diff: net/spdy/write_blocked_list.h

Issue 1328563002: clang_tidy net/spdy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « net/spdy/spdy_test_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 4
5 #ifndef NET_SPDY_WRITE_BLOCKED_LIST_H_ 5 #ifndef NET_SPDY_WRITE_BLOCKED_LIST_H_
6 #define NET_SPDY_WRITE_BLOCKED_LIST_H_ 6 #define NET_SPDY_WRITE_BLOCKED_LIST_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <deque> 9 #include <deque>
10 10
(...skipping 27 matching lines...) Expand all
38 if (priority > kLowestPriority) { 38 if (priority > kLowestPriority) {
39 LOG(DFATAL) << "Invalid priority: " << static_cast<int>(priority); 39 LOG(DFATAL) << "Invalid priority: " << static_cast<int>(priority);
40 return kLowestPriority; 40 return kLowestPriority;
41 } 41 }
42 return priority; 42 return priority;
43 } 43 }
44 44
45 // Returns the priority of the highest priority list with sessions on it. 45 // Returns the priority of the highest priority list with sessions on it.
46 SpdyPriority GetHighestPriorityWriteBlockedList() const { 46 SpdyPriority GetHighestPriorityWriteBlockedList() const {
47 for (SpdyPriority i = 0; i <= kLowestPriority; ++i) { 47 for (SpdyPriority i = 0; i <= kLowestPriority; ++i) {
48 if (write_blocked_lists_[i].size() > 0) 48 if (write_blocked_lists_[i].size() > 0) {
49 return i; 49 return i;
50 }
50 } 51 }
51 LOG(DFATAL) << "No blocked streams"; 52 LOG(DFATAL) << "No blocked streams";
52 return kHighestPriority; 53 return kHighestPriority;
53 } 54 }
54 55
55 IdType PopFront(SpdyPriority priority) { 56 IdType PopFront(SpdyPriority priority) {
56 priority = ClampPriority(priority); 57 priority = ClampPriority(priority);
57 DCHECK(!write_blocked_lists_[priority].empty()); 58 DCHECK(!write_blocked_lists_[priority].empty());
58 IdType stream_id = write_blocked_lists_[priority].front(); 59 IdType stream_id = write_blocked_lists_[priority].front();
59 write_blocked_lists_[priority].pop_front(); 60 write_blocked_lists_[priority].pop_front();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 158
158 typedef base::hash_map<IdType, SpdyPriority> StreamToPriorityMap; 159 typedef base::hash_map<IdType, SpdyPriority> StreamToPriorityMap;
159 160
160 BlockedList write_blocked_lists_[kLowestPriority + 1]; 161 BlockedList write_blocked_lists_[kLowestPriority + 1];
161 StreamToPriorityMap stream_to_priority_; 162 StreamToPriorityMap stream_to_priority_;
162 }; 163 };
163 164
164 } // namespace net 165 } // namespace net
165 166
166 #endif // NET_SPDY_WRITE_BLOCKED_LIST_H_ 167 #endif // NET_SPDY_WRITE_BLOCKED_LIST_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698