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

Issue 289333003: Adds type information to the NetworkStateNotifier. Also allows for registration of observers. (Closed)

Created:
6 years, 7 months ago by jkarlin
Modified:
6 years, 7 months ago
CC:
blink-reviews, jamesr, dglazkov+blink, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Adds type members and accessors to the NetworkStateNotifier. Also allows for registration of thread-safe observers for said type information so that both workers and windows can receive notification. This is part of adding NetInfo v3 to Chrome, and this code is used by https://codereview.chromium.org/291203002. Design doc: https://docs.google.com/a/chromium.org/document/d/1LTk9uVMGi4kurzcF5ellsAJReTF31fFJMHrQwSVtBjc/ BUG=368358 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174640

Patch Set 1 #

Patch Set 2 : Adding WebNetworkConnection #

Patch Set 3 : Only access observer on the main thread #

Patch Set 4 : Thread safe observer list #

Total comments: 22

Patch Set 5 : Addressing adamk's comments #

Patch Set 6 : Now it's safe to add/remove observers during notification. #

Total comments: 20

Patch Set 7 : Added C++ tests #

Total comments: 2

Patch Set 8 : Simpler test #

Patch Set 9 : Rebase #

Total comments: 8

Patch Set 10 : Refactor WebNetworkConnection::ConnectionType to WebConnectionType #

Total comments: 2

Patch Set 11 : Remove unnecessary include #

Patch Set 12 : Remove unused member #

