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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 sql::Statement attach(db_.GetUniqueStatement("ATTACH ? AS new_favicons")); | 983 sql::Statement attach(db_.GetUniqueStatement("ATTACH ? AS new_favicons")); |
984 if (!attach.is_valid()) { | 984 if (!attach.is_valid()) { |
985 // Keep the transaction open, even though we failed. | 985 // Keep the transaction open, even though we failed. |
986 BeginTransaction(); | 986 BeginTransaction(); |
987 return false; | 987 return false; |
988 } | 988 } |
989 | 989 |
990 #if defined(OS_POSIX) | 990 #if defined(OS_POSIX) |
991 attach.BindString(0, new_db_file.value()); | 991 attach.BindString(0, new_db_file.value()); |
992 #else | 992 #else |
993 attach.BindString(0, WideToUTF8(new_db_file.value())); | 993 attach.BindString(0, base::WideToUTF8(new_db_file.value())); |
994 #endif | 994 #endif |
995 | 995 |
996 if (!attach.Run()) { | 996 if (!attach.Run()) { |
997 BeginTransaction(); | 997 BeginTransaction(); |
998 return false; | 998 return false; |
999 } | 999 } |
1000 } | 1000 } |
1001 | 1001 |
1002 // Move favicons and favicon_bitmaps to new DB. | 1002 // Move favicons and favicon_bitmaps to new DB. |
1003 bool successfully_moved_data = | 1003 bool successfully_moved_data = |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 } | 1164 } |
1165 parsing_errors |= !base::StringToInt(t.token(), &height); | 1165 parsing_errors |= !base::StringToInt(t.token(), &height); |
1166 favicon_sizes->push_back(gfx::Size(width, height)); | 1166 favicon_sizes->push_back(gfx::Size(width, height)); |
1167 } | 1167 } |
1168 | 1168 |
1169 if (parsing_errors) | 1169 if (parsing_errors) |
1170 favicon_sizes->clear(); | 1170 favicon_sizes->clear(); |
1171 } | 1171 } |
1172 | 1172 |
1173 } // namespace history | 1173 } // namespace history |
OLD | NEW |