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/quic/quic_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 HttpResponseInfo* response, | 104 HttpResponseInfo* response, |
105 const CompletionCallback& callback) { | 105 const CompletionCallback& callback) { |
106 CHECK(!request_body_stream_); | 106 CHECK(!request_body_stream_); |
107 CHECK(!response_info_); | 107 CHECK(!response_info_); |
108 CHECK(!callback.is_null()); | 108 CHECK(!callback.is_null()); |
109 CHECK(response); | 109 CHECK(response); |
110 | 110 |
111 // TODO(rch): remove this once we figure out why channel ID is not being | 111 // TODO(rch): remove this once we figure out why channel ID is not being |
112 // sent when it should be. | 112 // sent when it should be. |
113 HostPortPair origin = HostPortPair::FromURL(request_info_->url); | 113 HostPortPair origin = HostPortPair::FromURL(request_info_->url); |
114 if (origin.Equals(HostPortPair("accounts.google.com", 443))) { | 114 if (origin.Equals(HostPortPair("accounts.google.com", 443)) && |
| 115 request_headers.HasHeader(HttpRequestHeaders::kCookie)) { |
115 SSLInfo ssl_info; | 116 SSLInfo ssl_info; |
116 bool secure_session = | 117 bool secure_session = |
117 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); | 118 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get(); |
118 DCHECK(secure_session); | 119 DCHECK(secure_session); |
119 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.CookieSentToAccountsOverChannelId", | 120 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.CookieSentToAccountsOverChannelId", |
120 ssl_info.channel_id_sent); | 121 ssl_info.channel_id_sent); |
121 } | 122 } |
122 if (!stream_) { | 123 if (!stream_) { |
123 return ERR_CONNECTION_CLOSED; | 124 return ERR_CONNECTION_CLOSED; |
124 } | 125 } |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 568 |
568 void QuicHttpStream::BufferResponseBody(const char* data, int length) { | 569 void QuicHttpStream::BufferResponseBody(const char* data, int length) { |
569 if (length == 0) | 570 if (length == 0) |
570 return; | 571 return; |
571 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); | 572 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); |
572 memcpy(io_buffer->data(), data, length); | 573 memcpy(io_buffer->data(), data, length); |
573 response_body_.push_back(make_scoped_refptr(io_buffer)); | 574 response_body_.push_back(make_scoped_refptr(io_buffer)); |
574 } | 575 } |
575 | 576 |
576 } // namespace net | 577 } // namespace net |
OLD | NEW |