Commit cc15a2e8 authored by sschmitz@chromium.org's avatar sschmitz@chromium.org

crbug.com/124865 - DCHECK failure when pinning Chrome Web Store to Launcher

CrOS Aura: Fix pinning Chrome Web Store to Launcher

When requesting to load the extension icon, we now check whether the ext. resource is empty. If so, we request DONT_CACHE (instead of CACHE). Caching fails two DCHECKS when the ext. resource is empty. Also the key involved in caching would be an empty string when the ext. resource is empty.

Earlier solution, later abandoned (reverted):
Icons are not required in extension or app manifests. Modified
Extension::HasCachedImage and Extension::SetCachedImage to not fail
a DCHECK nor to cache an image, if the ExtensionResource is empty.

See also the now obsolete: http://codereview.chromium.org/10823115/

BUG=124865
TEST=Click on Apps icon in the Launcher;
     Right click on Chrome Web Store;
     Select Pin to Launcher;
     Observe no DCHECK on Debug build on linux desktop

Review URL: https://chromiumcodereview.appspot.com/10830123

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150841 0039d316-1c4b-4281-b951-d872f2087c98
parent 268b3fdf
......@@ -311,7 +311,7 @@ void ImageLoadingTracker::OnImageLoaded(
// Add to the extension's image cache if requested.
DCHECK(info->cache != CACHE || info->extension);
if (should_cache && info->cache == CACHE &&
if (should_cache && info->cache == CACHE && !resource.empty() &&
!info->extension->HasCachedImage(resource, original_size)) {
info->extension->SetCachedImage(resource, image ? *image : SkBitmap(),
original_size);
......
......@@ -57,7 +57,7 @@ class ExtensionResource {
const FilePath& extension_root() const { return extension_root_; }
const FilePath& relative_path() const { return relative_path_; }
bool empty() { return extension_root().empty(); }
bool empty() const { return extension_root().empty(); }
// Unit test helpers.
FilePath::StringType NormalizeSeperators(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment