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

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

Issue 1663703003: use std::unordered_map and std::unordered_set in QUIC code instead of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113259990
Patch Set: rebase 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_frame_list.cc ('k') | net/quic/quic_multipath_received_packet_manager.h » ('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
11 #include <string> 11 #include <string>
12 #include <unordered_map>
13 #include <unordered_set>
12 #include <vector> 14 #include <vector>
13 15
14 #include "base/logging.h" 16 #include "base/logging.h"
15 #include "base/macros.h" 17 #include "base/macros.h"
16 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
17 #include "base/strings/string_piece.h" 19 #include "base/strings/string_piece.h"
18 #include "net/base/net_export.h" 20 #include "net/base/net_export.h"
19 #include "net/quic/quic_protocol.h" 21 #include "net/quic/quic_protocol.h"
20 22
21 namespace net { 23 namespace net {
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 void set_detailed_error(const char* error) { detailed_error_ = error; } 518 void set_detailed_error(const char* error) { detailed_error_ = error; }
517 519
518 std::string detailed_error_; 520 std::string detailed_error_;
519 QuicFramerVisitorInterface* visitor_; 521 QuicFramerVisitorInterface* visitor_;
520 QuicReceivedEntropyHashCalculatorInterface* entropy_calculator_; 522 QuicReceivedEntropyHashCalculatorInterface* entropy_calculator_;
521 QuicErrorCode error_; 523 QuicErrorCode error_;
522 // Set of closed paths. A path is considered as closed if a PATH_CLOSED frame 524 // Set of closed paths. A path is considered as closed if a PATH_CLOSED frame
523 // has been sent/received. 525 // has been sent/received.
524 // TODO(fayang): this set is never cleaned up. A possible improvement is to 526 // TODO(fayang): this set is never cleaned up. A possible improvement is to
525 // use intervals. 527 // use intervals.
526 base::hash_set<QuicPathId> closed_paths_; 528 std::unordered_set<QuicPathId> closed_paths_;
527 // Map mapping path id to packet number of last successfully decrypted/revived 529 // Map mapping path id to packet number of last successfully decrypted/revived
528 // received packet. 530 // received packet.
529 base::hash_map<QuicPathId, QuicPacketNumber> last_packet_numbers_; 531 std::unordered_map<QuicPathId, QuicPacketNumber> last_packet_numbers_;
530 // Updated by ProcessPacketHeader when it succeeds. 532 // Updated by ProcessPacketHeader when it succeeds.
531 QuicPacketNumber last_packet_number_; 533 QuicPacketNumber last_packet_number_;
532 // The path on which last successfully decrypted/revived packet was received. 534 // The path on which last successfully decrypted/revived packet was received.
533 QuicPathId last_path_id_; 535 QuicPathId last_path_id_;
534 // Updated by WritePacketHeader. 536 // Updated by WritePacketHeader.
535 QuicConnectionId last_serialized_connection_id_; 537 QuicConnectionId last_serialized_connection_id_;
536 // Version of the protocol being used. 538 // Version of the protocol being used.
537 QuicVersion quic_version_; 539 QuicVersion quic_version_;
538 // This vector contains QUIC versions which we currently support. 540 // This vector contains QUIC versions which we currently support.
539 // This should be ordered such that the highest supported version is the first 541 // This should be ordered such that the highest supported version is the first
(...skipping 25 matching lines...) Expand all
565 // The time delta computed for the last timestamp frame. This is relative to 567 // The time delta computed for the last timestamp frame. This is relative to
566 // the creation_time. 568 // the creation_time.
567 QuicTime::Delta last_timestamp_; 569 QuicTime::Delta last_timestamp_;
568 570
569 DISALLOW_COPY_AND_ASSIGN(QuicFramer); 571 DISALLOW_COPY_AND_ASSIGN(QuicFramer);
570 }; 572 };
571 573
572 } // namespace net 574 } // namespace net
573 575
574 #endif // NET_QUIC_QUIC_FRAMER_H_ 576 #endif // NET_QUIC_QUIC_FRAMER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_frame_list.cc ('k') | net/quic/quic_multipath_received_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698