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

Side by Side Diff: net/spdy/spdy_http_stream.cc

Issue 6488010: Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "net/base/address_list.h"
13 #include "net/base/load_flags.h" 14 #include "net/base/load_flags.h"
14 #include "net/base/net_util.h" 15 #include "net/base/net_util.h"
15 #include "net/http/http_request_headers.h" 16 #include "net/http/http_request_headers.h"
16 #include "net/http/http_request_info.h" 17 #include "net/http/http_request_info.h"
17 #include "net/http/http_response_info.h" 18 #include "net/http/http_response_info.h"
18 #include "net/http/http_util.h" 19 #include "net/http/http_util.h"
19 #include "net/spdy/spdy_http_utils.h" 20 #include "net/spdy/spdy_http_utils.h"
20 #include "net/spdy/spdy_session.h" 21 #include "net/spdy/spdy_session.h"
21 22
22 namespace net { 23 namespace net {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // pushed. 224 // pushed.
224 if (push_response_info_.get()) { 225 if (push_response_info_.get()) {
225 *response = *(push_response_info_.get()); 226 *response = *(push_response_info_.get());
226 push_response_info_.reset(); 227 push_response_info_.reset();
227 } 228 }
228 else 229 else
229 DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_); 230 DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_);
230 231
231 response_info_ = response; 232 response_info_ = response;
232 233
234 // Put the peer's ip:port into the response, for inquisitive users.
235 AddressList address;
236 if (stream_->GetPeerAddress(&address) == OK) {
237 response_info_->socket_address =
238 NetAddressToStringWithPort(address.head());
239 } else {
240 response_info_->socket_address.clear();
241 }
242
233 bool has_upload_data = request_body_stream_.get() != NULL; 243 bool has_upload_data = request_body_stream_.get() != NULL;
234 int result = stream_->SendRequest(has_upload_data); 244 int result = stream_->SendRequest(has_upload_data);
235 if (result == ERR_IO_PENDING) { 245 if (result == ERR_IO_PENDING) {
236 CHECK(!user_callback_); 246 CHECK(!user_callback_);
237 user_callback_ = callback; 247 user_callback_ = callback;
238 } 248 }
239 return result; 249 return result;
240 } 250 }
241 251
242 void SpdyHttpStream::Cancel() { 252 void SpdyHttpStream::Cancel() {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 stream_->GetSSLInfo(ssl_info, &using_npn); 437 stream_->GetSSLInfo(ssl_info, &using_npn);
428 } 438 }
429 439
430 void SpdyHttpStream::GetSSLCertRequestInfo( 440 void SpdyHttpStream::GetSSLCertRequestInfo(
431 SSLCertRequestInfo* cert_request_info) { 441 SSLCertRequestInfo* cert_request_info) {
432 DCHECK(stream_); 442 DCHECK(stream_);
433 stream_->GetSSLCertRequestInfo(cert_request_info); 443 stream_->GetSSLCertRequestInfo(cert_request_info);
434 } 444 }
435 445
436 } // namespace net 446 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698