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

Side by Side Diff: chrome/browser/history/thumbnail_database.cc

Issue 11830007: Avoid sending notifications when the bitmap data in history has not changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split the changes to MergeFavicon() and SetFavicons() into two CLs as only the changes to MergeFavi… Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/thumbnail_database.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/thumbnail_database.h" 5 #include "chrome/browser/history/thumbnail_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 static_cast<int>(bitmap_data->size())); 590 static_cast<int>(bitmap_data->size()));
591 } else { 591 } else {
592 statement.BindNull(0); 592 statement.BindNull(0);
593 } 593 }
594 statement.BindInt64(1, time.ToInternalValue()); 594 statement.BindInt64(1, time.ToInternalValue());
595 statement.BindInt64(2, bitmap_id); 595 statement.BindInt64(2, bitmap_id);
596 596
597 return statement.Run(); 597 return statement.Run();
598 } 598 }
599 599
600 bool ThumbnailDatabase::SetFaviconBitmapLastUpdateTime(
601 FaviconBitmapID bitmap_id,
602 base::Time time) {
603 DCHECK(bitmap_id);
604 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
605 "UPDATE favicon_bitmaps SET last_updated=? WHERE id=?"));
606 statement.BindInt64(0, time.ToInternalValue());
607 statement.BindInt64(1, bitmap_id);
608 return statement.Run();
609 }
610
600 bool ThumbnailDatabase::DeleteFaviconBitmapsForFavicon(FaviconID icon_id) { 611 bool ThumbnailDatabase::DeleteFaviconBitmapsForFavicon(FaviconID icon_id) {
601 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, 612 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
602 "DELETE FROM favicon_bitmaps WHERE icon_id=?")); 613 "DELETE FROM favicon_bitmaps WHERE icon_id=?"));
603 statement.BindInt64(0, icon_id); 614 statement.BindInt64(0, icon_id);
604 return statement.Run(); 615 return statement.Run();
605 } 616 }
606 617
607 bool ThumbnailDatabase::DeleteFaviconBitmap(FaviconBitmapID bitmap_id) { 618 bool ThumbnailDatabase::DeleteFaviconBitmap(FaviconBitmapID bitmap_id) {
608 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, 619 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
609 "DELETE FROM favicon_bitmaps WHERE id=?")); 620 "DELETE FROM favicon_bitmaps WHERE id=?"));
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 } 1156 }
1146 parsing_errors |= !base::StringToInt(t.token(), &height); 1157 parsing_errors |= !base::StringToInt(t.token(), &height);
1147 favicon_sizes->push_back(gfx::Size(width, height)); 1158 favicon_sizes->push_back(gfx::Size(width, height));
1148 } 1159 }
1149 1160
1150 if (parsing_errors) 1161 if (parsing_errors)
1151 favicon_sizes->clear(); 1162 favicon_sizes->clear();
1152 } 1163 }
1153 1164
1154 } // namespace history 1165 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/thumbnail_database.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698