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 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
7 | 7 |
8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 void SocketStream::SetUserData(const void* key, UserData* data) { | 96 void SocketStream::SetUserData(const void* key, UserData* data) { |
97 user_data_[key] = linked_ptr<UserData>(data); | 97 user_data_[key] = linked_ptr<UserData>(data); |
98 } | 98 } |
99 | 99 |
100 bool SocketStream::is_secure() const { | 100 bool SocketStream::is_secure() const { |
101 return url_.SchemeIs("wss"); | 101 return url_.SchemeIs("wss"); |
102 } | 102 } |
103 | 103 |
104 void SocketStream::set_context(URLRequestContext* context) { | 104 void SocketStream::set_context(const URLRequestContext* context) { |
105 scoped_refptr<URLRequestContext> prev_context = context_; | 105 const URLRequestContext* prev_context = context_; |
106 | 106 |
107 context_ = context; | 107 context_ = context; |
108 | 108 |
109 if (prev_context != context) { | 109 if (prev_context != context) { |
110 if (prev_context && pac_request_) { | 110 if (prev_context && pac_request_) { |
111 prev_context->proxy_service()->CancelPacRequest(pac_request_); | 111 prev_context->proxy_service()->CancelPacRequest(pac_request_); |
112 pac_request_ = NULL; | 112 pac_request_ = NULL; |
113 } | 113 } |
114 | 114 |
115 net_log_.EndEvent(NetLog::TYPE_REQUEST_ALIVE, NULL); | 115 net_log_.EndEvent(NetLog::TYPE_REQUEST_ALIVE, NULL); |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 | 1216 |
1217 SSLConfigService* SocketStream::ssl_config_service() const { | 1217 SSLConfigService* SocketStream::ssl_config_service() const { |
1218 return context_->ssl_config_service(); | 1218 return context_->ssl_config_service(); |
1219 } | 1219 } |
1220 | 1220 |
1221 ProxyService* SocketStream::proxy_service() const { | 1221 ProxyService* SocketStream::proxy_service() const { |
1222 return context_->proxy_service(); | 1222 return context_->proxy_service(); |
1223 } | 1223 } |
1224 | 1224 |
1225 } // namespace net | 1225 } // namespace net |
OLD | NEW |