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

Unified Diff: chrome/browser/history/top_sites.cc

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/top_sites_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites.cc
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc
index 1c6f67f9e1353806ed56411a564ac73384c3d336..efd2f8d117e0beb64794237916b23b9d0570f073 100644
--- a/chrome/browser/history/top_sites.cc
+++ b/chrome/browser/history/top_sites.cc
@@ -605,8 +605,9 @@ bool TopSites::EncodeBitmap(const SkBitmap& bitmap,
return false;
}
// As we're going to cache this data, make sure the vector is only as big as
- // it needs to be.
- (*bytes)->data = data;
+ // it needs to be, as JPEGCodec::Encode() over-allocates data.capacity().
+ // (In a C++0x future, we can just call shrink_to_fit() in Encode())
+ (*bytes)->data() = data;
return true;
}
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/top_sites_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698