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

Side by Side Diff: chrome/browser/diagnostics/sqlite_diagnostics.cc

Issue 1064523002: [sql] Clients should use sql::Connection::Delete(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop unnecessary change. Created 5 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_log/activity_database_unittest.cc » ('j') | 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/diagnostics/sqlite_diagnostics.h" 5 #include "chrome/browser/diagnostics/sqlite_diagnostics.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 int outcome_code = GetOutcomeCode(); 49 int outcome_code = GetOutcomeCode();
50 if (flags_ & REMOVE_IF_CORRUPT) { 50 if (flags_ & REMOVE_IF_CORRUPT) {
51 switch (outcome_code) { 51 switch (outcome_code) {
52 case DIAG_SQLITE_ERROR_HANDLER_CALLED: 52 case DIAG_SQLITE_ERROR_HANDLER_CALLED:
53 case DIAG_SQLITE_CANNOT_OPEN_DB: 53 case DIAG_SQLITE_CANNOT_OPEN_DB:
54 case DIAG_SQLITE_DB_LOCKED: 54 case DIAG_SQLITE_DB_LOCKED:
55 case DIAG_SQLITE_PRAGMA_FAILED: 55 case DIAG_SQLITE_PRAGMA_FAILED:
56 case DIAG_SQLITE_DB_CORRUPTED: 56 case DIAG_SQLITE_DB_CORRUPTED:
57 LOG(WARNING) << "Removing broken SQLite database: " 57 LOG(WARNING) << "Removing broken SQLite database: "
58 << db_path_.value(); 58 << db_path_.value();
59 base::DeleteFile(db_path_, false); 59 sql::Connection::Delete(db_path_);
60 break; 60 break;
61 case DIAG_SQLITE_SUCCESS: 61 case DIAG_SQLITE_SUCCESS:
62 case DIAG_SQLITE_FILE_NOT_FOUND_OK: 62 case DIAG_SQLITE_FILE_NOT_FOUND_OK:
63 case DIAG_SQLITE_FILE_NOT_FOUND: 63 case DIAG_SQLITE_FILE_NOT_FOUND:
64 break; 64 break;
65 default: 65 default:
66 DCHECK(false) << "Invalid outcome code: " << outcome_code; 66 DCHECK(false) << "Invalid outcome code: " << outcome_code;
67 break; 67 break;
68 } 68 }
69 } 69 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 base::FilePath(history::kThumbnailsFilename)); 247 base::FilePath(history::kThumbnailsFilename));
248 } 248 }
249 249
250 DiagnosticsTest* MakeSqliteWebDataDbTest() { 250 DiagnosticsTest* MakeSqliteWebDataDbTest() {
251 return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL, 251 return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL,
252 DIAGNOSTICS_SQLITE_INTEGRITY_WEB_DATA_TEST, 252 DIAGNOSTICS_SQLITE_INTEGRITY_WEB_DATA_TEST,
253 base::FilePath(kWebDataFilename)); 253 base::FilePath(kWebDataFilename));
254 } 254 }
255 255
256 } // namespace diagnostics 256 } // namespace diagnostics
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/activity_log/activity_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698