Index: chrome/browser/history/top_sites.cc |
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc |
index 71d3316cbb1bfe15adc2b82dad942d7e1fd858e7..2d38aec9cb70246119483b253a67ade92772f047 100644 |
--- a/chrome/browser/history/top_sites.cc |
+++ b/chrome/browser/history/top_sites.cc |
@@ -247,6 +247,15 @@ bool TopSites::GetPageThumbnail(const GURL& url, |
scoped_refptr<RefCountedBytes>* bytes) { |
// WARNING: this may be invoked on any thread. |
base::AutoLock lock(lock_); |
sky
2011/04/11 14:31:09
The rest of the class doesn't lock around lock_ wh
satorux1
2011/04/11 15:19:09
That makes a lot of sense. I've updated the patch
|
+ |
+ // The thumbnail may be found in the temporary images. |
+ for (TempImages::iterator i = temp_images_.begin(); i != temp_images_.end(); |
+ ++i) { |
+ if (i->first == url) { |
+ *bytes = i->second.thumbnail; |
+ return true; |
+ } |
+ } |
return thread_safe_cache_->GetPageThumbnail(url, bytes); |
} |
@@ -254,6 +263,15 @@ bool TopSites::GetPageThumbnailScore(const GURL& url, |
ThumbnailScore* score) { |
// WARNING: this may be invoked on any thread. |
base::AutoLock lock(lock_); |
+ |
+ // The thumbnail score may be found in the temporary images. |
+ for (TempImages::iterator i = temp_images_.begin(); i != temp_images_.end(); |
+ ++i) { |
+ if (i->first == url) { |
+ *score = i->second.thumbnail_score; |
+ return true; |
+ } |
+ } |
return thread_safe_cache_->GetPageThumbnailScore(url, score); |
} |