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

Side by Side Diff: net/quic/quic_framer.h

Issue 1037403004: Land Recent QUIC Changes until 03/27/2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 9 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_connection_test.cc ('k') | net/quic/quic_framer.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 #ifndef NET_QUIC_QUIC_FRAMER_H_ 5 #ifndef NET_QUIC_QUIC_FRAMER_H_
6 #define NET_QUIC_QUIC_FRAMER_H_ 6 #define NET_QUIC_QUIC_FRAMER_H_
7 7
8 #include <string>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string_piece.h" 14 #include "base/strings/string_piece.h"
14 #include "net/base/net_export.h" 15 #include "net/base/net_export.h"
15 #include "net/quic/quic_protocol.h" 16 #include "net/quic/quic_protocol.h"
16 17
17 namespace net { 18 namespace net {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 void SetAlternativeDecrypter(QuicDecrypter* decrypter, 340 void SetAlternativeDecrypter(QuicDecrypter* decrypter,
340 EncryptionLevel level, 341 EncryptionLevel level,
341 bool latch_once_used); 342 bool latch_once_used);
342 343
343 const QuicDecrypter* decrypter() const; 344 const QuicDecrypter* decrypter() const;
344 const QuicDecrypter* alternative_decrypter() const; 345 const QuicDecrypter* alternative_decrypter() const;
345 346
346 // Changes the encrypter used for level |level| to |encrypter|. The function 347 // Changes the encrypter used for level |level| to |encrypter|. The function
347 // takes ownership of |encrypter|. 348 // takes ownership of |encrypter|.
348 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); 349 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter);
349 const QuicEncrypter* encrypter(EncryptionLevel level) const;
350 350
351 // Returns a new encrypted packet, owned by the caller. 351 // Returns a new encrypted packet, owned by the caller.
352 QuicEncryptedPacket* EncryptPacket(EncryptionLevel level, 352 QuicEncryptedPacket* EncryptPacket(EncryptionLevel level,
353 QuicPacketSequenceNumber sequence_number, 353 QuicPacketSequenceNumber sequence_number,
354 const QuicPacket& packet); 354 const QuicPacket& packet);
355 355
356 // Returns the maximum length of plaintext that can be encrypted 356 // Returns the maximum length of plaintext that can be encrypted
357 // to ciphertext no larger than |ciphertext_size|. 357 // to ciphertext no larger than |ciphertext_size|.
358 size_t GetMaxPlaintextSize(size_t ciphertext_size); 358 size_t GetMaxPlaintextSize(size_t ciphertext_size);
359 359
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 QuicPacketSequenceNumber packet_sequence_number, 453 QuicPacketSequenceNumber packet_sequence_number,
454 QuicDataWriter* writer); 454 QuicDataWriter* writer);
455 455
456 static uint8 GetSequenceNumberFlags( 456 static uint8 GetSequenceNumberFlags(
457 QuicSequenceNumberLength sequence_number_length); 457 QuicSequenceNumberLength sequence_number_length);
458 458
459 static AckFrameInfo GetAckFrameInfo(const QuicAckFrame& frame); 459 static AckFrameInfo GetAckFrameInfo(const QuicAckFrame& frame);
460 460
461 // The Append* methods attempt to write the provided header or frame using the 461 // The Append* methods attempt to write the provided header or frame using the
462 // |writer|, and return true if successful. 462 // |writer|, and return true if successful.
463
464 // If header.public_header.version_flag is set, the version in the
465 // packet will be set -- but it will be set from quic_version_ not
466 // header.public_header.versions.
463 bool AppendPacketHeader(const QuicPacketHeader& header, 467 bool AppendPacketHeader(const QuicPacketHeader& header,
464 QuicDataWriter* writer); 468 QuicDataWriter* writer);
465 bool AppendTypeByte(const QuicFrame& frame, 469 bool AppendTypeByte(const QuicFrame& frame,
466 bool last_frame_in_packet, 470 bool last_frame_in_packet,
467 QuicDataWriter* writer); 471 QuicDataWriter* writer);
468 bool AppendStreamFrame(const QuicStreamFrame& frame, 472 bool AppendStreamFrame(const QuicStreamFrame& frame,
469 bool last_frame_in_packet, 473 bool last_frame_in_packet,
470 QuicDataWriter* builder); 474 QuicDataWriter* builder);
471 bool AppendAckFrameAndTypeByte(const QuicPacketHeader& header, 475 bool AppendAckFrameAndTypeByte(const QuicPacketHeader& header,
472 const QuicAckFrame& frame, 476 const QuicAckFrame& frame,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // The time delta computed for the last timestamp frame. This is relative to 542 // The time delta computed for the last timestamp frame. This is relative to
539 // the creation_time. 543 // the creation_time.
540 QuicTime::Delta last_timestamp_; 544 QuicTime::Delta last_timestamp_;
541 545
542 DISALLOW_COPY_AND_ASSIGN(QuicFramer); 546 DISALLOW_COPY_AND_ASSIGN(QuicFramer);
543 }; 547 };
544 548
545 } // namespace net 549 } // namespace net
546 550
547 #endif // NET_QUIC_QUIC_FRAMER_H_ 551 #endif // NET_QUIC_QUIC_FRAMER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698