Unified diffs Side-by-side diffs Delta from patch set Stats (+452 lines, -16 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/page/NetworkStateNotifier.h View 1 2 3 4 5 6 7 8 9 2 chunks +52 lines, -2 lines 0 comments Download
M Source/core/page/NetworkStateNotifier.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +100 lines, -0 lines 0 comments Download
A Source/core/page/NetworkStateNotifierTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +280 lines, -0 lines 0 comments Download
M Source/web/WebNetworkStateNotifier.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
A + public/platform/WebConnectionType.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -14 lines 0 comments Download
M public/web/WebNetworkStateNotifier.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
jkarlin
Adamk: Please review everything, thanks!
6 years, 7 months ago (2014-05-20 14:32:58 UTC) #1
jkarlin
Darin: Please review the public/ files.
6 years, 7 months ago (2014-05-20 14:43:53 UTC) #2
adamk
There are a variety of comments below, but I think the main issue with this ...
6 years, 7 months ago (2014-05-20 15:00:36 UTC) #3
adamk
Ah, looking at https://codereview.chromium.org/291203002 I have a better understanding...it looks like the observers are all ...
6 years, 7 months ago (2014-05-20 15:04:29 UTC) #4
adamk
https://codereview.chromium.org/289333003/diff/60001/Source/core/page/NetworkStateNotifier.cpp File Source/core/page/NetworkStateNotifier.cpp (right): https://codereview.chromium.org/289333003/diff/60001/Source/core/page/NetworkStateNotifier.cpp#newcode83 Source/core/page/NetworkStateNotifier.cpp:83: MutexLocker locker(m_mutex); I think you need to lock for ...
6 years, 7 months ago (2014-05-20 15:12:50 UTC) #5
jkarlin
https://codereview.chromium.org/289333003/diff/60001/Source/core/page/NetworkStateNotifier.cpp File Source/core/page/NetworkStateNotifier.cpp (right): https://codereview.chromium.org/289333003/diff/60001/Source/core/page/NetworkStateNotifier.cpp#newcode69 Source/core/page/NetworkStateNotifier.cpp:69: for (ObserverListMap::iterator it = m_observers.begin(); it != m_observers.end(); ++it) ...
6 years, 7 months ago (2014-05-20 16:20:22 UTC) #6
jkarlin
Please hold off on review until I make a change. I need to change the ...
6 years, 7 months ago (2014-05-20 18:26:19 UTC) #7
jkarlin
On 2014/05/20 18:26:19, jkarlin wrote: > Please hold off on review until I make a ...
6 years, 7 months ago (2014-05-20 20:56:27 UTC) #8
adamk
https://codereview.chromium.org/289333003/diff/90001/Source/core/page/NetworkStateNotifier.cpp File Source/core/page/NetworkStateNotifier.cpp (right): https://codereview.chromium.org/289333003/diff/90001/Source/core/page/NetworkStateNotifier.cpp#newcode41 Source/core/page/NetworkStateNotifier.cpp:41: deleteAllValues(m_observers); This won't be needed if you use OwnPtrs ...
6 years, 7 months ago (2014-05-21 09:21:31 UTC) #9
jkarlin
https://codereview.chromium.org/289333003/diff/90001/Source/core/page/NetworkStateNotifier.cpp File Source/core/page/NetworkStateNotifier.cpp (right): https://codereview.chromium.org/289333003/diff/90001/Source/core/page/NetworkStateNotifier.cpp#newcode41 Source/core/page/NetworkStateNotifier.cpp:41: deleteAllValues(m_observers); On 2014/05/21 09:21:31, adamk wrote: > This won't ...
6 years, 7 months ago (2014-05-21 14:23:17 UTC) #10
adamk
Looking good, I'm super-excited to see the C++ test. https://codereview.chromium.org/289333003/diff/110001/Source/core/page/NetworkStateNotifierTest.cpp File Source/core/page/NetworkStateNotifierTest.cpp (right): https://codereview.chromium.org/289333003/diff/110001/Source/core/page/NetworkStateNotifierTest.cpp#newcode94 Source/core/page/NetworkStateNotifierTest.cpp:94: ...
6 years, 7 months ago (2014-05-21 16:06:04 UTC) #11
jkarlin
https://codereview.chromium.org/289333003/diff/110001/Source/core/page/NetworkStateNotifierTest.cpp File Source/core/page/NetworkStateNotifierTest.cpp (right): https://codereview.chromium.org/289333003/diff/110001/Source/core/page/NetworkStateNotifierTest.cpp#newcode94 Source/core/page/NetworkStateNotifierTest.cpp:94: blink::Platform::current()->currentThread()->exitRunLoop(); On 2014/05/21 16:06:05, adamk wrote: > Rather than ...
6 years, 7 months ago (2014-05-21 16:34:01 UTC) #12
adamk
lgtm, and sorry for the slow reviews (I'll be back in SFO next week). But ...
6 years, 7 months ago (2014-05-22 07:02:44 UTC) #13
jkarlin
On 2014/05/22 07:02:44, adamk wrote: > lgtm, and sorry for the slow reviews (I'll be ...
6 years, 7 months ago (2014-05-22 10:57:22 UTC) #14
jkarlin
jochen or darin: Please review public/ files, thanks!
6 years, 7 months ago (2014-05-22 10:58:24 UTC) #15
jochen (gone - plz use gerrit)
https://codereview.chromium.org/289333003/diff/140001/public/platform/WebNetworkConnection.h File public/platform/WebNetworkConnection.h (right): https://codereview.chromium.org/289333003/diff/140001/public/platform/WebNetworkConnection.h#newcode38 public/platform/WebNetworkConnection.h:38: struct WebNetworkConnection { any reason you put the enum ...
6 years, 7 months ago (2014-05-22 11:05:58 UTC) #16
jkarlin
https://codereview.chromium.org/289333003/diff/140001/public/platform/WebNetworkConnection.h File public/platform/WebNetworkConnection.h (right): https://codereview.chromium.org/289333003/diff/140001/public/platform/WebNetworkConnection.h#newcode38 public/platform/WebNetworkConnection.h:38: struct WebNetworkConnection { On 2014/05/22 11:05:59, jochen wrote: > ...
6 years, 7 months ago (2014-05-22 11:27:37 UTC) #17
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/289333003/diff/70011/public/platform/WebConnectionType.h File public/platform/WebConnectionType.h (right): https://codereview.chromium.org/289333003/diff/70011/public/platform/WebConnectionType.h#newcode34 public/platform/WebConnectionType.h:34: #include "WebCommon.h" not required?
6 years, 7 months ago (2014-05-22 12:13:46 UTC) #18
jkarlin
https://codereview.chromium.org/289333003/diff/70011/public/platform/WebConnectionType.h File public/platform/WebConnectionType.h (right): https://codereview.chromium.org/289333003/diff/70011/public/platform/WebConnectionType.h#newcode34 public/platform/WebConnectionType.h:34: #include "WebCommon.h" On 2014/05/22 12:13:47, jochen wrote: > not ...
6 years, 7 months ago (2014-05-22 12:20:35 UTC) #19
jkarlin
The CQ bit was checked by jkarlin@chromium.org
6 years, 7 months ago (2014-05-22 12:20:42 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@chromium.org/289333003/160001
6 years, 7 months ago (2014-05-22 12:21:40 UTC) #21
jkarlin
The CQ bit was checked by jkarlin@chromium.org
6 years, 7 months ago (2014-05-22 13:23:16 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@chromium.org/289333003/180001
6 years, 7 months ago (2014-05-22 13:23:40 UTC) #23
commit-bot: I haz the power
6 years, 7 months ago (2014-05-23 02:57:34 UTC) #24
Message was sent while issue was closed.
Change committed as 174640

Powered by Google App Engine
This is Rietveld 408576698