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

Side by Side Diff: sql/connection.cc

Issue 1832173002: [sql] Database recovery system for Shortcuts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments from #9 and #10. Created 4 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
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 "sql/connection.h" 5 #include "sql/connection.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 259
260 // static 260 // static
261 void Connection::set_mmap_disabled_by_default() { 261 void Connection::set_mmap_disabled_by_default() {
262 g_mmap_disabled_default = true; 262 g_mmap_disabled_default = true;
263 } 263 }
264 264
265 265
266 void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) { 266 void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) {
267 AssertIOAllowed(); 267 AssertIOAllowed();
268 268
269 // Trim extended error codes.
270 const int error = (extended_error & 0xFF);
269 std::string debug_info; 271 std::string debug_info;
270 const int error = (extended_error & 0xFF);
271 if (error == SQLITE_CORRUPT) { 272 if (error == SQLITE_CORRUPT) {
272 // CollectCorruptionInfo() is implemented in terms of sql::Connection, 273 // CollectCorruptionInfo() is implemented in terms of sql::Connection,
273 // prevent reentrant calls to the error callback. 274 // prevent reentrant calls to the error callback.
274 // TODO(shess): Rewrite IntegrityCheckHelper() in terms of raw SQLite. 275 // TODO(shess): Rewrite IntegrityCheckHelper() in terms of raw SQLite.
275 ErrorCallback original_callback = std::move(error_callback_); 276 ErrorCallback original_callback = std::move(error_callback_);
276 reset_error_callback(); 277 reset_error_callback();
277 278
278 debug_info = CollectCorruptionInfo(); 279 debug_info = CollectCorruptionInfo();
279 280
280 error_callback_ = std::move(original_callback); 281 error_callback_ = std::move(original_callback);
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1982 ignore_result(Execute(kNoWritableSchema)); 1983 ignore_result(Execute(kNoWritableSchema));
1983 1984
1984 return ret; 1985 return ret;
1985 } 1986 }
1986 1987
1987 base::TimeTicks TimeSource::Now() { 1988 base::TimeTicks TimeSource::Now() {
1988 return base::TimeTicks::Now(); 1989 return base::TimeTicks::Now();
1989 } 1990 }
1990 1991
1991 } // namespace sql 1992 } // namespace sql
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698