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

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

Issue 10831341: Change HistoryAndBookmarkRow favicon_ field to be scoped_refptr<base::RefCountedMemory> (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
diff --git a/chrome/browser/history/android/favicon_sql_handler.cc b/chrome/browser/history/android/favicon_sql_handler.cc
index b52aef421d29f906d1d53f17511928bf7506d07d..0d68af5755ac273f9cfa17465cc586ebacc13aa4 100644
--- a/chrome/browser/history/android/favicon_sql_handler.cc
+++ b/chrome/browser/history/android/favicon_sql_handler.cc
@@ -32,15 +32,14 @@ FaviconSQLHandler::~FaviconSQLHandler() {
bool FaviconSQLHandler::Update(const HistoryAndBookmarkRow& row,
const TableIDRows& ids_set) {
FaviconID favicon_id = 0;
- if (!row.favicon().empty()) {
+ if (row.favicon_valid()) {
// 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 =
- new base::RefCountedBytes(row.favicon());
+ scoped_refptr<base::RefCountedMemory> image_data = row.favicon();
if (!thumbnail_db_->SetFavicon(favicon_id, image_data, Time::Now()))
return false;
}
@@ -105,7 +104,7 @@ bool FaviconSQLHandler::Delete(const TableIDRows& ids_set) {
bool FaviconSQLHandler::Insert(HistoryAndBookmarkRow* row) {
if (!row->is_value_set_explicitly(HistoryAndBookmarkRow::FAVICON) ||
- row->favicon().empty())
+ !row->favicon_valid())
return true;
DCHECK(row->is_value_set_explicitly(HistoryAndBookmarkRow::URL));
@@ -115,8 +114,7 @@ bool FaviconSQLHandler::Insert(HistoryAndBookmarkRow* row) {
if (!id)
return false;
- scoped_refptr<base::RefCountedMemory> image_data =
- new base::RefCountedBytes(row->favicon());
+ scoped_refptr<base::RefCountedMemory> image_data = 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