Chromium Code Reviews

Side by Side Diff: components/history/core/browser/thumbnail_database.cc

Issue 1666473003: [sql] Remove misleading AutoRecoverTable() parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Give me a night to think about it, and I'll make a pointless change. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | components/history/core/browser/top_sites_database.cc » ('j') | sql/recovery.cc » ('J')
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 "components/history/core/browser/thumbnail_database.h" 5 #include "components/history/core/browser/thumbnail_database.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 334 matching lines...)
345 // 345 //
346 // What are the potential responses, even? The recovery database 346 // What are the potential responses, even? The recovery database
347 // could be opened as in-memory. If the temp database had a 347 // could be opened as in-memory. If the temp database had a
348 // filesystem problem and the temp filesystem differs from the 348 // filesystem problem and the temp filesystem differs from the
349 // main database, then that could fix it. 349 // main database, then that could fix it.
350 sql::Recovery::Rollback(std::move(recovery)); 350 sql::Recovery::Rollback(std::move(recovery));
351 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_INIT); 351 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_INIT);
352 return; 352 return;
353 } 353 }
354 354
355 if (!recovery->AutoRecoverTable("favicons", 0, &favicons_rows_recovered)) { 355 if (!recovery->AutoRecoverTable("favicons", &favicons_rows_recovered)) {
356 sql::Recovery::Rollback(std::move(recovery)); 356 sql::Recovery::Rollback(std::move(recovery));
357 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICONS); 357 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICONS);
358 return; 358 return;
359 } 359 }
360 if (!recovery->AutoRecoverTable("favicon_bitmaps", 0, 360 if (!recovery->AutoRecoverTable("favicon_bitmaps",
361 &favicon_bitmaps_rows_recovered)) { 361 &favicon_bitmaps_rows_recovered)) {
362 sql::Recovery::Rollback(std::move(recovery)); 362 sql::Recovery::Rollback(std::move(recovery));
363 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICON_BITMAPS); 363 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICON_BITMAPS);
364 return; 364 return;
365 } 365 }
366 if (!recovery->AutoRecoverTable("icon_mapping", 0, 366 if (!recovery->AutoRecoverTable("icon_mapping",
367 &icon_mapping_rows_recovered)) { 367 &icon_mapping_rows_recovered)) {
368 sql::Recovery::Rollback(std::move(recovery)); 368 sql::Recovery::Rollback(std::move(recovery));
369 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_ICON_MAPPING); 369 RecordRecoveryEvent(RECOVERY_EVENT_FAILED_AUTORECOVER_ICON_MAPPING);
370 return; 370 return;
371 } 371 }
372 372
373 // TODO(shess): Is it possible/likely to have broken foreign-key 373 // TODO(shess): Is it possible/likely to have broken foreign-key
374 // issues with the tables? 374 // issues with the tables?
375 // - icon_mapping.icon_id maps to no favicons.id 375 // - icon_mapping.icon_id maps to no favicons.id
376 // - favicon_bitmaps.icon_id maps to no favicons.id 376 // - favicon_bitmaps.icon_id maps to no favicons.id
(...skipping 860 matching lines...)
1237 meta_table_.SetVersionNumber(8); 1237 meta_table_.SetVersionNumber(8);
1238 meta_table_.SetCompatibleVersionNumber(std::min(8, kCompatibleVersionNumber)); 1238 meta_table_.SetCompatibleVersionNumber(std::min(8, kCompatibleVersionNumber));
1239 return true; 1239 return true;
1240 } 1240 }
1241 1241
1242 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { 1242 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() {
1243 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); 1243 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons");
1244 } 1244 }
1245 1245
1246 } // namespace history 1246 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | components/history/core/browser/top_sites_database.cc » ('j') | sql/recovery.cc » ('J')

Powered by Google App Engine