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

Issue 3061009: Speculative fix for crash in DOMUIThumbnailSource. (Closed)

Created:
10 years, 5 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
Reviewers:
tony, Evan Martin
CC:
chromium-reviews, ben+cc_chromium.org, brettw-cc_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Speculative fix for crash in DOMUIThumbnailSource. DOMUIThumbnailSource objects are deleted on the IO thread, while they are used on the UI thread. The DataSource documentation says that they should not live on the IO thread, but for almost all DataSources, the only reference held is the one by ChromeURLDataManager, which lives on the IO thread. Since I had a racy stack where the object was being used on the UI thread while its destructor was running on the IO thread, forcing destruction on the UI thread should fix the crash. Pretty much everything but changing the templated base class of DataSource to always DeleteOnUIThread is my usual cleanup. BUG=34115 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53873

Patch Set 1 #

Total comments: 7

Patch Set 2 : update #

Total comments: 1

Patch Set 3 : msvc++ caught this #

Unified diffs Side-by-side diffs Delta from patch set Stats (+155 lines, -77 lines) Patch
M base/base.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M base/ref_counted_memory.h View 1 3 chunks +9 lines, -18 lines 0 comments Download
A base/ref_counted_memory.cc View 1 1 chunk +37 lines, -0 lines 0 comments Download
M chrome/browser/dom_ui/chrome_url_data_manager.h View 1 2 4 chunks +19 lines, -11 lines 0 comments Download
M chrome/browser/dom_ui/chrome_url_data_manager.cc View 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/dom_ui/dom_ui_favicon_source.h View 1 3 chunks +3 lines, -7 lines 0 comments Download
M chrome/browser/dom_ui/dom_ui_favicon_source.cc View 1 4 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/dom_ui/dom_ui_theme_source.h View 1 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/dom_ui/dom_ui_theme_source.cc View 1 3 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/dom_ui/dom_ui_thumbnail_source.h View 1 4 chunks +3 lines, -13 lines 0 comments Download
M chrome/browser/dom_ui/dom_ui_thumbnail_source.cc View 1 4 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/dom_ui/most_visited_handler.h View 1 4 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/dom_ui/most_visited_handler.cc View 1 3 chunks +22 lines, -10 lines 0 comments Download
M chrome/browser/dom_ui/new_tab_ui.h View 1 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/dom_ui/new_tab_ui.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Elliot Glaysher
10 years, 5 months ago (2010-07-23 23:11:06 UTC) #1
Elliot Glaysher
ping?
10 years, 4 months ago (2010-07-26 21:20:27 UTC) #2
Elliot Glaysher
Can you review this, tony? (The other person who's worked around here, according to git)
10 years, 4 months ago (2010-07-27 00:52:52 UTC) #3
tony
I am confused by how the destructor was running while code was running on the ...
10 years, 4 months ago (2010-07-27 16:55:17 UTC) #4
Elliot Glaysher
> I am confused by how the destructor was running while code was running on ...
10 years, 4 months ago (2010-07-27 17:39:25 UTC) #5
Elliot Glaysher
Talked to Darin: http://codereview.chromium.org/3061009/diff/1/3 File base/ref_counted_memory.cc (right): http://codereview.chromium.org/3061009/diff/1/3#newcode7 base/ref_counted_memory.cc:7: RefCountedMemory::~RefCountedMemory() { On 2010/07/27 16:55:17, tony ...
10 years, 4 months ago (2010-07-27 18:11:39 UTC) #6
tony
10 years, 4 months ago (2010-07-27 18:47:22 UTC) #7
LGTM.

I think it would be better to leave all empty virtual destructors in header
files so the compiler can optimize (and so it's easier to remember whether to do
this or not), but I don't think the time difference is measurable.

http://codereview.chromium.org/3061009/diff/10001/11015
File chrome/browser/dom_ui/new_tab_ui.h (right):

http://codereview.chromium.org/3061009/diff/10001/11015#newcode70
chrome/browser/dom_ui/new_tab_ui.h:70: virtual ~NewTabHTMLSource();
Nit: This seems safe to put the empty body here.

Powered by Google App Engine
This is Rietveld 408576698