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

Issue 392010: Fix a crash during shutdown where SafeBrowsingProtocolManager could end up getting back NULL for Pro (Closed)

Created:
11 years, 1 month ago by eroman
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, Paul Godavari, ben+cc_chromium.org
Visibility:
Public.

Description

Fix a crash during shutdown where SafeBrowsingProtocolManager could end up getting back NULL for Profile::GetDefaultRequestContext() and consequently URLFetcher would crash. During shutdown the Profile is first deleted, and THEN the IO thread is torn down. This means there is a window of time when Profile::GetDefaultRequestContext() will return NULL, but tasks are still running on the IO thread. Instead, SafeBrowsingProtocolManager now gets passed an explicit context, and holds a reference throughout its lifetime. This way it is guaranteed a valid pointer throughout the lifetime of the IO thread, even if the default Profile has already been deleted. BUG=27074 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31821

Patch Set 1 #

Patch Set 2 : Add unit test file #

Patch Set 3 : Fix some nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -21 lines) Patch
M chrome/browser/safe_browsing/protocol_manager.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.cc View 8 chunks +10 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.cc View 1 2 6 chunks +26 lines, -9 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
eroman
11 years, 1 month ago (2009-11-12 07:57:51 UTC) #1
Erik does not do reviews
11 years, 1 month ago (2009-11-12 17:00:53 UTC) #2
LGTM - nice fix

Powered by Google App Engine
This is Rietveld 408576698