| 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/http/http_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class HttpStreamJobParameters : public NetLog::EventParameters { | 44 class HttpStreamJobParameters : public NetLog::EventParameters { |
| 45 public: | 45 public: |
| 46 static scoped_refptr<HttpStreamJobParameters> Create( | 46 static scoped_refptr<HttpStreamJobParameters> Create( |
| 47 const GURL& original_url, | 47 const GURL& original_url, |
| 48 const GURL& url) { | 48 const GURL& url) { |
| 49 return make_scoped_refptr(new HttpStreamJobParameters(original_url, url)); | 49 return make_scoped_refptr(new HttpStreamJobParameters(original_url, url)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual Value* ToValue() const; | 52 virtual Value* ToValue() const; |
| 53 | 53 |
| 54 protected: |
| 55 virtual ~HttpStreamJobParameters() {} |
| 56 |
| 54 private: | 57 private: |
| 55 HttpStreamJobParameters(const GURL& original_url, const GURL& url) | 58 HttpStreamJobParameters(const GURL& original_url, const GURL& url) |
| 56 : original_url_(original_url.GetOrigin().spec()), | 59 : original_url_(original_url.GetOrigin().spec()), |
| 57 url_(url.GetOrigin().spec()) {} | 60 url_(url.GetOrigin().spec()) { |
| 61 } |
| 58 | 62 |
| 59 const std::string original_url_; | 63 const std::string original_url_; |
| 60 const std::string url_; | 64 const std::string url_; |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 Value* HttpStreamJobParameters::ToValue() const { | 67 Value* HttpStreamJobParameters::ToValue() const { |
| 64 DictionaryValue* dict = new DictionaryValue(); | 68 DictionaryValue* dict = new DictionaryValue(); |
| 65 dict->SetString("original_url", original_url_); | 69 dict->SetString("original_url", original_url_); |
| 66 dict->SetString("url", url_); | 70 dict->SetString("url", url_); |
| 67 return dict; | 71 return dict; |
| 68 } | 72 } |
| 69 | 73 |
| 70 // Parameters associated with the Proto (with NPN negotiation) of a HTTP stream. | 74 // Parameters associated with the Proto (with NPN negotiation) of a HTTP stream. |
| 71 class HttpStreamProtoParameters : public NetLog::EventParameters { | 75 class HttpStreamProtoParameters : public NetLog::EventParameters { |
| 72 public: | 76 public: |
| 73 static scoped_refptr<HttpStreamProtoParameters> Create( | 77 static scoped_refptr<HttpStreamProtoParameters> Create( |
| 74 const SSLClientSocket::NextProtoStatus status, | 78 const SSLClientSocket::NextProtoStatus status, |
| 75 const std::string& proto, | 79 const std::string& proto, |
| 76 const std::string& server_protos) { | 80 const std::string& server_protos) { |
| 77 return make_scoped_refptr(new HttpStreamProtoParameters( | 81 return make_scoped_refptr(new HttpStreamProtoParameters( |
| 78 status, proto, server_protos)); | 82 status, proto, server_protos)); |
| 79 } | 83 } |
| 80 | 84 |
| 81 virtual Value* ToValue() const; | 85 virtual Value* ToValue() const; |
| 82 | 86 |
| 87 protected: |
| 88 virtual ~HttpStreamProtoParameters() {} |
| 89 |
| 83 private: | 90 private: |
| 84 HttpStreamProtoParameters(const SSLClientSocket::NextProtoStatus status, | 91 HttpStreamProtoParameters(const SSLClientSocket::NextProtoStatus status, |
| 85 const std::string& proto, | 92 const std::string& proto, |
| 86 const std::string& server_protos) | 93 const std::string& server_protos) |
| 87 : status_(status), | 94 : status_(status), |
| 88 proto_(proto), | 95 proto_(proto), |
| 89 server_protos_(server_protos) {} | 96 server_protos_(server_protos) { |
| 97 } |
| 90 | 98 |
| 91 const SSLClientSocket::NextProtoStatus status_; | 99 const SSLClientSocket::NextProtoStatus status_; |
| 92 const std::string proto_; | 100 const std::string proto_; |
| 93 const std::string server_protos_; | 101 const std::string server_protos_; |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 Value* HttpStreamProtoParameters::ToValue() const { | 104 Value* HttpStreamProtoParameters::ToValue() const { |
| 97 DictionaryValue* dict = new DictionaryValue(); | 105 DictionaryValue* dict = new DictionaryValue(); |
| 98 | 106 |
| 99 dict->SetString("next_proto_status", | 107 dict->SetString("next_proto_status", |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 return false; | 1245 return false; |
| 1238 } | 1246 } |
| 1239 if (request_info_.method != "GET" && request_info_.method != "HEAD") { | 1247 if (request_info_.method != "GET" && request_info_.method != "HEAD") { |
| 1240 return false; | 1248 return false; |
| 1241 } | 1249 } |
| 1242 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1250 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
| 1243 *http_pipelining_key_.get()); | 1251 *http_pipelining_key_.get()); |
| 1244 } | 1252 } |
| 1245 | 1253 |
| 1246 } // namespace net | 1254 } // namespace net |
| OLD | NEW |