Chromium Code Reviews| 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_client.h" | 5 #include "net/tools/quic/quic_client.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <netinet/in.h> | 8 #include <netinet/in.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/epoll.h> | 10 #include <sys/epoll.h> |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 } else if (data_to_resend.get()) { | 456 } else if (data_to_resend.get()) { |
| 457 data_to_resend->Resend(); | 457 data_to_resend->Resend(); |
| 458 } | 458 } |
| 459 } | 459 } |
| 460 | 460 |
| 461 size_t QuicClient::latest_response_code() const { | 461 size_t QuicClient::latest_response_code() const { |
| 462 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 462 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 463 return latest_response_code_; | 463 return latest_response_code_; |
| 464 } | 464 } |
| 465 | 465 |
| 466 const string& QuicClient::latest_response_headers() const { | 466 const std::string& QuicClient::latest_response_headers() const { |
|
Ryan Hamilton
2016/05/13 20:27:09
Can we do using std::string instead?
Buck
2016/05/13 21:25:55
Done.
| |
| 467 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 467 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 468 return latest_response_headers_; | 468 return latest_response_headers_; |
| 469 } | 469 } |
| 470 | 470 |
| 471 const string& QuicClient::latest_response_body() const { | 471 const std::string& QuicClient::latest_response_body() const { |
| 472 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 472 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 473 return latest_response_body_; | 473 return latest_response_body_; |
| 474 } | 474 } |
| 475 | 475 |
| 476 const string& QuicClient::latest_response_trailers() const { | 476 const std::string& QuicClient::latest_response_trailers() const { |
| 477 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 477 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 478 return latest_response_trailers_; | 478 return latest_response_trailers_; |
| 479 } | 479 } |
| 480 | 480 |
| 481 QuicPacketWriter* QuicClient::CreateQuicPacketWriter() { | 481 QuicPacketWriter* QuicClient::CreateQuicPacketWriter() { |
| 482 return new QuicDefaultPacketWriter(GetLatestFD()); | 482 return new QuicDefaultPacketWriter(GetLatestFD()); |
| 483 } | 483 } |
| 484 | 484 |
| 485 const IPEndPoint QuicClient::GetLatestClientAddress() const { | 485 const IPEndPoint QuicClient::GetLatestClientAddress() const { |
| 486 if (fd_address_map_.empty()) { | 486 if (fd_address_map_.empty()) { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 498 return fd_address_map_.back().first; | 498 return fd_address_map_.back().first; |
| 499 } | 499 } |
| 500 | 500 |
| 501 void QuicClient::ProcessPacket(const IPEndPoint& self_address, | 501 void QuicClient::ProcessPacket(const IPEndPoint& self_address, |
| 502 const IPEndPoint& peer_address, | 502 const IPEndPoint& peer_address, |
| 503 const QuicReceivedPacket& packet) { | 503 const QuicReceivedPacket& packet) { |
| 504 session()->connection()->ProcessUdpPacket(self_address, peer_address, packet); | 504 session()->connection()->ProcessUdpPacket(self_address, peer_address, packet); |
| 505 } | 505 } |
| 506 | 506 |
| 507 } // namespace net | 507 } // namespace net |
| OLD | NEW |