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

Side by Side Diff: net/quic/test_tools/quic_stream_factory_peer.cc

Issue 2547233002: Add a QuicChromiumClock and make QuicClock abstract to match internal code. (Closed)
Patch Set: Created 4 years 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
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 #include "net/quic/test_tools/quic_stream_factory_peer.h" 5 #include "net/quic/test_tools/quic_stream_factory_peer.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "net/cert/x509_certificate.h" 10 #include "net/cert/x509_certificate.h"
11 #include "net/quic/chromium/quic_chromium_client_session.h" 11 #include "net/quic/chromium/quic_chromium_client_session.h"
12 #include "net/quic/chromium/quic_http_stream.h" 12 #include "net/quic/chromium/quic_http_stream.h"
13 #include "net/quic/chromium/quic_stream_factory.h" 13 #include "net/quic/chromium/quic_stream_factory.h"
14 #include "net/quic/core/crypto/quic_crypto_client_config.h" 14 #include "net/quic/core/crypto/quic_crypto_client_config.h"
15 #include "net/quic/platform/api/quic_clock.h" 15 #include "net/quic/platform/impl/quic_chromium_clock.h"
16 #include "net/test/cert_test_util.h" 16 #include "net/test/cert_test_util.h"
17 #include "net/test/test_data_directory.h" 17 #include "net/test/test_data_directory.h"
18 18
19 using std::string; 19 using std::string;
20 20
21 namespace net { 21 namespace net {
22 namespace test { 22 namespace test {
23 23
24 const QuicConfig* QuicStreamFactoryPeer::GetConfig(QuicStreamFactory* factory) { 24 const QuicConfig* QuicStreamFactoryPeer::GetConfig(QuicStreamFactory* factory) {
25 return &factory->config_; 25 return &factory->config_;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 scoped_refptr<X509Certificate> cert( 173 scoped_refptr<X509Certificate> cert(
174 ImportCertFromFile(GetTestCertsDirectory(), "wildcard.pem")); 174 ImportCertFromFile(GetTestCertsDirectory(), "wildcard.pem"));
175 DCHECK(cert); 175 DCHECK(cert);
176 std::string der_bytes; 176 std::string der_bytes;
177 DCHECK(X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_bytes)); 177 DCHECK(X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_bytes));
178 certs.push_back(der_bytes); 178 certs.push_back(der_bytes);
179 179
180 QuicCryptoClientConfig* crypto_config = &factory->crypto_config_; 180 QuicCryptoClientConfig* crypto_config = &factory->crypto_config_;
181 QuicCryptoClientConfig::CachedState* cached = 181 QuicCryptoClientConfig::CachedState* cached =
182 crypto_config->LookupOrCreate(quic_server_id); 182 crypto_config->LookupOrCreate(quic_server_id);
183 QuicClock clock; 183 QuicChromiumClock clock;
184 cached->Initialize(server_config, source_address_token, certs, "", "", 184 cached->Initialize(server_config, source_address_token, certs, "", "",
185 signature, clock.WallNow(), QuicWallTime::Zero()); 185 signature, clock.WallNow(), QuicWallTime::Zero());
186 DCHECK(!cached->certs().empty()); 186 DCHECK(!cached->certs().empty());
187 } 187 }
188 188
189 QuicClientPushPromiseIndex* QuicStreamFactoryPeer::GetPushPromiseIndex( 189 QuicClientPushPromiseIndex* QuicStreamFactoryPeer::GetPushPromiseIndex(
190 QuicStreamFactory* factory) { 190 QuicStreamFactory* factory) {
191 return &factory->push_promise_index_; 191 return &factory->push_promise_index_;
192 } 192 }
193 193
194 int QuicStreamFactoryPeer::GetNumPushStreamsCreated( 194 int QuicStreamFactoryPeer::GetNumPushStreamsCreated(
195 QuicStreamFactory* factory) { 195 QuicStreamFactory* factory) {
196 return factory->num_push_streams_created_; 196 return factory->num_push_streams_created_;
197 } 197 }
198 198
199 } // namespace test 199 } // namespace test
200 } // namespace net 200 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698