| OLD | NEW |
| 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/tools/quic/quic_simple_client.h" | 5 #include "net/tools/quic/quic_simple_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 rc = socket->GetLocalAddress(&client_address_); | 141 rc = socket->GetLocalAddress(&client_address_); |
| 142 if (rc != OK) { | 142 if (rc != OK) { |
| 143 LOG(ERROR) << "GetLocalAddress failed: " << ErrorToShortString(rc); | 143 LOG(ERROR) << "GetLocalAddress failed: " << ErrorToShortString(rc); |
| 144 return false; | 144 return false; |
| 145 } | 145 } |
| 146 | 146 |
| 147 socket_.swap(socket); | 147 socket_.swap(socket); |
| 148 packet_reader_.reset(new QuicChromiumPacketReader( | 148 packet_reader_.reset(new QuicChromiumPacketReader( |
| 149 socket_.get(), &clock_, this, kQuicYieldAfterPacketsRead, | 149 socket_.get(), &clock_, this, kQuicYieldAfterPacketsRead, |
| 150 QuicTime::Delta::FromMilliseconds(kQuicYieldAfterDurationMilliseconds), | 150 QuicTime::Delta::FromMilliseconds(kQuicYieldAfterDurationMilliseconds), |
| 151 BoundNetLog())); | 151 NetLogWithSource())); |
| 152 | 152 |
| 153 if (socket != nullptr) { | 153 if (socket != nullptr) { |
| 154 socket->Close(); | 154 socket->Close(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 return true; | 157 return true; |
| 158 } | 158 } |
| 159 | 159 |
| 160 void QuicSimpleClient::StartPacketReaderIfNotStarted() { | 160 void QuicSimpleClient::StartPacketReaderIfNotStarted() { |
| 161 if (!packet_reader_started_) { | 161 if (!packet_reader_started_) { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 session()->connection()->ProcessUdpPacket(local_address, peer_address, | 408 session()->connection()->ProcessUdpPacket(local_address, peer_address, |
| 409 packet); | 409 packet); |
| 410 if (!session()->connection()->connected()) { | 410 if (!session()->connection()->connected()) { |
| 411 return false; | 411 return false; |
| 412 } | 412 } |
| 413 | 413 |
| 414 return true; | 414 return true; |
| 415 } | 415 } |
| 416 | 416 |
| 417 } // namespace net | 417 } // namespace net |
| OLD | NEW |