| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "net/socket/ssl_client_socket_pool.h" | 38 #include "net/socket/ssl_client_socket_pool.h" |
| 39 #include "net/spdy/spdy_http_stream.h" | 39 #include "net/spdy/spdy_http_stream.h" |
| 40 #include "net/spdy/spdy_session.h" | 40 #include "net/spdy/spdy_session.h" |
| 41 #include "net/spdy/spdy_session_pool.h" | 41 #include "net/spdy/spdy_session_pool.h" |
| 42 #include "net/ssl/ssl_cert_request_info.h" | 42 #include "net/ssl/ssl_cert_request_info.h" |
| 43 #include "net/ssl/ssl_failure_state.h" | 43 #include "net/ssl/ssl_failure_state.h" |
| 44 | 44 |
| 45 namespace net { | 45 namespace net { |
| 46 | 46 |
| 47 // Returns parameters associated with the start of a HTTP stream job. | 47 // Returns parameters associated with the start of a HTTP stream job. |
| 48 base::Value* NetLogHttpStreamJobCallback( | 48 scoped_ptr<base::Value> NetLogHttpStreamJobCallback( |
| 49 const GURL* original_url, | 49 const GURL* original_url, |
| 50 const GURL* url, | 50 const GURL* url, |
| 51 const AlternativeService* alternative_service, | 51 const AlternativeService* alternative_service, |
| 52 RequestPriority priority, | 52 RequestPriority priority, |
| 53 NetLogCaptureMode /* capture_mode */) { | 53 NetLogCaptureMode /* capture_mode */) { |
| 54 base::DictionaryValue* dict = new base::DictionaryValue(); | 54 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 55 dict->SetString("original_url", original_url->GetOrigin().spec()); | 55 dict->SetString("original_url", original_url->GetOrigin().spec()); |
| 56 dict->SetString("url", url->GetOrigin().spec()); | 56 dict->SetString("url", url->GetOrigin().spec()); |
| 57 dict->SetString("alternative_service", alternative_service->ToString()); | 57 dict->SetString("alternative_service", alternative_service->ToString()); |
| 58 dict->SetString("priority", RequestPriorityToString(priority)); | 58 dict->SetString("priority", RequestPriorityToString(priority)); |
| 59 return dict; | 59 return dict.Pass(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Returns parameters associated with the Proto (with NPN negotiation) of a HTTP | 62 // Returns parameters associated with the Proto (with NPN negotiation) of a HTTP |
| 63 // stream. | 63 // stream. |
| 64 base::Value* NetLogHttpStreamProtoCallback( | 64 scoped_ptr<base::Value> NetLogHttpStreamProtoCallback( |
| 65 const SSLClientSocket::NextProtoStatus status, | 65 const SSLClientSocket::NextProtoStatus status, |
| 66 const std::string* proto, | 66 const std::string* proto, |
| 67 NetLogCaptureMode /* capture_mode */) { | 67 NetLogCaptureMode /* capture_mode */) { |
| 68 base::DictionaryValue* dict = new base::DictionaryValue(); | 68 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 69 | 69 |
| 70 dict->SetString("next_proto_status", | 70 dict->SetString("next_proto_status", |
| 71 SSLClientSocket::NextProtoStatusToString(status)); | 71 SSLClientSocket::NextProtoStatusToString(status)); |
| 72 dict->SetString("proto", *proto); | 72 dict->SetString("proto", *proto); |
| 73 return dict; | 73 return dict.Pass(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory, | 76 HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory, |
| 77 HttpNetworkSession* session, | 77 HttpNetworkSession* session, |
| 78 const HttpRequestInfo& request_info, | 78 const HttpRequestInfo& request_info, |
| 79 RequestPriority priority, | 79 RequestPriority priority, |
| 80 const SSLConfig& server_ssl_config, | 80 const SSLConfig& server_ssl_config, |
| 81 const SSLConfig& proxy_ssl_config, | 81 const SSLConfig& proxy_ssl_config, |
| 82 NetLog* net_log) | 82 NetLog* net_log) |
| 83 : request_(NULL), | 83 : request_(NULL), |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 if (connection_->socket()) { | 1543 if (connection_->socket()) { |
| 1544 ConnectionAttempts socket_attempts; | 1544 ConnectionAttempts socket_attempts; |
| 1545 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1545 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1546 request_->AddConnectionAttempts(socket_attempts); | 1546 request_->AddConnectionAttempts(socket_attempts); |
| 1547 } else { | 1547 } else { |
| 1548 request_->AddConnectionAttempts(connection_->connection_attempts()); | 1548 request_->AddConnectionAttempts(connection_->connection_attempts()); |
| 1549 } | 1549 } |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 } // namespace net | 1552 } // namespace net |
| OLD | NEW |