OLD | NEW |
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 #include "net/quic/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 QuicWallTime::FromUNIXSeconds(seconds)); | 145 QuicWallTime::FromUNIXSeconds(seconds)); |
146 } | 146 } |
147 | 147 |
148 private: | 148 private: |
149 const QuicCryptoServerConfig* server_config_; | 149 const QuicCryptoServerConfig* server_config_; |
150 }; | 150 }; |
151 | 151 |
152 class TestStrikeRegisterClient : public StrikeRegisterClient { | 152 class TestStrikeRegisterClient : public StrikeRegisterClient { |
153 public: | 153 public: |
154 explicit TestStrikeRegisterClient(QuicCryptoServerConfig* config) | 154 explicit TestStrikeRegisterClient(QuicCryptoServerConfig* config) |
155 : config_(config), is_known_orbit_called_(false) {} | 155 : config_(config), |
| 156 is_known_orbit_called_(false) { |
| 157 } |
156 | 158 |
157 virtual bool IsKnownOrbit(StringPiece orbit) const OVERRIDE { | 159 virtual bool IsKnownOrbit(StringPiece orbit) const OVERRIDE { |
158 // Ensure that the strike register client lock is not held. | 160 // Ensure that the strike register client lock is not held. |
159 QuicCryptoServerConfigPeer peer(config_); | 161 QuicCryptoServerConfigPeer peer(config_); |
160 base::Lock* m = peer.GetStrikeRegisterClientLock(); | 162 base::Lock* m = peer.GetStrikeRegisterClientLock(); |
161 // In Chromium, we will dead lock if the lock is held by the current thread. | 163 // In Chromium, we will dead lock if the lock is held by the current thread. |
162 // Chromium doesn't have AssertNotHeld API call. | 164 // Chromium doesn't have AssertNotHeld API call. |
163 // m->AssertNotHeld(); | 165 // m->AssertNotHeld(); |
164 base::AutoLock lock(*m); | 166 base::AutoLock lock(*m); |
165 | 167 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 NULL); | 537 NULL); |
536 test_peer_.CheckConfigs( | 538 test_peer_.CheckConfigs( |
537 "a", false, | 539 "a", false, |
538 "b", true, | 540 "b", true, |
539 "c", false, | 541 "c", false, |
540 NULL); | 542 NULL); |
541 } | 543 } |
542 | 544 |
543 } // namespace test | 545 } // namespace test |
544 } // namespace net | 546 } // namespace net |
OLD | NEW |