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

Issue 6526059: Plumb through NetworkChangeNotifier::IsOffline() to WebKit, enabling (Closed)

Created:
9 years, 10 months ago by adamk
Modified:
9 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=76985

Patch Set 1 #

Patch Set 2 : Update to use enum and WebNetworkStateNotifier #

Patch Set 3 : No tests yet #

Total comments: 2

Patch Set 4 : Use OneShotTimer #

Patch Set 5 : Make method non-static #

Patch Set 6 : Appease the C++ type system #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -57 lines) Patch
M chrome/browser/google/google_url_tracker.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/google/google_url_tracker.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/intranet_redirect_detector.h View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/intranet_redirect_detector.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/io_thread.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/io_thread.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 chunks +7 lines, -0 lines 0 comments Download
M content/browser/tab_contents/tab_contents.h View 1 2 3 3 chunks +6 lines, -1 line 0 comments Download
M content/browser/tab_contents/tab_contents.cc View 1 2 3 3 chunks +8 lines, -0 lines 0 comments Download
M jingle/notifier/communicator/login.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M jingle/notifier/communicator/login.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M net/base/dnsrr_resolver.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/host_resolver_impl.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/host_resolver_impl.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M net/base/network_change_notifier.h View 1 2 3 4 4 chunks +29 lines, -7 lines 0 comments Download
M net/base/network_change_notifier.cc View 1 2 3 4 1 chunk +37 lines, -10 lines 0 comments Download
M net/base/network_change_notifier_win.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M net/base/network_change_notifier_win.cc View 1 2 3 4 5 3 chunks +14 lines, -0 lines 0 comments Download
M net/proxy/proxy_service.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/proxy/proxy_service.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/socket/client_socket_pool_base.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/socket/client_socket_pool_base.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/spdy/spdy_session_pool.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M net/spdy/spdy_session_pool.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
adamk
No tests yet; recommendations on what should be unit tested here would be appreciated.
9 years, 10 months ago (2011-02-25 02:27:45 UTC) #1
eroman
LGTM, sorry for not getting to this sooner! I like this breakdown between the IP ...
9 years, 9 months ago (2011-03-01 05:23:10 UTC) #2
eroman
Actually add Will this time :)
9 years, 9 months ago (2011-03-01 05:23:27 UTC) #3
adamk
http://codereview.chromium.org/6526059/diff/3001/net/base/network_change_notifier_win.cc File net/base/network_change_notifier_win.cc (right): http://codereview.chromium.org/6526059/diff/3001/net/base/network_change_notifier_win.cc#newcode156 net/base/network_change_notifier_win.cc:156: MessageLoop::current()->PostDelayedTask( On 2011/03/01 05:23:10, eroman wrote: > I suggest ...
9 years, 9 months ago (2011-03-01 19:20:06 UTC) #4
adamk
On 2011/03/01 19:20:06, Adam Klein wrote: > http://codereview.chromium.org/6526059/diff/3001/net/base/network_change_notifier_win.cc > File net/base/network_change_notifier_win.cc (right): > > http://codereview.chromium.org/6526059/diff/3001/net/base/network_change_notifier_win.cc#newcode156 ...
9 years, 9 months ago (2011-03-01 20:09:01 UTC) #5
eroman
9 years, 9 months ago (2011-03-04 01:29:38 UTC) #6
LGTM

Powered by Google App Engine
This is Rietveld 408576698