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

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

Issue 2334363002: Landing Recent QUIC changes until Sat Sep 10 00:32:41 (Closed)
Patch Set: Revase 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
« no previous file with comments | « net/quic/core/quic_flags_list.h ('k') | net/quic/core/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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 QuicPacketHeader* header); 434 QuicPacketHeader* header);
435 435
436 // Processes the authenticated portion of the header into |header| from 436 // Processes the authenticated portion of the header into |header| from
437 // the current QuicDataReader. Returns true on success, false on failure. 437 // the current QuicDataReader. Returns true on success, false on failure.
438 bool ProcessAuthenticatedHeader(QuicDataReader* reader, 438 bool ProcessAuthenticatedHeader(QuicDataReader* reader,
439 QuicPacketHeader* header); 439 QuicPacketHeader* header);
440 440
441 bool ProcessPathId(QuicDataReader* reader, QuicPathId* path_id); 441 bool ProcessPathId(QuicDataReader* reader, QuicPathId* path_id);
442 bool ProcessPacketSequenceNumber(QuicDataReader* reader, 442 bool ProcessPacketSequenceNumber(QuicDataReader* reader,
443 QuicPacketNumberLength packet_number_length, 443 QuicPacketNumberLength packet_number_length,
444 QuicPacketNumber last_packet_number, 444 QuicPacketNumber base_packet_number,
445 QuicPacketNumber* packet_number); 445 QuicPacketNumber* packet_number);
446 bool ProcessFrameData(QuicDataReader* reader, const QuicPacketHeader& header); 446 bool ProcessFrameData(QuicDataReader* reader, const QuicPacketHeader& header);
447 bool ProcessStreamFrame(QuicDataReader* reader, 447 bool ProcessStreamFrame(QuicDataReader* reader,
448 uint8_t frame_type, 448 uint8_t frame_type,
449 QuicStreamFrame* frame); 449 QuicStreamFrame* frame);
450 bool ProcessAckFrame(QuicDataReader* reader, 450 bool ProcessAckFrame(QuicDataReader* reader,
451 uint8_t frame_type, 451 uint8_t frame_type,
452 QuicAckFrame* frame); 452 QuicAckFrame* frame);
453 bool ProcessNewAckFrame(QuicDataReader* reader, 453 bool ProcessNewAckFrame(QuicDataReader* reader,
454 uint8_t frame_type, 454 uint8_t frame_type,
(...skipping 12 matching lines...) Expand all
467 bool ProcessPathCloseFrame(QuicDataReader* reader, QuicPathCloseFrame* frame); 467 bool ProcessPathCloseFrame(QuicDataReader* reader, QuicPathCloseFrame* frame);
468 468
469 bool DecryptPayload(QuicDataReader* encrypted_reader, 469 bool DecryptPayload(QuicDataReader* encrypted_reader,
470 const QuicPacketHeader& header, 470 const QuicPacketHeader& header,
471 const QuicEncryptedPacket& packet, 471 const QuicEncryptedPacket& packet,
472 char* decrypted_buffer, 472 char* decrypted_buffer,
473 size_t buffer_length, 473 size_t buffer_length,
474 size_t* decrypted_length); 474 size_t* decrypted_length);
475 475
476 // Checks if |path_id| is a viable path to receive packets on. Returns true 476 // Checks if |path_id| is a viable path to receive packets on. Returns true
477 // and sets |last_packet_number| if the path is not closed. Returns false 477 // and sets |base_packet_number| to the packet number to calculate the
478 // incoming packet number from if the path is not closed. Returns false
478 // otherwise. 479 // otherwise.
479 bool IsValidPath(QuicPathId path_id, QuicPacketNumber* last_packet_number); 480 bool IsValidPath(QuicPathId path_id, QuicPacketNumber* base_packet_number);
480 481
481 // Sets last_packet_number_. This can only be called after the packet is 482 // Sets last_packet_number_. This can only be called after the packet is
482 // successfully decrypted. 483 // successfully decrypted.
483 void SetLastPacketNumber(const QuicPacketHeader& header); 484 void SetLastPacketNumber(const QuicPacketHeader& header);
484 485
485 // Returns the full packet number from the truncated 486 // Returns the full packet number from the truncated
486 // wire format version and the last seen packet number. 487 // wire format version and the last seen packet number.
487 QuicPacketNumber CalculatePacketNumberFromWire( 488 QuicPacketNumber CalculatePacketNumberFromWire(
488 QuicPacketNumberLength packet_number_length, 489 QuicPacketNumberLength packet_number_length,
489 QuicPacketNumber last_packet_number, 490 QuicPacketNumber base_packet_number,
490 QuicPacketNumber packet_number) const; 491 QuicPacketNumber packet_number) const;
491 492
492 // Returns the QuicTime::Delta corresponding to the time from when the framer 493 // Returns the QuicTime::Delta corresponding to the time from when the framer
493 // was created. 494 // was created.
494 const QuicTime::Delta CalculateTimestampFromWire(uint32_t time_delta_us); 495 const QuicTime::Delta CalculateTimestampFromWire(uint32_t time_delta_us);
495 496
496 // Computes the wire size in bytes of time stamps in |ack|. 497 // Computes the wire size in bytes of time stamps in |ack|.
497 size_t GetAckFrameTimeStampSize(const QuicAckFrame& ack); 498 size_t GetAckFrameTimeStampSize(const QuicAckFrame& ack);
498 499
499 // Computes the wire size in bytes of the |ack| frame, assuming no truncation. 500 // Computes the wire size in bytes of the |ack| frame, assuming no truncation.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 QuicFramerVisitorInterface* visitor_; 563 QuicFramerVisitorInterface* visitor_;
563 QuicReceivedEntropyHashCalculatorInterface* entropy_calculator_; 564 QuicReceivedEntropyHashCalculatorInterface* entropy_calculator_;
564 QuicErrorCode error_; 565 QuicErrorCode error_;
565 // Set of closed paths. A path is considered as closed if a PATH_CLOSED frame 566 // Set of closed paths. A path is considered as closed if a PATH_CLOSED frame
566 // has been sent/received. 567 // has been sent/received.
567 // TODO(fayang): this set is never cleaned up. A possible improvement is to 568 // TODO(fayang): this set is never cleaned up. A possible improvement is to
568 // use intervals. 569 // use intervals.
569 std::unordered_set<QuicPathId> closed_paths_; 570 std::unordered_set<QuicPathId> closed_paths_;
570 // Map mapping path id to packet number of last successfully decrypted 571 // Map mapping path id to packet number of last successfully decrypted
571 // received packet. 572 // received packet.
573 // TODO(ianswett): Remove when
574 // gfe2_reloadable_flag_quic_packet_numbers_largest_received is deprecated.
572 std::unordered_map<QuicPathId, QuicPacketNumber> last_packet_numbers_; 575 std::unordered_map<QuicPathId, QuicPacketNumber> last_packet_numbers_;
573 // Updated by ProcessPacketHeader when it succeeds. 576 // Updated by ProcessPacketHeader when it succeeds.
574 QuicPacketNumber last_packet_number_; 577 QuicPacketNumber last_packet_number_;
578 // Map mapping path id to packet number of largest successfully decrypted
579 // received packet.
580 std::unordered_map<QuicPathId, QuicPacketNumber> largest_packet_numbers_;
581 // Updated by ProcessPacketHeader when it succeeds decrypting a larger packet.
582 QuicPacketNumber largest_packet_number_;
575 // The path on which last successfully decrypted packet was received. 583 // The path on which last successfully decrypted packet was received.
576 QuicPathId last_path_id_; 584 QuicPathId last_path_id_;
577 // Updated by WritePacketHeader. 585 // Updated by WritePacketHeader.
578 QuicConnectionId last_serialized_connection_id_; 586 QuicConnectionId last_serialized_connection_id_;
579 // The last QUIC version tag received. 587 // The last QUIC version tag received.
580 QuicTag last_version_tag_; 588 QuicTag last_version_tag_;
581 // Version of the protocol being used. 589 // Version of the protocol being used.
582 QuicVersion quic_version_; 590 QuicVersion quic_version_;
583 // This vector contains QUIC versions which we currently support. 591 // This vector contains QUIC versions which we currently support.
584 // This should be ordered such that the highest supported version is the first 592 // This should be ordered such that the highest supported version is the first
(...skipping 27 matching lines...) Expand all
612 QuicTime::Delta last_timestamp_; 620 QuicTime::Delta last_timestamp_;
613 // The diversification nonce from the last received packet. 621 // The diversification nonce from the last received packet.
614 DiversificationNonce last_nonce_; 622 DiversificationNonce last_nonce_;
615 623
616 DISALLOW_COPY_AND_ASSIGN(QuicFramer); 624 DISALLOW_COPY_AND_ASSIGN(QuicFramer);
617 }; 625 };
618 626
619 } // namespace net 627 } // namespace net
620 628
621 #endif // NET_QUIC_QUIC_FRAMER_H_ 629 #endif // NET_QUIC_QUIC_FRAMER_H_
OLDNEW
« no previous file with comments | « net/quic/core/quic_flags_list.h ('k') | net/quic/core/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698