| OLD | NEW |
| 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 } | 687 } |
| 688 | 688 |
| 689 bool ThumbnailDatabase::DeleteIconMappings(const GURL& page_url) { | 689 bool ThumbnailDatabase::DeleteIconMappings(const GURL& page_url) { |
| 690 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, | 690 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, |
| 691 "DELETE FROM icon_mapping WHERE page_url = ?")); | 691 "DELETE FROM icon_mapping WHERE page_url = ?")); |
| 692 statement.BindString(0, URLDatabase::GURLToDatabaseURL(page_url)); | 692 statement.BindString(0, URLDatabase::GURLToDatabaseURL(page_url)); |
| 693 | 693 |
| 694 return statement.Run(); | 694 return statement.Run(); |
| 695 } | 695 } |
| 696 | 696 |
| 697 bool ThumbnailDatabase::DeleteIconMapping(IconMappingID mapping_id) { |
| 698 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, |
| 699 "DELETE FROM icon_mapping WHERE id=?")); |
| 700 statement.BindInt64(0, mapping_id); |
| 701 |
| 702 return statement.Run(); |
| 703 } |
| 704 |
| 697 bool ThumbnailDatabase::HasMappingFor(FaviconID id) { | 705 bool ThumbnailDatabase::HasMappingFor(FaviconID id) { |
| 698 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, | 706 sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, |
| 699 "SELECT id FROM icon_mapping " | 707 "SELECT id FROM icon_mapping " |
| 700 "WHERE icon_id=?")); | 708 "WHERE icon_id=?")); |
| 701 statement.BindInt64(0, id); | 709 statement.BindInt64(0, id); |
| 702 | 710 |
| 703 return statement.Step(); | 711 return statement.Step(); |
| 704 } | 712 } |
| 705 | 713 |
| 706 bool ThumbnailDatabase::CloneIconMappings(const GURL& old_page_url, | 714 bool ThumbnailDatabase::CloneIconMappings(const GURL& old_page_url, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 } | 1044 } |
| 1037 parsing_errors |= !base::StringToInt(t.token(), &height); | 1045 parsing_errors |= !base::StringToInt(t.token(), &height); |
| 1038 favicon_sizes->push_back(gfx::Size(width, height)); | 1046 favicon_sizes->push_back(gfx::Size(width, height)); |
| 1039 } | 1047 } |
| 1040 | 1048 |
| 1041 if (parsing_errors) | 1049 if (parsing_errors) |
| 1042 favicon_sizes->clear(); | 1050 favicon_sizes->clear(); |
| 1043 } | 1051 } |
| 1044 | 1052 |
| 1045 } // namespace history | 1053 } // namespace history |
| OLD | NEW |