diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-18 09:13:27 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-18 09:13:27 +0000 |
commit | a014b4f5eacdd3907ad04c8de41ea98f0a08e58c (patch) | |
tree | 18260384c138c2c02e010a03b76811fbbc824bff | |
parent | 18170159cf15fde40430a4cf25509dc3ee6085f6 (diff) | |
download | chromium_src-a014b4f5eacdd3907ad04c8de41ea98f0a08e58c.zip chromium_src-a014b4f5eacdd3907ad04c8de41ea98f0a08e58c.tar.gz chromium_src-a014b4f5eacdd3907ad04c8de41ea98f0a08e58c.tar.bz2 |
Don't DCHECK being on the UI thread in failed callback handler.
If a thumbnail request fails because the browser is shutting down. In
that case the failure may be executed after the browser UI thread
is being closed, and the CurrentlyOn(content::BrowserThread::UI)
check will fail.
So move this check to only be executed when the ProcessCapturedBitmap
result is successful, and the function is going to do any work.
R=sky
BUG=270918
Review URL: https://codereview.chromium.org/141273011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245767 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/thumbnails/thumbnail_tab_helper.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/thumbnails/thumbnail_tab_helper.cc index 2e3d47a..17f68f1 100644 --- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc +++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc @@ -66,10 +66,13 @@ void ProcessCapturedBitmap(scoped_refptr<ThumbnailingContext> context, scoped_refptr<ThumbnailingAlgorithm> algorithm, bool succeeded, const SkBitmap& bitmap) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); if (!succeeded) return; + // On success, we must be on the UI thread (on failure because of shutdown we + // are not on the UI thread). + DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + algorithm->ProcessBitmap(context, base::Bind(&UpdateThumbnail), bitmap); } |