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

Side by Side Diff: net/quic/chromium/quic_chromium_client_session.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromium/quic_chromium_client_session.h" 5 #include "net/quic/chromium/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 going_away_(false), 236 going_away_(false),
237 port_migration_detected_(false), 237 port_migration_detected_(false),
238 disabled_reason_(QUIC_DISABLED_NOT), 238 disabled_reason_(QUIC_DISABLED_NOT),
239 token_binding_signatures_(kTokenBindingSignatureMapSize), 239 token_binding_signatures_(kTokenBindingSignatureMapSize),
240 streams_pushed_count_(0), 240 streams_pushed_count_(0),
241 streams_pushed_and_claimed_count_(0), 241 streams_pushed_and_claimed_count_(0),
242 error_code_from_rewrite_(OK), 242 error_code_from_rewrite_(OK),
243 use_error_code_from_rewrite_(false), 243 use_error_code_from_rewrite_(false),
244 weak_factory_(this) { 244 weak_factory_(this) {
245 sockets_.push_back(std::move(socket)); 245 sockets_.push_back(std::move(socket));
246 packet_readers_.push_back(base::WrapUnique(new QuicChromiumPacketReader( 246 packet_readers_.push_back(base::MakeUnique<QuicChromiumPacketReader>(
247 sockets_.back().get(), clock, this, yield_after_packets, 247 sockets_.back().get(), clock, this, yield_after_packets,
248 yield_after_duration, net_log_))); 248 yield_after_duration, net_log_));
249 crypto_stream_.reset( 249 crypto_stream_.reset(
250 crypto_client_stream_factory->CreateQuicCryptoClientStream( 250 crypto_client_stream_factory->CreateQuicCryptoClientStream(
251 server_id, this, base::WrapUnique(new ProofVerifyContextChromium( 251 server_id, this, base::MakeUnique<ProofVerifyContextChromium>(
252 cert_verify_flags, net_log_)), 252 cert_verify_flags, net_log_),
253 crypto_config)); 253 crypto_config));
254 connection->set_debug_visitor(logger_.get()); 254 connection->set_debug_visitor(logger_.get());
255 connection->set_creator_debug_delegate(logger_.get()); 255 connection->set_creator_debug_delegate(logger_.get());
256 net_log_.BeginEvent(NetLogEventType::QUIC_SESSION, 256 net_log_.BeginEvent(NetLogEventType::QUIC_SESSION,
257 base::Bind(NetLogQuicClientSessionCallback, &server_id, 257 base::Bind(NetLogQuicClientSessionCallback, &server_id,
258 cert_verify_flags, require_confirmation_)); 258 cert_verify_flags, require_confirmation_));
259 IPEndPoint address; 259 IPEndPoint address;
260 if (socket && socket->GetLocalAddress(&address) == OK && 260 if (socket && socket->GetLocalAddress(&address) == OK &&
261 address.GetFamily() == ADDRESS_FAMILY_IPV6) { 261 address.GetFamily() == ADDRESS_FAMILY_IPV6) {
262 connection->SetMaxPacketLength(connection->max_packet_length() - 262 connection->SetMaxPacketLength(connection->max_packet_length() -
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 reordering, 1, kMaxReordering, 50); 380 reordering, 1, kMaxReordering, 50);
381 } 381 }
382 UMA_HISTOGRAM_COUNTS( 382 UMA_HISTOGRAM_COUNTS(
383 "Net.QuicSession.MaxReordering", 383 "Net.QuicSession.MaxReordering",
384 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering)); 384 static_cast<base::HistogramBase::Sample>(stats.max_sequence_reordering));
385 } 385 }
386 386
387 void QuicChromiumClientSession::Initialize() { 387 void QuicChromiumClientSession::Initialize() {
388 QuicClientSessionBase::Initialize(); 388 QuicClientSessionBase::Initialize();
389 headers_stream()->SetHpackEncoderDebugVisitor( 389 headers_stream()->SetHpackEncoderDebugVisitor(
390 base::WrapUnique(new HpackEncoderDebugVisitor())); 390 base::MakeUnique<HpackEncoderDebugVisitor>());
391 headers_stream()->SetHpackDecoderDebugVisitor( 391 headers_stream()->SetHpackDecoderDebugVisitor(
392 base::WrapUnique(new HpackDecoderDebugVisitor())); 392 base::MakeUnique<HpackDecoderDebugVisitor>());
393 } 393 }
394 394
395 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( 395 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking(
396 QuicTime::Delta delta) { 396 QuicTime::Delta delta) {
397 UMA_HISTOGRAM_TIMES( 397 UMA_HISTOGRAM_TIMES(
398 "Net.QuicSession.HeadersHOLBlockedTime", 398 "Net.QuicSession.HeadersHOLBlockedTime",
399 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); 399 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds()));
400 } 400 }
401 401
402 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { 402 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) {
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 } 1239 }
1240 1240
1241 void QuicChromiumClientSession::DeletePromised( 1241 void QuicChromiumClientSession::DeletePromised(
1242 QuicClientPromisedInfo* promised) { 1242 QuicClientPromisedInfo* promised) {
1243 if (IsOpenStream(promised->id())) 1243 if (IsOpenStream(promised->id()))
1244 streams_pushed_and_claimed_count_++; 1244 streams_pushed_and_claimed_count_++;
1245 QuicClientSessionBase::DeletePromised(promised); 1245 QuicClientSessionBase::DeletePromised(promised);
1246 } 1246 }
1247 1247
1248 } // namespace net 1248 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/crypto_test_utils_chromium.cc ('k') | net/quic/chromium/quic_end_to_end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698