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

Issue 1659363003: [Android WebView] Implement support for Network Information API and enable it. (Closed)

Created:
4 years, 10 months ago by timvolodine
Modified:
4 years, 9 months ago
Reviewers:
pauljensen, Torne
CC:
chromium-reviews, cbentzel+watch_chromium.org, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android WebView] Implement support for Network Information API and enable it. Currently Network Information API and everything related to the NetworkChangeNotifier is disabled in WebView. This patch implements the required parts to enable Network Information API in WebView. The WebView implementation is based on NetworkChangeNotifier, similar to chrome for Android. However the registration policy is different: 1. whether we listen to network changes depends on the presence of live WebView instances, 2. both the band-width and connectivity changes are propagated, but a reduced network stack is involved as compared to the chrome for android implementation, 3. for backward compatibility invoking setNetworkAvailable() on a webview disables network information api. 4. The embedding application needs to have ACCESS_NETWORK_STATE permission at the time webview process is initialized for the Network Information API to work. BUG=520088, 590383 Committed: https://crrev.com/3673455317898f450211636919c2bef7a8e3fe0f Cr-Commit-Position: refs/heads/master@{#376975} Committed: https://crrev.com/bbaeb5b26d3ba544e801a2ad9f31955eb2309d89 Cr-Commit-Position: refs/heads/master@{#378807}

Patch Set 1 #

Total comments: 4

Patch Set 2 : fix Paul's comments #

Patch Set 3 : fix gn builds #

Patch Set 4 : fix gn builds for real #

Patch Set 5 : rebase #

Patch Set 6 : rebase #

Patch Set 7 : check for ACCESS_NETWORK_STATE permission #

Patch Set 8 : fix compile #

Patch Set 9 : remove logging #

Unified diffs Side-by-side diffs Delta from patch set Stats (+279 lines, -3 lines) Patch
M android_webview/BUILD.gn View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M android_webview/android_webview.gyp View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M android_webview/browser/aw_browser_main_parts.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
A android_webview/browser/net/aw_network_change_notifier.h View 1 chunk +66 lines, -0 lines 0 comments Download
A android_webview/browser/net/aw_network_change_notifier.cc View 1 chunk +82 lines, -0 lines 0 comments Download
A android_webview/browser/net/aw_network_change_notifier_factory.h View 1 chunk +41 lines, -0 lines 0 comments Download
A android_webview/browser/net/aw_network_change_notifier_factory.cc View 1 chunk +19 lines, -0 lines 0 comments Download
M android_webview/glue/glue.gni View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
A android_webview/java/src/org/chromium/android_webview/AwNetworkChangeNotifierRegistrationPolicy.java View 1 chunk +37 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 30 (16 generated)
timvolodine
torne@: for android_webview/ pauljensen@: for NetworkChangeNotifier.java
4 years, 10 months ago (2016-02-03 16:48:03 UTC) #3
pauljensen
I don't think any NetworkChangeNotifier.java changes are really necessary. https://codereview.chromium.org/1659363003/diff/1/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java File net/android/java/src/org/chromium/net/NetworkChangeNotifier.java (right): https://codereview.chromium.org/1659363003/diff/1/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java#newcode150 net/android/java/src/org/chromium/net/NetworkChangeNotifier.java:150: ...
4 years, 10 months ago (2016-02-03 17:04:16 UTC) #4
timvolodine
Thanks Paul! I've addressed your comments. https://codereview.chromium.org/1659363003/diff/1/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java File net/android/java/src/org/chromium/net/NetworkChangeNotifier.java (right): https://codereview.chromium.org/1659363003/diff/1/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java#newcode150 net/android/java/src/org/chromium/net/NetworkChangeNotifier.java:150: public static void ...
4 years, 10 months ago (2016-02-04 18:16:32 UTC) #5
Torne
LGTM - this seems like pretty reasonable plumbing of the pieces you've put in place ...
4 years, 10 months ago (2016-02-12 16:44:31 UTC) #6
Torne
LGTM - this seems like pretty reasonable plumbing of the pieces you've put in place ...
4 years, 10 months ago (2016-02-12 16:44:31 UTC) #7
timvolodine
On 2016/02/12 16:44:31, Torne wrote: > LGTM - this seems like pretty reasonable plumbing of ...
4 years, 10 months ago (2016-02-23 13:36:46 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1659363003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1659363003/100001
4 years, 10 months ago (2016-02-23 13:37:54 UTC) #12
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 10 months ago (2016-02-23 13:43:44 UTC) #14
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/3673455317898f450211636919c2bef7a8e3fe0f Cr-Commit-Position: refs/heads/master@{#376975}
4 years, 10 months ago (2016-02-23 13:45:17 UTC) #16
sgurun-gerrit only
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/1745663003/ by sgurun@chromium.org. ...
4 years, 10 months ago (2016-02-26 23:50:54 UTC) #17
timvolodine
On 2016/02/26 23:50:54, sgurun wrote: > A revert of this CL (patchset #6 id:100001) has ...
4 years, 9 months ago (2016-03-01 22:59:38 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1659363003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1659363003/160001
4 years, 9 months ago (2016-03-02 19:52:15 UTC) #26
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 9 months ago (2016-03-02 19:58:55 UTC) #28
commit-bot: I haz the power
4 years, 9 months ago (2016-03-02 20:00:54 UTC) #30
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/bbaeb5b26d3ba544e801a2ad9f31955eb2309d89
Cr-Commit-Position: refs/heads/master@{#378807}

Powered by Google App Engine
This is Rietveld 408576698