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 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | |
16 #include "net/base/address_list.h" | 15 #include "net/base/address_list.h" |
17 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
18 #include "net/base/io_buffer.h" | 17 #include "net/base/io_buffer.h" |
19 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
20 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
21 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
22 #include "net/base/privacy_mode.h" | 21 #include "net/base/privacy_mode.h" |
23 #include "net/proxy/proxy_service.h" | 22 #include "net/proxy/proxy_service.h" |
24 #include "net/ssl/ssl_config_service.h" | 23 #include "net/ssl/ssl_config_service.h" |
25 #include "net/url_request/url_request.h" | 24 #include "net/url_request/url_request.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // delete the object if it is changed or the job is destroyed. | 122 // delete the object if it is changed or the job is destroyed. |
124 UserData* GetUserData(const void* key) const; | 123 UserData* GetUserData(const void* key) const; |
125 void SetUserData(const void* key, UserData* data); | 124 void SetUserData(const void* key, UserData* data); |
126 | 125 |
127 const GURL& url() const { return url_; } | 126 const GURL& url() const { return url_; } |
128 bool is_secure() const; | 127 bool is_secure() const; |
129 const AddressList& address_list() const { return addresses_; } | 128 const AddressList& address_list() const { return addresses_; } |
130 Delegate* delegate() const { return delegate_; } | 129 Delegate* delegate() const { return delegate_; } |
131 int max_pending_send_allowed() const { return max_pending_send_allowed_; } | 130 int max_pending_send_allowed() const { return max_pending_send_allowed_; } |
132 | 131 |
133 URLRequestContext* context() { return context_.get(); } | 132 URLRequestContext* context() { return context_; } |
134 // There're some asynchronous operations and members that are constructed from | 133 // There're some asynchronous operations and members that are constructed from |
135 // |context|. Be careful when you use this for the second time or more. | 134 // |context|. Be careful when you use this for the second time or more. |
136 void set_context(URLRequestContext* context); | 135 void set_context(URLRequestContext* context); |
137 | 136 |
138 const SSLConfig& server_ssl_config() const { return server_ssl_config_; } | 137 const SSLConfig& server_ssl_config() const { return server_ssl_config_; } |
139 PrivacyMode privacy_mode() const { return privacy_mode_; } | 138 PrivacyMode privacy_mode() const { return privacy_mode_; } |
140 void CheckPrivacyMode(); | 139 void CheckPrivacyMode(); |
141 | 140 |
142 BoundNetLog* net_log() { return &net_log_; } | 141 BoundNetLog* net_log() { return &net_log_; } |
143 | 142 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 334 |
336 BoundNetLog net_log_; | 335 BoundNetLog net_log_; |
337 | 336 |
338 GURL url_; | 337 GURL url_; |
339 // The number of bytes allowed to be buffered in this object. If the size of | 338 // The number of bytes allowed to be buffered in this object. If the size of |
340 // buffered data which is | 339 // buffered data which is |
341 // current_write_buf_.BytesRemaining() + | 340 // current_write_buf_.BytesRemaining() + |
342 // sum of the size of buffers in |pending_write_bufs_| | 341 // sum of the size of buffers in |pending_write_bufs_| |
343 // exceeds this limit, SendData() fails. | 342 // exceeds this limit, SendData() fails. |
344 int max_pending_send_allowed_; | 343 int max_pending_send_allowed_; |
345 base::WeakPtr<URLRequestContext> context_; | 344 URLRequestContext* context_; |
346 | 345 |
347 UserDataMap user_data_; | 346 UserDataMap user_data_; |
348 | 347 |
349 State next_state_; | 348 State next_state_; |
350 ClientSocketFactory* factory_; | 349 ClientSocketFactory* factory_; |
351 | 350 |
352 ProxyMode proxy_mode_; | 351 ProxyMode proxy_mode_; |
353 | 352 |
354 GURL proxy_url_; | 353 GURL proxy_url_; |
355 ProxyService::PacRequest* pac_request_; | 354 ProxyService::PacRequest* pac_request_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 bool server_closed_; | 386 bool server_closed_; |
388 | 387 |
389 scoped_ptr<SocketStreamMetrics> metrics_; | 388 scoped_ptr<SocketStreamMetrics> metrics_; |
390 | 389 |
391 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 390 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
392 }; | 391 }; |
393 | 392 |
394 } // namespace net | 393 } // namespace net |
395 | 394 |
396 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 395 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
OLD | NEW |