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

Unified Diff: chrome/browser/history/android/favicon_sql_handler.cc

Issue 10857065: Revert 152162 - Change HistoryAndBookmarkRow favicon_ field to be scoped_refptr<base::RefCountedMem… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/android/android_provider_backend_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/android/favicon_sql_handler.cc
===================================================================
--- chrome/browser/history/android/favicon_sql_handler.cc (revision 152168)
+++ chrome/browser/history/android/favicon_sql_handler.cc (working copy)
@@ -32,14 +32,15 @@
bool FaviconSQLHandler::Update(const HistoryAndBookmarkRow& row,
const TableIDRows& ids_set) {
FaviconID favicon_id = 0;
- if (row.favicon_valid()) {
+ if (!row.favicon().empty()) {
// If the image_data will be updated, it is not reasonable to find if the
// icon is already in database, just create a new favicon.
favicon_id = thumbnail_db_->AddFavicon(GURL(), history::FAVICON);
if (!favicon_id)
return false;
- scoped_refptr<base::RefCountedMemory> image_data = row.favicon();
+ scoped_refptr<base::RefCountedMemory> image_data =
+ new base::RefCountedBytes(row.favicon());
if (!thumbnail_db_->SetFavicon(favicon_id, image_data, Time::Now()))
return false;
}
@@ -104,7 +105,7 @@
bool FaviconSQLHandler::Insert(HistoryAndBookmarkRow* row) {
if (!row->is_value_set_explicitly(HistoryAndBookmarkRow::FAVICON) ||
- !row->favicon_valid())
+ row->favicon().empty())
return true;
DCHECK(row->is_value_set_explicitly(HistoryAndBookmarkRow::URL));
@@ -114,7 +115,8 @@
if (!id)
return false;
- scoped_refptr<base::RefCountedMemory> image_data = row->favicon();
+ scoped_refptr<base::RefCountedMemory> image_data =
+ new base::RefCountedBytes(row->favicon());
if (!thumbnail_db_->SetFavicon(id, image_data, Time::Now()))
return false;
return thumbnail_db_->AddIconMapping(row->url(), id);
« no previous file with comments | « chrome/browser/history/android/android_provider_backend_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698