diff options
author | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 22:42:08 +0000 |
---|---|---|
committer | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 22:42:08 +0000 |
commit | 232a58169700ed7abde79d9858c288eb21409e60 (patch) | |
tree | a1424f86d252cd3859c060954882a9a1809a5121 /net/spdy | |
parent | cdc5489ddff18b5ff13296abc1c8869e3cd7db28 (diff) | |
download | chromium_src-232a58169700ed7abde79d9858c288eb21409e60.zip chromium_src-232a58169700ed7abde79d9858c288eb21409e60.tar.gz chromium_src-232a58169700ed7abde79d9858c288eb21409e60.tar.bz2 |
Plumb through NetworkChangeNotifier::IsOffline() to WebKit, enabling
navigator.onLine and online/offline events. Only works on Windows at the moment, as IsCurrentlyOffline() is supported only by NetworkChangeNotifierWin.
Most of the changes are due to the need to support two different kinds of NetworkChangeNotifier observers. Both observers currently happen to trigger on the same event, but that could change, e.g., if we store the previous online state and only notify on a change. Thus the need for two different observer interfaces, and associated Add/Remove methods.
BUG=7469
TEST=Load https://bug336359.bugzilla.mozilla.org/attachment.cgi?id=220609, unplug network cable, reload, see that page changes to note offline status
Review URL: http://codereview.chromium.org/6526059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy')
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 4 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index b32495e..e2cae2b 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -19,7 +19,7 @@ bool SpdySessionPool::g_force_single_domain = false; SpdySessionPool::SpdySessionPool(SSLConfigService* ssl_config_service) : ssl_config_service_(ssl_config_service) { - NetworkChangeNotifier::AddObserver(this); + NetworkChangeNotifier::AddIPAddressObserver(this); if (ssl_config_service_) ssl_config_service_->AddObserver(this); } @@ -29,7 +29,7 @@ SpdySessionPool::~SpdySessionPool() { if (ssl_config_service_) ssl_config_service_->RemoveObserver(this); - NetworkChangeNotifier::RemoveObserver(this); + NetworkChangeNotifier::RemoveIPAddressObserver(this); } scoped_refptr<SpdySession> SpdySessionPool::Get( diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h index 91ff8cb..16125e0 100644 --- a/net/spdy/spdy_session_pool.h +++ b/net/spdy/spdy_session_pool.h @@ -32,7 +32,7 @@ class SpdySession; // This is a very simple pool for open SpdySessions. // TODO(mbelshe): Make this production ready. class SpdySessionPool - : public NetworkChangeNotifier::Observer, + : public NetworkChangeNotifier::IPAddressObserver, public SSLConfigService::Observer { public: explicit SpdySessionPool(SSLConfigService* ssl_config_service); @@ -90,7 +90,7 @@ class SpdySessionPool SpdySettingsStorage* mutable_spdy_settings() { return &spdy_settings_; } const SpdySettingsStorage& spdy_settings() const { return spdy_settings_; } - // NetworkChangeNotifier::Observer methods: + // NetworkChangeNotifier::IPAddressObserver methods: // We flush all idle sessions and release references to the active ones so // they won't get re-used. The active ones will either complete successfully |