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

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

Issue 99205: Add a histogram to measure the number of idle sockets when a TCP connection is established. (Closed)
Patch Set: Use a const ref (woops!) instead of copying a string. Add comments. Created 11 years, 7 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
« no previous file with comments | « no previous file | net/base/client_socket_pool.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_BASE_CLIENT_SOCKET_HANDLE_H_ 5 #ifndef NET_BASE_CLIENT_SOCKET_HANDLE_H_
6 #define NET_BASE_CLIENT_SOCKET_HANDLE_H_ 6 #define NET_BASE_CLIENT_SOCKET_HANDLE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // 55 //
56 // NOTE: To prevent the socket from being kept alive, be sure to call its 56 // NOTE: To prevent the socket from being kept alive, be sure to call its
57 // Disconnect method. 57 // Disconnect method.
58 // 58 //
59 void Reset(); 59 void Reset();
60 60
61 // Returns true when Init has completed successfully. 61 // Returns true when Init has completed successfully.
62 bool is_initialized() const { return socket_ != NULL; } 62 bool is_initialized() const { return socket_ != NULL; }
63 63
64 // These may only be used if is_initialized() is true. 64 // These may only be used if is_initialized() is true.
65 const std::string& group_name() const { return group_name_; }
65 ClientSocket* socket() { return socket_->get(); } 66 ClientSocket* socket() { return socket_->get(); }
66 ClientSocket* release_socket() { return socket_->release(); } 67 ClientSocket* release_socket() { return socket_->release(); }
67 void set_socket(ClientSocket* s) { socket_->reset(s); } 68 void set_socket(ClientSocket* s) { socket_->reset(s); }
68 69
69 private: 70 private:
70 friend class ClientSocketPool; 71 friend class ClientSocketPool;
71 72
72 scoped_refptr<ClientSocketPool> pool_; 73 scoped_refptr<ClientSocketPool> pool_;
73 scoped_ptr<ClientSocket>* socket_; 74 scoped_ptr<ClientSocket>* socket_;
74 std::string group_name_; 75 std::string group_name_;
75 76
76 DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle); 77 DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle);
77 }; 78 };
78 79
79 } // namespace net 80 } // namespace net
80 81
81 #endif // NET_BASE_CLIENT_SOCKET_HANDLE_H_ 82 #endif // NET_BASE_CLIENT_SOCKET_HANDLE_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698