| 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 24 matching lines...) Expand all Loading... |
| 35 #include "net/socket/ssl_client_socket.h" | 35 #include "net/socket/ssl_client_socket.h" |
| 36 #include "net/socket/ssl_client_socket_pool.h" | 36 #include "net/socket/ssl_client_socket_pool.h" |
| 37 #include "net/spdy/spdy_http_stream.h" | 37 #include "net/spdy/spdy_http_stream.h" |
| 38 #include "net/spdy/spdy_session.h" | 38 #include "net/spdy/spdy_session.h" |
| 39 #include "net/spdy/spdy_session_pool.h" | 39 #include "net/spdy/spdy_session_pool.h" |
| 40 #include "net/ssl/ssl_cert_request_info.h" | 40 #include "net/ssl/ssl_cert_request_info.h" |
| 41 | 41 |
| 42 namespace net { | 42 namespace net { |
| 43 | 43 |
| 44 // Returns parameters associated with the start of a HTTP stream job. | 44 // Returns parameters associated with the start of a HTTP stream job. |
| 45 Value* NetLogHttpStreamJobCallback(const GURL* original_url, | 45 base::Value* NetLogHttpStreamJobCallback(const GURL* original_url, |
| 46 const GURL* url, | 46 const GURL* url, |
| 47 RequestPriority priority, | 47 RequestPriority priority, |
| 48 NetLog::LogLevel /* log_level */) { | 48 NetLog::LogLevel /* log_level */) { |
| 49 DictionaryValue* dict = new DictionaryValue(); | 49 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 50 dict->SetString("original_url", original_url->GetOrigin().spec()); | 50 dict->SetString("original_url", original_url->GetOrigin().spec()); |
| 51 dict->SetString("url", url->GetOrigin().spec()); | 51 dict->SetString("url", url->GetOrigin().spec()); |
| 52 dict->SetInteger("priority", priority); | 52 dict->SetInteger("priority", priority); |
| 53 return dict; | 53 return dict; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Returns parameters associated with the Proto (with NPN negotiation) of a HTTP | 56 // Returns parameters associated with the Proto (with NPN negotiation) of a HTTP |
| 57 // stream. | 57 // stream. |
| 58 Value* NetLogHttpStreamProtoCallback( | 58 base::Value* NetLogHttpStreamProtoCallback( |
| 59 const SSLClientSocket::NextProtoStatus status, | 59 const SSLClientSocket::NextProtoStatus status, |
| 60 const std::string* proto, | 60 const std::string* proto, |
| 61 const std::string* server_protos, | 61 const std::string* server_protos, |
| 62 NetLog::LogLevel /* log_level */) { | 62 NetLog::LogLevel /* log_level */) { |
| 63 DictionaryValue* dict = new DictionaryValue(); | 63 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 64 | 64 |
| 65 dict->SetString("next_proto_status", | 65 dict->SetString("next_proto_status", |
| 66 SSLClientSocket::NextProtoStatusToString(status)); | 66 SSLClientSocket::NextProtoStatusToString(status)); |
| 67 dict->SetString("proto", *proto); | 67 dict->SetString("proto", *proto); |
| 68 dict->SetString("server_protos", | 68 dict->SetString("server_protos", |
| 69 SSLClientSocket::ServerProtosToString(*server_protos)); | 69 SSLClientSocket::ServerProtosToString(*server_protos)); |
| 70 return dict; | 70 return dict; |
| 71 } | 71 } |
| 72 | 72 |
| 73 HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory, | 73 HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory, |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1375 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | | 1375 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | |
| 1376 net::LOAD_IS_DOWNLOAD)) { | 1376 net::LOAD_IS_DOWNLOAD)) { |
| 1377 // Avoid pipelining resources that may be streamed for a long time. | 1377 // Avoid pipelining resources that may be streamed for a long time. |
| 1378 return false; | 1378 return false; |
| 1379 } | 1379 } |
| 1380 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1380 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
| 1381 *http_pipelining_key_.get()); | 1381 *http_pipelining_key_.get()); |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 } // namespace net | 1384 } // namespace net |
| OLD | NEW |