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

Issue 1047103002: Avoid initial NetworkChangeNotifier OnDNSChanged() signal on Android (Closed)

Created:
5 years, 8 months ago by pauljensen
Modified:
5 years, 8 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid initial NetworkChangeNotifier OnDNSChanged() signal on Android When the DnsConfigServicePosix finishes its initial reading of the system DNS config, it normally triggers a NetworkChangeNotifier (NCN) OnDNSChanged() signal. This can cause in-flight network requests to abort with ERR_NETWORK_CHANGED. Avoid aborting requests by: 1. Adding a new NCN signal, OnInitialDNSConfigRead which indicates the initial DNS config reading completed but does not represent a change in DNS config. 2. Modify HostResolverImpl to not abort requests upon this new signal (like it does for the OnDNSChanged signal). 3. Add logic to NetworkChangeNotifierAndroid to emit this new signal when safe to do so. Network requests begin being issued immediately after the NCN (and hence DnsConfigService) is initialized, so we need to be sure no network change signals are missed between NCN initialization completing and the OnInitialDNSConfigRead signal. This is tricky because the NCN (and hence DnsConfigService) is initialized on threads where file I/O is not allowed. Were file I/O allowed we could simply slurp up the DNS config and hosts file. Instead we start listening for network changes (which is our trigger signal for DNS changes on Android) on the initialization thread and record the current time to later compare against the hosts file's last-modified time to check for changes to the file. Actual loading of the DNS config and hosts file is done on another thread that allows file I/O. BUG=470897 Committed: https://crrev.com/101ed37a9cb2f1a7e906ab9f4e3a1c6331cdf8b3 Cr-Commit-Position: refs/heads/master@{#325560}

Patch Set 1 : #

Patch Set 2 : Redo #

Patch Set 3 : Cleanup and comment #

Patch Set 4 : Tiny cleanup #

Patch Set 5 : always use external OnNetworkChanged events #

Patch Set 6 : add tests #

Patch Set 7 : fix comment #

Patch Set 8 : add HostResolverImpl tests #

Patch Set 9 : fix tests and appease clang #

Patch Set 10 : fix tests when device has no internet #

Patch Set 11 : really fix things #

Patch Set 12 : fix clang #

Patch Set 13 : sync #

Patch Set 14 : revert an accidental test enabling #

Unified diffs Side-by-side diffs Delta from patch set Stats (+431 lines, -75 lines) Patch
M chrome/browser/net/dns_probe_service.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/net/dns_probe_service.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M net/android/network_change_notifier_android.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M net/android/network_change_notifier_android.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +45 lines, -9 lines 0 comments Download
M net/android/network_change_notifier_android_unittest.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +51 lines, -13 lines 0 comments Download
M net/android/network_change_notifier_factory_android.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M net/base/network_change_notifier.h View 1 2 3 4 5 6 7 4 chunks +10 lines, -1 line 0 comments Download
M net/base/network_change_notifier.cc View 1 2 3 4 5 6 7 5 chunks +36 lines, -0 lines 0 comments Download
M net/dns/dns_config_service_posix.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +33 lines, -0 lines 0 comments Download
M net/dns/dns_config_service_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 chunks +72 lines, -21 lines 0 comments Download
M net/dns/dns_config_service_posix_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +115 lines, -3 lines 0 comments Download
M net/dns/dns_config_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M net/dns/host_resolver_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M net/dns/host_resolver_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +29 lines, -15 lines 0 comments Download
M net/dns/host_resolver_impl_unittest.cc View 1 2 3 4 5 6 7 3 chunks +21 lines, -1 line 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -9 lines 0 comments Download
M net/tools/net_watcher/net_watcher.cc View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (12 generated)
pauljensen
Thomas, would you like to review this? I see you were the one that got ...
5 years, 8 months ago (2015-03-31 20:13:08 UTC) #5
pauljensen
I've flushed out this change and hopefully added lots of comments about how it works ...
5 years, 8 months ago (2015-03-31 20:14:07 UTC) #6
pauljensen
Drats, I realized this isn't going to work very well. I need to rework some ...
5 years, 8 months ago (2015-04-01 01:36:00 UTC) #7
pauljensen
I rewrote this CL this morning. I tested it a fair bit, including dropping a ...
5 years, 8 months ago (2015-04-02 03:27:35 UTC) #8
pauljensen
Friendly ping.
5 years, 8 months ago (2015-04-06 18:48:18 UTC) #9
Deprecated (see juliatuttle)
On 2015/04/06 18:48:18, pauljensen wrote: > Friendly ping. Looks good, but it bugs me that ...
5 years, 8 months ago (2015-04-06 19:29:20 UTC) #10
pauljensen
So I addressed the previous comment. Then I added some tests. One of the tests ...
5 years, 8 months ago (2015-04-09 01:57:12 UTC) #11
pauljensen
I filed a couple bugs about the base::FilePathWatcher being untested (http://crbug.com/475570) and broken (http://crbug.com/475568) on ...
5 years, 8 months ago (2015-04-10 12:59:15 UTC) #12
Deprecated (see juliatuttle)
lgtm!
5 years, 8 months ago (2015-04-10 15:56:27 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047103002/200001
5 years, 8 months ago (2015-04-10 16:07:11 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/55506)
5 years, 8 months ago (2015-04-10 16:15:26 UTC) #17
pauljensen
On 2015/04/10 16:15:26, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 8 months ago (2015-04-10 16:20:30 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047103002/240001
5 years, 8 months ago (2015-04-12 00:33:48 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/55733)
5 years, 8 months ago (2015-04-12 00:41:53 UTC) #23
pauljensen
All the tests were passing locally but turn out to fail on the bots when ...
5 years, 8 months ago (2015-04-12 11:13:09 UTC) #24
pauljensen
Friendly ping.
5 years, 8 months ago (2015-04-16 15:00:48 UTC) #25
Deprecated (see juliatuttle)
lgtm. (Sorry, didn't notice you were asking for a re-review.)
5 years, 8 months ago (2015-04-16 17:51:13 UTC) #26
pauljensen
Matt, PTAL @ chrome/browser/net/dns_probe_service.*
5 years, 8 months ago (2015-04-16 19:02:49 UTC) #28
mmenke
On 2015/04/16 19:02:49, pauljensen wrote: > Matt, PTAL @ chrome/browser/net/dns_probe_service.* LGTM
5 years, 8 months ago (2015-04-16 19:13:51 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047103002/320001
5 years, 8 months ago (2015-04-16 19:43:42 UTC) #32
commit-bot: I haz the power
Committed patchset #14 (id:320001)
5 years, 8 months ago (2015-04-17 00:11:52 UTC) #33
commit-bot: I haz the power
5 years, 8 months ago (2015-04-17 00:12:53 UTC) #34
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/101ed37a9cb2f1a7e906ab9f4e3a1c6331cdf8b3
Cr-Commit-Position: refs/heads/master@{#325560}

Powered by Google App Engine
This is Rietveld 408576698