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

Issue 6353008: Allow IO operations in destructor of net::NetworkConfigWatcherMacThread (Closed)

Created:
9 years, 11 months ago by Raghu Simha
Modified:
9 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, cbentzel+watch_chromium.org, darin-cc_chromium.org, Evan Martin
Visibility:
Public.

Description

Allow IO operations in destructor of net::NetworkConfigWatcherMacThread The destructor of net::NetworkConfigWatcherMacThread ends up calling PlatformThread::Join(), an operation that needs to be done only from an IO thread. This currently causes a DCHECK to fire in base::ThreadRestrictions. The bug was discovered by running the sync integration tests on a mac trybot. The tests create Profile objects during setup, that indirectly call ~NetworkConfigWatcherMacThread() from their destructors. This patch allows IO operations in ~NetworkConfigWatcherMacThread() using a ScopedAllowIO. BUG=70190 TEST=sync_integration_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72030

Patch Set 1 : " #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
M net/base/network_config_watcher_mac.cc View 2 chunks +9 lines, -0 lines 3 comments Download

Messages

Total messages: 4 (0 generated)
Raghu Simha
+willchan for review.
9 years, 11 months ago (2011-01-20 22:05:06 UTC) #1
evanm
I have no context, so I have stupid review feedback http://codereview.chromium.org/6353008/diff/2001/net/base/network_config_watcher_mac.cc File net/base/network_config_watcher_mac.cc (right): http://codereview.chromium.org/6353008/diff/2001/net/base/network_config_watcher_mac.cc#newcode68 ...
9 years, 11 months ago (2011-01-20 22:07:29 UTC) #2
Raghu Simha
http://codereview.chromium.org/6353008/diff/2001/net/base/network_config_watcher_mac.cc File net/base/network_config_watcher_mac.cc (right): http://codereview.chromium.org/6353008/diff/2001/net/base/network_config_watcher_mac.cc#newcode68 net/base/network_config_watcher_mac.cc:68: base::ThreadRestrictions::SetIOAllowed(false); On 2011/01/20 22:07:29, evanm wrote: > Isn't this ...
9 years, 11 months ago (2011-01-20 22:17:41 UTC) #3
willchan no longer on Chromium
9 years, 11 months ago (2011-01-20 22:47:09 UTC) #4
LGTM

http://codereview.chromium.org/6353008/diff/2001/net/base/network_config_watc...
File net/base/network_config_watcher_mac.cc (right):

http://codereview.chromium.org/6353008/diff/2001/net/base/network_config_watc...
net/base/network_config_watcher_mac.cc:68:
base::ThreadRestrictions::SetIOAllowed(false);
On 2011/01/20 22:17:45, rsimha wrote:
> On 2011/01/20 22:07:29, evanm wrote:
> > Isn't this ok?  It's a helper thread, no?
> 
> Per email from willchan:
> 
> "Add a ScopedAllowIO in NetworkConfigWatcherMacThread's destructor. I don't
> think that thread should be doing any blocking IO. In
> NetworkConfigWatcherMacThread::Init(), we should probably do
> base::ThreadRestrictions::SetIOAllowed(false), to make sure that
> NetworkConfigWatcherMac's helper thread isn't blocking."
> 
> I'll defer to willchan's decision on whether this is necessary or not.

I think we should add it, because if we're going to join this thread in
non-shutdown situations, then we need to make sure the join is fast.

Powered by Google App Engine
This is Rietveld 408576698