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

Issue 9540011: [net] Add DNS-related signals and NetLog to NetworkChangeNotifier. (Closed)

Created:
8 years, 9 months ago by szym
Modified:
7 years, 6 months ago
Reviewers:
cbentzel, eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

[net] Add DNS-related signals and NetLog to NetworkChangeNotifier. Copy DNS-related signals from DnsConfigService to NetworkChangeNotifier Adds DNS watching to Windows and Mac implementations. BUG=57102, 114827 TEST=Change DNS settings. Name resolutions should complete correctly.

Patch Set 1 : . #

Patch Set 2 : . #

Total comments: 4

Patch Set 3 : Moved DNS watch to a separate IO thread on mac. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+430 lines, -58 lines) Patch
A net/base/file_path_watcher_callback.h View 1 chunk +60 lines, -0 lines 0 comments Download
A net/base/file_path_watcher_callback.cc View 1 chunk +87 lines, -0 lines 0 comments Download
M net/base/network_change_notifier.h View 2 chunks +9 lines, -0 lines 0 comments Download
M net/base/network_change_notifier.cc View 2 chunks +10 lines, -0 lines 0 comments Download
M net/base/network_change_notifier_linux.h View 1 chunk +2 lines, -0 lines 0 comments Download
M net/base/network_change_notifier_linux.cc View 11 chunks +51 lines, -57 lines 0 comments Download
M net/base/network_change_notifier_mac.h View 1 2 4 chunks +8 lines, -1 line 0 comments Download
M net/base/network_change_notifier_mac.cc View 1 2 4 chunks +71 lines, -0 lines 0 comments Download
M net/base/network_change_notifier_win.h View 1 5 chunks +38 lines, -0 lines 0 comments Download
M net/base/network_change_notifier_win.cc View 1 3 chunks +92 lines, -0 lines 0 comments Download
M net/net.gyp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
szym
8 years, 9 months ago (2012-02-29 18:44:51 UTC) #1
cbentzel
I didn't delve into the implementations - how do you anticipate callers will use this? ...
8 years, 9 months ago (2012-02-29 21:51:58 UTC) #2
szym
HostResolverImpl will be a DNSObserver. OnDNSCanged, it will retract its current DnsConfig (and bypass DnsTask) ...
8 years, 9 months ago (2012-02-29 22:03:49 UTC) #3
cbentzel
Should it be a parameter to OnDnsChanged instead? On Wed, Feb 29, 2012 at 5:03 ...
8 years, 9 months ago (2012-02-29 22:05:32 UTC) #4
szym
On 2012/02/29 22:05:32, cbentzel wrote: > Should it be a parameter to OnDnsChanged instead? My ...
8 years, 9 months ago (2012-02-29 22:07:17 UTC) #5
cbentzel
On Wed, Feb 29, 2012 at 5:07 PM, <szym@chromium.org> wrote: > On 2012/02/29 22:05:32, cbentzel ...
8 years, 9 months ago (2012-02-29 22:10:58 UTC) #6
cbentzel
Actually - would it be better if newly added observers get an OnDnsChanged event immediately ...
8 years, 9 months ago (2012-02-29 22:12:03 UTC) #7
szym
On 2012/02/29 22:12:03, cbentzel wrote: > Actually - would it be better if newly added ...
8 years, 9 months ago (2012-02-29 22:14:36 UTC) #8
szym
8 years, 9 months ago (2012-03-01 18:18:44 UTC) #9
The reason mac trybots fail is that FilePathWatcher requires an IO message loop
and NetworkChangeNotifier is created on the browser (UI) thread.
NetworkChangeNotifierLinux spawns a separate IO thread to avoid this problem.
NetworkChangeNotifierMac currently spawns a separate UI thread, so we would need
yet another thread. Windows does not see this problem because FilePathWatcherWin
does not require an IO loop.

It feels wasteful to spawn a separate IO thread for asynchronous operations when
the primary customers of DNSObserver live on another IO thread. HostResolverImpl
is essentially the only customer of DNSObserver -- directly and through
DnsReloader (not clear on the plans for DnsRRResolver). So it makes sense to
move DNSObserver out of NetworkChangeNotifier and make it owned by
HostResolverImpl. 

This would mean staying closer to what DnsConfigService is today, and probably
making it even simpler by replacing Observer with Delegate. The main difference
would be that DnsConfigService would be used regardless of "--enable-async-dns".

On 2012/02/29 22:14:36, szym wrote:
> On 2012/02/29 22:12:03, cbentzel wrote:
> > Actually - would it be better if newly added observers get an OnDnsChanged
> > event immediately with the current state?
> > 
> > It would be great if we had edge-triggered ways of indicating this only.
> 
> I wouldn't mind an interface like this, and it would simplify the consumers.
> However, it won't really affect the implementation. AddDNSObserver is
> implemented in the base class NetworkChangeNotifier.

Powered by Google App Engine
This is Rietveld 408576698