Skip to content

Commit

Permalink
Move WeakPtrFactory to the end of the member list. (#4397)
Browse files Browse the repository at this point in the history
An example in base/memory/weak_ptr.h has a comment that "Member
variables should appear before the
WeakPtrFactory".

This makes that suggested change.

b/377972778
  • Loading branch information
jellefoks authored Nov 8, 2024
1 parent 4342c69 commit 87f2a2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/quic/quic_chromium_packet_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ class NET_EXPORT_PRIVATE QuicChromiumPacketReader {
scoped_refptr<IOBufferWithSize> read_buffer_;
NetLogWithSource net_log_;

base::WeakPtrFactory<QuicChromiumPacketReader> weak_factory_{this};

#if defined(STARBOARD)
// Static flag to remember when ReadMultiplePackets has ever returned
// ERR_NOT_IMPLEMENTED
Expand All @@ -93,6 +91,9 @@ class NET_EXPORT_PRIVATE QuicChromiumPacketReader {
// Results from ReadMultiplePackets.
Socket::ReadPacketResults read_results_;
#endif

// Note: This has to remain the last member of the class.
base::WeakPtrFactory<QuicChromiumPacketReader> weak_factory_{this};
};

} // namespace net
Expand Down

0 comments on commit 87f2a2c

Please sign in to comment.