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

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

Issue 2229393003: net: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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/socket/client_socket_pool_manager_impl.cc ('k') | net/spdy/spdy_read_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_HTTP2_WRITE_SCHEDULER_H_ 5 #ifndef NET_SPDY_HTTP2_WRITE_SCHEDULER_H_
6 #define NET_SPDY_HTTP2_WRITE_SCHEDULER_H_ 6 #define NET_SPDY_HTTP2_WRITE_SCHEDULER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 bool ValidateInvariantsForTests() const; 161 bool ValidateInvariantsForTests() const;
162 162
163 // Returns true if the parent stream has the given stream in its children. 163 // Returns true if the parent stream has the given stream in its children.
164 bool StreamHasChild(const StreamInfo& parent_info, 164 bool StreamHasChild(const StreamInfo& parent_info,
165 const StreamInfo* child_info) const; 165 const StreamInfo* child_info) const;
166 166
167 // Pointee owned by all_stream_infos_. 167 // Pointee owned by all_stream_infos_.
168 StreamInfo* root_stream_info_; 168 StreamInfo* root_stream_info_;
169 // Maps from stream IDs to StreamInfo objects. 169 // Maps from stream IDs to StreamInfo objects.
170 StreamInfoMap all_stream_infos_; 170 StreamInfoMap all_stream_infos_;
171 STLValueDeleter<StreamInfoMap> all_stream_infos_deleter_; 171 base::STLValueDeleter<StreamInfoMap> all_stream_infos_deleter_;
172 // Queue containing all ready streams, ordered with streams of higher 172 // Queue containing all ready streams, ordered with streams of higher
173 // priority before streams of lower priority, and, among streams of equal 173 // priority before streams of lower priority, and, among streams of equal
174 // priority, streams with lower ordinal before those with higher 174 // priority, streams with lower ordinal before those with higher
175 // ordinal. Note that not all streams in scheduling_queue_ are eligible to be 175 // ordinal. Note that not all streams in scheduling_queue_ are eligible to be
176 // picked as the next stream: some may have ancestor stream(s) that are ready 176 // picked as the next stream: some may have ancestor stream(s) that are ready
177 // and unblocked. In these situations the occluded child streams are left in 177 // and unblocked. In these situations the occluded child streams are left in
178 // the queue, to reduce churn. 178 // the queue, to reduce churn.
179 base::LinkedList<StreamInfo> scheduling_queue_; 179 base::LinkedList<StreamInfo> scheduling_queue_;
180 // Ordinal value to assign to next node inserted into scheduling_queue_ when 180 // Ordinal value to assign to next node inserted into scheduling_queue_ when
181 // |add_to_front == true|. Decremented after each assignment. 181 // |add_to_front == true|. Decremented after each assignment.
(...skipping 18 matching lines...) Expand all
200 } 200 }
201 201
202 template <typename StreamIdType> 202 template <typename StreamIdType>
203 int Http2PriorityWriteScheduler<StreamIdType>::num_streams() const { 203 int Http2PriorityWriteScheduler<StreamIdType>::num_streams() const {
204 return all_stream_infos_.size(); 204 return all_stream_infos_.size();
205 } 205 }
206 206
207 template <typename StreamIdType> 207 template <typename StreamIdType>
208 bool Http2PriorityWriteScheduler<StreamIdType>::StreamRegistered( 208 bool Http2PriorityWriteScheduler<StreamIdType>::StreamRegistered(
209 StreamIdType stream_id) const { 209 StreamIdType stream_id) const {
210 return ContainsKey(all_stream_infos_, stream_id); 210 return base::ContainsKey(all_stream_infos_, stream_id);
211 } 211 }
212 212
213 template <typename StreamIdType> 213 template <typename StreamIdType>
214 void Http2PriorityWriteScheduler<StreamIdType>::RegisterStream( 214 void Http2PriorityWriteScheduler<StreamIdType>::RegisterStream(
215 StreamIdType stream_id, 215 StreamIdType stream_id,
216 const StreamPrecedenceType& precedence) { 216 const StreamPrecedenceType& precedence) {
217 SPDY_BUG_IF(precedence.is_spdy3_priority()) 217 SPDY_BUG_IF(precedence.is_spdy3_priority())
218 << "Expected HTTP/2 stream dependency"; 218 << "Expected HTTP/2 stream dependency";
219 219
220 if (StreamRegistered(stream_id)) { 220 if (StreamRegistered(stream_id)) {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 735 }
736 // Validate the validation function; we should have visited each stream twice 736 // Validate the validation function; we should have visited each stream twice
737 // (except for the root) 737 // (except for the root)
738 DCHECK(streams_visited == 2 * num_streams() - 1); 738 DCHECK(streams_visited == 2 * num_streams() - 1);
739 return true; 739 return true;
740 } 740 }
741 741
742 } // namespace net 742 } // namespace net
743 743
744 #endif // NET_SPDY_HTTP2_WRITE_SCHEDULER_H_ 744 #endif // NET_SPDY_HTTP2_WRITE_SCHEDULER_H_
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_manager_impl.cc ('k') | net/spdy/spdy_read_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698