summaryrefslogtreecommitdiff
path: root/chromium/net/socket/client_socket_pool_base.h
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-11-21 14:09:57 +0100
committerAndras Becsi <andras.becsi@digia.com>2013-11-29 15:14:36 +0100
commiteb32ba6f51d0c21d58cd7d89785285ff8fa64624 (patch)
tree2c7c940e1dbee81b89d935626110816b494aa32c /chromium/net/socket/client_socket_pool_base.h
parent9427c1a0222ebd67efef1a2c7990a0fa5c9aac84 (diff)
downloadqtwebengine-chromium-eb32ba6f51d0c21d58cd7d89785285ff8fa64624.tar.gz
Update chromium to branch 1599.
Change-Id: I04e775a946a208bb4500d3b722bcb05c82b9d7cb Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/net/socket/client_socket_pool_base.h')
-rw-r--r--chromium/net/socket/client_socket_pool_base.h44
1 files changed, 19 insertions, 25 deletions
diff --git a/chromium/net/socket/client_socket_pool_base.h b/chromium/net/socket/client_socket_pool_base.h
index eb642edd730..4bf95d7b04a 100644
--- a/chromium/net/socket/client_socket_pool_base.h
+++ b/chromium/net/socket/client_socket_pool_base.h
@@ -61,11 +61,8 @@ class NET_EXPORT_PRIVATE ConnectJob {
Delegate() {}
virtual ~Delegate() {}
- // Alerts the delegate that the connection completed. |job| must
- // be destroyed by the delegate. A scoped_ptr<> isn't used because
- // the caller of this function doesn't own |job|.
- virtual void OnConnectJobComplete(int result,
- ConnectJob* job) = 0;
+ // Alerts the delegate that the connection completed.
+ virtual void OnConnectJobComplete(int result, ConnectJob* job) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Delegate);
@@ -82,10 +79,9 @@ class NET_EXPORT_PRIVATE ConnectJob {
const std::string& group_name() const { return group_name_; }
const BoundNetLog& net_log() { return net_log_; }
- // Releases ownership of the underlying socket to the caller.
- // Returns the released socket, or NULL if there was a connection
- // error.
- scoped_ptr<StreamSocket> PassSocket();
+ // Releases |socket_| to the client. On connection error, this should return
+ // NULL.
+ StreamSocket* ReleaseSocket() { return socket_.release(); }
// Begins connecting the socket. Returns OK on success, ERR_IO_PENDING if it
// cannot complete synchronously without blocking, or another net error code
@@ -109,7 +105,7 @@ class NET_EXPORT_PRIVATE ConnectJob {
const BoundNetLog& net_log() const { return net_log_; }
protected:
- void SetSocket(scoped_ptr<StreamSocket> socket);
+ void set_socket(StreamSocket* socket);
StreamSocket* socket() { return socket_.get(); }
void NotifyDelegateOfCompletion(int rv);
void ResetTimer(base::TimeDelta remainingTime);
@@ -192,7 +188,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
ConnectJobFactory() {}
virtual ~ConnectJobFactory() {}
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ virtual ConnectJob* NewConnectJob(
const std::string& group_name,
const Request& request,
ConnectJob::Delegate* delegate) const = 0;
@@ -233,7 +229,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
// See ClientSocketPool::ReleaseSocket for documentation on this function.
void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
+ StreamSocket* socket,
int id);
// See ClientSocketPool::FlushWithError for documentation on this function.
@@ -390,8 +386,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
// Otherwise, returns false.
bool TryToUseUnassignedConnectJob();
- void AddJob(scoped_ptr<ConnectJob> job, bool is_preconnect);
- // Remove |job| from this group, which must already own |job|.
+ void AddJob(ConnectJob* job, bool is_preconnect);
void RemoveJob(ConnectJob* job);
void RemoveAllJobs();
@@ -480,7 +475,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
CleanupIdleSockets(false);
}
- // Removes |job| from |group|, which must already own |job|.
+ // Removes |job| from |connect_job_set_|. Also updates |group| if non-NULL.
void RemoveConnectJob(ConnectJob* job, Group* group);
// Tries to see if we can handle any more requests for |group|.
@@ -490,7 +485,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
void ProcessPendingRequest(const std::string& group_name, Group* group);
// Assigns |socket| to |handle| and updates |group|'s counters appropriately.
- void HandOutSocket(scoped_ptr<StreamSocket> socket,
+ void HandOutSocket(StreamSocket* socket,
bool reused,
const LoadTimingInfo::ConnectTiming& connect_timing,
ClientSocketHandle* handle,
@@ -499,7 +494,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
const BoundNetLog& net_log);
// Adds |socket| to the list of idle sockets for |group|.
- void AddIdleSocket(scoped_ptr<StreamSocket> socket, Group* group);
+ void AddIdleSocket(StreamSocket* socket, Group* group);
// Iterates through |group_map_|, canceling all ConnectJobs and deleting
// groups if they are no longer needed.
@@ -629,7 +624,7 @@ class ClientSocketPoolBase {
ConnectJobFactory() {}
virtual ~ConnectJobFactory() {}
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ virtual ConnectJob* NewConnectJob(
const std::string& group_name,
const Request& request,
ConnectJob::Delegate* delegate) const = 0;
@@ -707,10 +702,9 @@ class ClientSocketPoolBase {
return helper_.CancelRequest(group_name, handle);
}
- void ReleaseSocket(const std::string& group_name,
- scoped_ptr<StreamSocket> socket,
+ void ReleaseSocket(const std::string& group_name, StreamSocket* socket,
int id) {
- return helper_.ReleaseSocket(group_name, socket.Pass(), id);
+ return helper_.ReleaseSocket(group_name, socket, id);
}
void FlushWithError(int error) { helper_.FlushWithError(error); }
@@ -791,13 +785,13 @@ class ClientSocketPoolBase {
: connect_job_factory_(connect_job_factory) {}
virtual ~ConnectJobFactoryAdaptor() {}
- virtual scoped_ptr<ConnectJob> NewConnectJob(
+ virtual ConnectJob* NewConnectJob(
const std::string& group_name,
const internal::ClientSocketPoolBaseHelper::Request& request,
- ConnectJob::Delegate* delegate) const OVERRIDE {
- const Request& casted_request = static_cast<const Request&>(request);
+ ConnectJob::Delegate* delegate) const {
+ const Request* casted_request = static_cast<const Request*>(&request);
return connect_job_factory_->NewConnectJob(
- group_name, casted_request, delegate);
+ group_name, *casted_request, delegate);
}
virtual base::TimeDelta ConnectionTimeout() const {