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

Side by Side Diff: net/quic/quic_packet_reader.cc

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Naming fixes. Created 5 years 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/quic_packet_reader.h" 5 #include "net/quic/quic_packet_reader.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 OnReadComplete(rv); 66 OnReadComplete(rv);
67 } 67 }
68 } 68 }
69 69
70 void QuicPacketReader::OnReadComplete(int result) { 70 void QuicPacketReader::OnReadComplete(int result) {
71 read_pending_ = false; 71 read_pending_ = false;
72 if (result == 0) 72 if (result == 0)
73 result = ERR_CONNECTION_CLOSED; 73 result = ERR_CONNECTION_CLOSED;
74 74
75 if (result < 0) { 75 if (result < 0) {
76 visitor_->OnReadError(result); 76 visitor_->OnReadError(result, socket_);
77 return; 77 return;
78 } 78 }
79 79
80 QuicEncryptedPacket packet(read_buffer_->data(), result); 80 QuicEncryptedPacket packet(read_buffer_->data(), result);
81 IPEndPoint local_address; 81 IPEndPoint local_address;
82 IPEndPoint peer_address; 82 IPEndPoint peer_address;
83 socket_->GetLocalAddress(&local_address); 83 socket_->GetLocalAddress(&local_address);
84 socket_->GetPeerAddress(&peer_address); 84 socket_->GetPeerAddress(&peer_address);
85 if (!visitor_->OnPacket(packet, local_address, peer_address)) 85 if (!visitor_->OnPacket(packet, local_address, peer_address))
86 return; 86 return;
87 87
88 StartReading(); 88 StartReading();
89 } 89 }
90 90
91 } // namespace net 91 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698