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 // Some helpers for quic that are for chromium codebase. | 5 // Some helpers for quic that are for chromium codebase. |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_UTILS_CHROMIUM_H_ | 7 #ifndef NET_QUIC_QUIC_UTILS_CHROMIUM_H_ |
8 #define NET_QUIC_QUIC_UTILS_CHROMIUM_H_ | 8 #define NET_QUIC_QUIC_UTILS_CHROMIUM_H_ |
9 | 9 |
10 #include "base/basictypes.h" | |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
12 | 11 |
13 namespace net { | 12 namespace net { |
14 | 13 |
15 // | 14 // |
16 // Find*() | 15 // Find*() |
17 // | 16 // |
18 | 17 |
19 // Returns a const reference to the value associated with the given key if it | 18 // Returns a const reference to the value associated with the given key if it |
20 // exists. Crashes otherwise. | 19 // exists. Crashes otherwise. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 typename Collection::iterator it = collection.find(key); | 70 typename Collection::iterator it = collection.find(key); |
72 if (it == collection.end()) { | 71 if (it == collection.end()) { |
73 return 0; | 72 return 0; |
74 } | 73 } |
75 return &it->second; | 74 return &it->second; |
76 } | 75 } |
77 | 76 |
78 } // namespace net | 77 } // namespace net |
79 | 78 |
80 #endif // NET_QUIC_QUIC_UTILS_CHROMIUM_H_ | 79 #endif // NET_QUIC_QUIC_UTILS_CHROMIUM_H_ |
OLD | NEW |