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

Unified Diff: net/socket/client_socket_pool_base.h

Issue 1604045: Fix crash on IP address change. (Closed)
Patch Set: Merge conflict Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gyp ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.h
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 75572cffd9cdb688abf769ce3632ecd311033423..d1abd5826339de3ca504400188b77fcf7ec6dce7 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -39,6 +39,7 @@
#include "net/base/load_states.h"
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
+#include "net/base/network_change_notifier.h"
#include "net/base/request_priority.h"
#include "net/socket/client_socket.h"
#include "net/socket/client_socket_pool.h"
@@ -121,7 +122,8 @@ namespace internal {
// ClientSocketPoolBase instead.
class ClientSocketPoolBaseHelper
: public base::RefCounted<ClientSocketPoolBaseHelper>,
- public ConnectJob::Delegate {
+ public ConnectJob::Delegate,
+ public NetworkChangeNotifier::Observer {
public:
class Request {
public:
@@ -168,7 +170,8 @@ class ClientSocketPoolBaseHelper
int max_sockets_per_group,
base::TimeDelta unused_idle_socket_timeout,
base::TimeDelta used_idle_socket_timeout,
- ConnectJobFactory* connect_job_factory);
+ ConnectJobFactory* connect_job_factory,
+ NetworkChangeNotifier* network_change_notifier);
// See ClientSocketPool::RequestSocket for documentation on this function.
// Note that |request| must be heap allocated. If ERR_IO_PENDING is returned,
@@ -208,6 +211,9 @@ class ClientSocketPoolBaseHelper
// ConnectJob::Delegate methods:
virtual void OnConnectJobComplete(int result, ConnectJob* job);
+ // NetworkChangeNotifier::Observer methods:
+ virtual void OnIPAddressChanged();
+
// For testing.
bool may_have_stalled_group() const { return may_have_stalled_group_; }
@@ -428,6 +434,8 @@ class ClientSocketPoolBaseHelper
const scoped_ptr<ConnectJobFactory> connect_job_factory_;
+ NetworkChangeNotifier* const network_change_notifier_;
+
// TODO(vandebo) Remove when backup jobs move to TCPClientSocketPool
bool backup_jobs_enabled_;
@@ -494,12 +502,14 @@ class ClientSocketPoolBase {
const std::string& name,
base::TimeDelta unused_idle_socket_timeout,
base::TimeDelta used_idle_socket_timeout,
- ConnectJobFactory* connect_job_factory)
+ ConnectJobFactory* connect_job_factory,
+ NetworkChangeNotifier* network_change_notifier)
: name_(name),
helper_(new internal::ClientSocketPoolBaseHelper(
max_sockets, max_sockets_per_group,
unused_idle_socket_timeout, used_idle_socket_timeout,
- new ConnectJobFactoryAdaptor(connect_job_factory))) {}
+ new ConnectJobFactoryAdaptor(connect_job_factory),
+ network_change_notifier)) {}
virtual ~ClientSocketPoolBase() {}
« no previous file with comments | « net/net.gyp ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698