diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-23 16:39:56 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-23 16:39:56 +0000 |
commit | 6cfc78d9e34582985e582cb4cafd1fcb0993762a (patch) | |
tree | e6cca3e6b28bf8cd686071a32ed0f49db2554124 /chrome/browser/extensions/image_loading_tracker.cc | |
parent | b7309daac064d464f81240bcb8c69b1a66a1d661 (diff) | |
download | chromium_src-6cfc78d9e34582985e582cb4cafd1fcb0993762a.zip chromium_src-6cfc78d9e34582985e582cb4cafd1fcb0993762a.tar.gz chromium_src-6cfc78d9e34582985e582cb4cafd1fcb0993762a.tar.bz2 |
Adds access to the index passed to ImageLoadingTracker::Observer. I need
this for an observer implementation so that I can identify the request
I made when OnImageLoaded is invoked.
BUG=110827
TEST=none
R=finnur@chromium.org
Review URL: http://codereview.chromium.org/9159027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/image_loading_tracker.cc')
-rw-r--r-- | chrome/browser/extensions/image_loading_tracker.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/extensions/image_loading_tracker.cc b/chrome/browser/extensions/image_loading_tracker.cc index e8d7351..ca60dba 100644 --- a/chrome/browser/extensions/image_loading_tracker.cc +++ b/chrome/browser/extensions/image_loading_tracker.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -156,9 +156,8 @@ void ImageLoadingTracker::LoadImage(const Extension* extension, return; } - if (cache == CACHE) { + if (cache == CACHE) load_map_[id] = extension; - } // Instruct the ImageLoader to load this on the File thread. LoadImage does // not block. @@ -193,10 +192,9 @@ void ImageLoadingTracker::Observe(int type, // Remove all entries in the load_map_ referencing the extension. This ensures // we don't attempt to cache the image when the load completes. for (LoadMap::iterator i = load_map_.begin(); i != load_map_.end();) { - if (i->second == extension) { + if (i->second == extension) load_map_.erase(i++); - } else { + else ++i; - } } } |