| 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 #ifndef NET_SPDY_SPDY_PRIORITY_TREE_H_ | 5 #ifndef NET_SPDY_SPDY_PRIORITY_TREE_H_ |
| 6 #define NET_SPDY_SPDY_PRIORITY_TREE_H_ | 6 #define NET_SPDY_SPDY_PRIORITY_TREE_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | |
| 17 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 18 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 // This data structure implements the HTTP/2 stream priority tree defined in | 24 // This data structure implements the HTTP/2 stream priority tree defined in |
| 25 // section 5.3 of RFC 7540: | 25 // section 5.3 of RFC 7540: |
| 26 // http://tools.ietf.org/html/rfc7540#section-5.3 | 26 // http://tools.ietf.org/html/rfc7540#section-5.3 |
| 27 // | 27 // |
| 28 // Nodes can be added and removed, and dependencies between them defined. | 28 // Nodes can be added and removed, and dependencies between them defined. |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 // Validate the validation function; we should have visited each node twice | 555 // Validate the validation function; we should have visited each node twice |
| 556 // (except for the root) | 556 // (except for the root) |
| 557 DCHECK(nodes_visited == 2*num_nodes() - 1); | 557 DCHECK(nodes_visited == 2*num_nodes() - 1); |
| 558 return true; | 558 return true; |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace net | 561 } // namespace net |
| 562 | 562 |
| 563 #endif // NET_SPDY_SPDY_PRIORITY_TREE_H_ | 563 #endif // NET_SPDY_SPDY_PRIORITY_TREE_H_ |
| OLD | NEW |