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

Side by Side Diff: net/quic/quic_connection_test.cc

Issue 1670863002: QUIC - minor cleanup changes to keep code in sync with the internal source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0204
Patch Set: Created 4 years, 10 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/quic/quic_arena_scoped_ptr_test.cc ('k') | net/quic/quic_crypto_client_stream.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/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 QuicPacketNumber packet_number, 87 QuicPacketNumber packet_number,
88 StringPiece associated_data, 88 StringPiece associated_data,
89 StringPiece plaintext, 89 StringPiece plaintext,
90 char* output, 90 char* output,
91 size_t* output_length, 91 size_t* output_length,
92 size_t max_output_length) override { 92 size_t max_output_length) override {
93 const size_t len = plaintext.size() + kTagSize; 93 const size_t len = plaintext.size() + kTagSize;
94 if (max_output_length < len) { 94 if (max_output_length < len) {
95 return false; 95 return false;
96 } 96 }
97 // Memmove is safe for inplace encryption.
97 memmove(output, plaintext.data(), plaintext.size()); 98 memmove(output, plaintext.data(), plaintext.size());
98 output += plaintext.size(); 99 output += plaintext.size();
99 memset(output, tag_, kTagSize); 100 memset(output, tag_, kTagSize);
100 *output_length = len; 101 *output_length = len;
101 return true; 102 return true;
102 } 103 }
103 104
104 size_t GetKeySize() const override { return 0; } 105 size_t GetKeySize() const override { return 0; }
105 size_t GetNoncePrefixSize() const override { return 0; } 106 size_t GetNoncePrefixSize() const override { return 0; }
106 107
(...skipping 5399 matching lines...) Expand 10 before | Expand all | Expand 10 after
5506 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); 5507 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece());
5507 EXPECT_DFATAL(ProcessFramePacket(QuicFrame(&stream_frame)), 5508 EXPECT_DFATAL(ProcessFramePacket(QuicFrame(&stream_frame)),
5508 "Received a packet with multipath flag on when multipath is " 5509 "Received a packet with multipath flag on when multipath is "
5509 "not enabled."); 5510 "not enabled.");
5510 EXPECT_FALSE(connection_.connected()); 5511 EXPECT_FALSE(connection_.connected());
5511 } 5512 }
5512 5513
5513 } // namespace 5514 } // namespace
5514 } // namespace test 5515 } // namespace test
5515 } // namespace net 5516 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_arena_scoped_ptr_test.cc ('k') | net/quic/quic_crypto_client_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698