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

Side by Side Diff: chrome/browser/extensions/image_loading_tracker.cc

Issue 10830123: crbug.com/124865 - DCHECK failure when pinning Chrome Web Store to Launcher (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: revert file to master version: launcher_app_icon_loader.cc Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/extension_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/image_loading_tracker.h" 5 #include "chrome/browser/extensions/image_loading_tracker.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 PendingLoadInfo* info = &load_map_it->second; 304 PendingLoadInfo* info = &load_map_it->second;
305 305
306 // Save the pending results. 306 // Save the pending results.
307 DCHECK(info->pending_count > 0); 307 DCHECK(info->pending_count > 0);
308 info->pending_count--; 308 info->pending_count--;
309 if (image) 309 if (image)
310 info->bitmaps.push_back(*image); 310 info->bitmaps.push_back(*image);
311 311
312 // Add to the extension's image cache if requested. 312 // Add to the extension's image cache if requested.
313 DCHECK(info->cache != CACHE || info->extension); 313 DCHECK(info->cache != CACHE || info->extension);
314 if (should_cache && info->cache == CACHE && 314 if (should_cache && info->cache == CACHE && !resource.empty() &&
315 !info->extension->HasCachedImage(resource, original_size)) { 315 !info->extension->HasCachedImage(resource, original_size)) {
316 info->extension->SetCachedImage(resource, image ? *image : SkBitmap(), 316 info->extension->SetCachedImage(resource, image ? *image : SkBitmap(),
317 original_size); 317 original_size);
318 } 318 }
319 319
320 // If all pending images are done then report back. 320 // If all pending images are done then report back.
321 if (info->pending_count == 0) { 321 if (info->pending_count == 0) {
322 gfx::Image image; 322 gfx::Image image;
323 std::string extension_id = info->extension_id; 323 std::string extension_id = info->extension_id;
324 324
(...skipping 27 matching lines...) Expand all
352 // Remove reference to this extension from all pending load entries. This 352 // Remove reference to this extension from all pending load entries. This
353 // ensures we don't attempt to cache the image when the load completes. 353 // ensures we don't attempt to cache the image when the load completes.
354 for (LoadMap::iterator i = load_map_.begin(); i != load_map_.end(); ++i) { 354 for (LoadMap::iterator i = load_map_.begin(); i != load_map_.end(); ++i) {
355 PendingLoadInfo* info = &i->second; 355 PendingLoadInfo* info = &i->second;
356 if (info->extension == extension) { 356 if (info->extension == extension) {
357 info->extension = NULL; 357 info->extension = NULL;
358 info->cache = DONT_CACHE; 358 info->cache = DONT_CACHE;
359 } 359 }
360 } 360 }
361 } 361 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698