Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: net/socket/client_socket_handle.h

Issue 18796003: When an idle socket is added back to a socket pool, check for stalled jobs in lower pools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CLIENT_SOCKET_HANDLE_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_HANDLE_H_
6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Disconnect method. This will result in the ClientSocketPool deleting the 87 // Disconnect method. This will result in the ClientSocketPool deleting the
88 // StreamSocket. 88 // StreamSocket.
89 void Reset(); 89 void Reset();
90 90
91 // Used after Init() is called, but before the ClientSocketPool has 91 // Used after Init() is called, but before the ClientSocketPool has
92 // initialized the ClientSocketHandle. 92 // initialized the ClientSocketHandle.
93 LoadState GetLoadState() const; 93 LoadState GetLoadState() const;
94 94
95 bool IsPoolStalled() const; 95 bool IsPoolStalled() const;
96 96
97 void AddLayeredPool(LayeredPool* layered_pool); 97 void AddHigherLayeredPool(HigherLayeredPool* higher_pool);
98 98
99 void RemoveLayeredPool(LayeredPool* layered_pool); 99 void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool);
100 100
101 // Returns true when Init() has completed successfully. 101 // Returns true when Init() has completed successfully.
102 bool is_initialized() const { return is_initialized_; } 102 bool is_initialized() const { return is_initialized_; }
103 103
104 // Returns the time tick when Init() was called. 104 // Returns the time tick when Init() was called.
105 base::TimeTicks init_time() const { return init_time_; } 105 base::TimeTicks init_time() const { return init_time_; }
106 106
107 // Returns the time between Init() and when is_initialized() becomes true. 107 // Returns the time between Init() and when is_initialized() becomes true.
108 base::TimeDelta setup_time() const { return setup_time_; } 108 base::TimeDelta setup_time() const { return setup_time_; }
109 109
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Resets the state of the ClientSocketHandle. |cancel| indicates whether or 177 // Resets the state of the ClientSocketHandle. |cancel| indicates whether or
178 // not to try to cancel the request with the ClientSocketPool. Does not 178 // not to try to cancel the request with the ClientSocketPool. Does not
179 // reset the supplemental error state. 179 // reset the supplemental error state.
180 void ResetInternal(bool cancel); 180 void ResetInternal(bool cancel);
181 181
182 // Resets the supplemental error state. 182 // Resets the supplemental error state.
183 void ResetErrorState(); 183 void ResetErrorState();
184 184
185 bool is_initialized_; 185 bool is_initialized_;
186 ClientSocketPool* pool_; 186 ClientSocketPool* pool_;
187 LayeredPool* layered_pool_; 187 HigherLayeredPool* higher_pool_;
188 scoped_ptr<StreamSocket> socket_; 188 scoped_ptr<StreamSocket> socket_;
189 std::string group_name_; 189 std::string group_name_;
190 bool is_reused_; 190 bool is_reused_;
191 CompletionCallback callback_; 191 CompletionCallback callback_;
192 CompletionCallback user_callback_; 192 CompletionCallback user_callback_;
193 base::TimeDelta idle_time_; 193 base::TimeDelta idle_time_;
194 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. 194 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation.
195 bool is_ssl_error_; 195 bool is_ssl_error_;
196 HttpResponseInfo ssl_error_response_info_; 196 HttpResponseInfo ssl_error_response_info_;
197 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; 197 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 user_callback_ = callback; 229 user_callback_ = callback;
230 } else { 230 } else {
231 HandleInitCompletion(rv); 231 HandleInitCompletion(rv);
232 } 232 }
233 return rv; 233 return rv;
234 } 234 }
235 235
236 } // namespace net 236 } // namespace net
237 237
238 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ 238 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698