OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
11 #include <string> | 11 #include <string> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 UserDataMap::const_iterator found = user_data_.find(key); | 89 UserDataMap::const_iterator found = user_data_.find(key); |
90 if (found != user_data_.end()) | 90 if (found != user_data_.end()) |
91 return found->second.get(); | 91 return found->second.get(); |
92 return NULL; | 92 return NULL; |
93 } | 93 } |
94 | 94 |
95 void SocketStream::SetUserData(const void* key, UserData* data) { | 95 void SocketStream::SetUserData(const void* key, UserData* data) { |
96 user_data_[key] = linked_ptr<UserData>(data); | 96 user_data_[key] = linked_ptr<UserData>(data); |
97 } | 97 } |
98 | 98 |
99 void SocketStream::set_context(URLRequestContext* context) { | 99 void SocketStream::set_context(net::URLRequestContext* context) { |
wtc
2011/01/15 17:54:23
Undo the changes in this file (already in the 'net
| |
100 scoped_refptr<URLRequestContext> prev_context = context_; | 100 scoped_refptr<net::URLRequestContext> prev_context = context_; |
101 | 101 |
102 context_ = context; | 102 context_ = context; |
103 | 103 |
104 if (prev_context != context) { | 104 if (prev_context != context) { |
105 if (prev_context && pac_request_) { | 105 if (prev_context && pac_request_) { |
106 prev_context->proxy_service()->CancelPacRequest(pac_request_); | 106 prev_context->proxy_service()->CancelPacRequest(pac_request_); |
107 pac_request_ = NULL; | 107 pac_request_ = NULL; |
108 } | 108 } |
109 | 109 |
110 net_log_.EndEvent(NetLog::TYPE_REQUEST_ALIVE, NULL); | 110 net_log_.EndEvent(NetLog::TYPE_REQUEST_ALIVE, NULL); |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1029 | 1029 |
1030 SSLConfigService* SocketStream::ssl_config_service() const { | 1030 SSLConfigService* SocketStream::ssl_config_service() const { |
1031 return context_->ssl_config_service(); | 1031 return context_->ssl_config_service(); |
1032 } | 1032 } |
1033 | 1033 |
1034 ProxyService* SocketStream::proxy_service() const { | 1034 ProxyService* SocketStream::proxy_service() const { |
1035 return context_->proxy_service(); | 1035 return context_->proxy_service(); |
1036 } | 1036 } |
1037 | 1037 |
1038 } // namespace net | 1038 } // namespace net |
OLD | NEW |