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

Side by Side Diff: net/quic/chromium/quic_chromium_client_session.cc

Issue 2874333002: Construct QuicSocketAddressImpl in QuicChromiumPacketReadder and pass it by const&. (Closed)
Patch Set: Created 3 years, 7 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
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/chromium/quic_chromium_client_session.h" 5 #include "net/quic/chromium/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 // Ignore read errors from old sockets that are no longer active. 1579 // Ignore read errors from old sockets that are no longer active.
1580 // TODO(jri): Maybe clean up old sockets on error. 1580 // TODO(jri): Maybe clean up old sockets on error.
1581 return; 1581 return;
1582 } 1582 }
1583 DVLOG(1) << "Closing session on read error: " << result; 1583 DVLOG(1) << "Closing session on read error: " << result;
1584 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.ReadError", -result); 1584 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.ReadError", -result);
1585 connection()->CloseConnection(QUIC_PACKET_READ_ERROR, ErrorToString(result), 1585 connection()->CloseConnection(QUIC_PACKET_READ_ERROR, ErrorToString(result),
1586 ConnectionCloseBehavior::SILENT_CLOSE); 1586 ConnectionCloseBehavior::SILENT_CLOSE);
1587 } 1587 }
1588 1588
1589 bool QuicChromiumClientSession::OnPacket(const QuicReceivedPacket& packet, 1589 bool QuicChromiumClientSession::OnPacket(
1590 const IPEndPoint& local_address, 1590 const QuicReceivedPacket& packet,
1591 const IPEndPoint& peer_address) { 1591 const QuicSocketAddress& local_address,
1592 ProcessUdpPacket(QuicSocketAddress(QuicSocketAddressImpl(local_address)), 1592 const QuicSocketAddress& peer_address) {
1593 QuicSocketAddress(QuicSocketAddressImpl(peer_address)), 1593 ProcessUdpPacket(local_address, peer_address, packet);
1594 packet);
1595 if (!connection()->connected()) { 1594 if (!connection()->connected()) {
1596 NotifyFactoryOfSessionClosedLater(); 1595 NotifyFactoryOfSessionClosedLater();
1597 return false; 1596 return false;
1598 } 1597 }
1599 return true; 1598 return true;
1600 } 1599 }
1601 1600
1602 void QuicChromiumClientSession::NotifyFactoryOfSessionGoingAway() { 1601 void QuicChromiumClientSession::NotifyFactoryOfSessionGoingAway() {
1603 going_away_ = true; 1602 going_away_ = true;
1604 if (stream_factory_) 1603 if (stream_factory_)
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 } 1756 }
1758 1757
1759 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { 1758 size_t QuicChromiumClientSession::EstimateMemoryUsage() const {
1760 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's 1759 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's
1761 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and 1760 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and
1762 // unacked packet map. 1761 // unacked packet map.
1763 return base::trace_event::EstimateMemoryUsage(packet_readers_); 1762 return base::trace_event::EstimateMemoryUsage(packet_readers_);
1764 } 1763 }
1765 1764
1766 } // namespace net 1765 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.h ('k') | net/quic/chromium/quic_chromium_packet_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698