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

Side by Side Diff: net/quic/core/quic_framer.cc

Issue 2500693002: Replace unique_ptr.reset with std::move in /net (Closed)
Patch Set: fix Created 4 years, 1 month 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/http/http_cache.h ('k') | net/socket/tcp_socket_posix.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) 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/core/quic_framer.h" 5 #include "net/quic/core/quic_framer.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 if (try_alternative_decryption) { 1646 if (try_alternative_decryption) {
1647 success = alternative_decrypter_->DecryptPacket( 1647 success = alternative_decrypter_->DecryptPacket(
1648 header.path_id, header.packet_number, associated_data, encrypted, 1648 header.path_id, header.packet_number, associated_data, encrypted,
1649 decrypted_buffer, decrypted_length, buffer_length); 1649 decrypted_buffer, decrypted_length, buffer_length);
1650 } 1650 }
1651 if (success) { 1651 if (success) {
1652 visitor_->OnDecryptedPacket(alternative_decrypter_level_); 1652 visitor_->OnDecryptedPacket(alternative_decrypter_level_);
1653 if (alternative_decrypter_latch_) { 1653 if (alternative_decrypter_latch_) {
1654 // Switch to the alternative decrypter and latch so that we cannot 1654 // Switch to the alternative decrypter and latch so that we cannot
1655 // switch back. 1655 // switch back.
1656 decrypter_.reset(alternative_decrypter_.release()); 1656 decrypter_ = std::move(alternative_decrypter_);
1657 decrypter_level_ = alternative_decrypter_level_; 1657 decrypter_level_ = alternative_decrypter_level_;
1658 alternative_decrypter_level_ = ENCRYPTION_NONE; 1658 alternative_decrypter_level_ = ENCRYPTION_NONE;
1659 } else { 1659 } else {
1660 // Switch the alternative decrypter so that we use it first next time. 1660 // Switch the alternative decrypter so that we use it first next time.
1661 decrypter_.swap(alternative_decrypter_); 1661 decrypter_.swap(alternative_decrypter_);
1662 EncryptionLevel level = alternative_decrypter_level_; 1662 EncryptionLevel level = alternative_decrypter_level_;
1663 alternative_decrypter_level_ = decrypter_level_; 1663 alternative_decrypter_level_ = decrypter_level_;
1664 decrypter_level_ = level; 1664 decrypter_level_ = level;
1665 } 1665 }
1666 } 1666 }
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 2185
2186 bool QuicFramer::RaiseError(QuicErrorCode error) { 2186 bool QuicFramer::RaiseError(QuicErrorCode error) {
2187 DVLOG(1) << "Error: " << QuicErrorCodeToString(error) 2187 DVLOG(1) << "Error: " << QuicErrorCodeToString(error)
2188 << " detail: " << detailed_error_; 2188 << " detail: " << detailed_error_;
2189 set_error(error); 2189 set_error(error);
2190 visitor_->OnError(this); 2190 visitor_->OnError(this);
2191 return false; 2191 return false;
2192 } 2192 }
2193 2193
2194 } // namespace net 2194 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_cache.h ('k') | net/socket/tcp_socket_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698