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

Side by Side Diff: net/spdy/spdy_test_util_common.cc

Issue 2095523002: Make //crypto factories return std::unique_ptr<>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I'm blind Created 4 years, 5 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/spdy/spdy_test_util_common.h ('k') | net/ssl/channel_id_service.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/spdy/spdy_test_util_common.h" 5 #include "net/spdy/spdy_test_util_common.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <memory>
11 #include <utility> 10 #include <utility>
12 11
13 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
14 #include "base/logging.h" 13 #include "base/logging.h"
15 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
16 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
18 #include "net/base/host_port_pair.h" 17 #include "net/base/host_port_pair.h"
19 #include "net/cert/ct_policy_enforcer.h" 18 #include "net/cert/ct_policy_enforcer.h"
20 #include "net/cert/mock_cert_verifier.h" 19 #include "net/cert/mock_cert_verifier.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 std::vector<uint8_t>* out_raw_sig) { 316 std::vector<uint8_t>* out_raw_sig) {
318 *out_raw_sig = signature; 317 *out_raw_sig = signature;
319 return true; 318 return true;
320 } 319 }
321 320
322 MockECSignatureCreatorFactory::MockECSignatureCreatorFactory() { 321 MockECSignatureCreatorFactory::MockECSignatureCreatorFactory() {
323 crypto::ECSignatureCreator::SetFactoryForTesting(this); 322 crypto::ECSignatureCreator::SetFactoryForTesting(this);
324 } 323 }
325 324
326 MockECSignatureCreatorFactory::~MockECSignatureCreatorFactory() { 325 MockECSignatureCreatorFactory::~MockECSignatureCreatorFactory() {
327 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); 326 crypto::ECSignatureCreator::SetFactoryForTesting(nullptr);
328 } 327 }
329 328
330 crypto::ECSignatureCreator* MockECSignatureCreatorFactory::Create( 329 std::unique_ptr<crypto::ECSignatureCreator>
331 crypto::ECPrivateKey* key) { 330 MockECSignatureCreatorFactory::Create(crypto::ECPrivateKey* key) {
332 return new MockECSignatureCreator(key); 331 return base::MakeUnique<MockECSignatureCreator>(key);
333 } 332 }
334 333
335 SpdySessionDependencies::SpdySessionDependencies(NextProto protocol) 334 SpdySessionDependencies::SpdySessionDependencies(NextProto protocol)
336 : SpdySessionDependencies(protocol, ProxyService::CreateDirect()) {} 335 : SpdySessionDependencies(protocol, ProxyService::CreateDirect()) {}
337 336
338 SpdySessionDependencies::SpdySessionDependencies( 337 SpdySessionDependencies::SpdySessionDependencies(
339 NextProto protocol, 338 NextProto protocol,
340 std::unique_ptr<ProxyService> proxy_service) 339 std::unique_ptr<ProxyService> proxy_service)
341 : host_resolver(new MockCachingHostResolver), 340 : host_resolver(new MockCachingHostResolver),
342 cert_verifier(new MockCertVerifier), 341 cert_verifier(new MockCertVerifier),
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 } 1284 }
1286 } 1285 }
1287 1286
1288 void SpdyTestUtil::SetPriority(RequestPriority priority, 1287 void SpdyTestUtil::SetPriority(RequestPriority priority,
1289 SpdySynStreamIR* ir) const { 1288 SpdySynStreamIR* ir) const {
1290 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1289 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1291 priority, spdy_version())); 1290 priority, spdy_version()));
1292 } 1291 }
1293 1292
1294 } // namespace net 1293 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/ssl/channel_id_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698