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

Side by Side Diff: sql/connection.cc

Issue 9839021: Reset needs_rollback after rollback. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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 | sql/connection_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 "sql/connection.h" 5 #include "sql/connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 Close(); 449 Close();
450 return false; 450 return false;
451 } 451 }
452 452
453 return true; 453 return true;
454 } 454 }
455 455
456 void Connection::DoRollback() { 456 void Connection::DoRollback() {
457 Statement rollback(GetCachedStatement(SQL_FROM_HERE, "ROLLBACK")); 457 Statement rollback(GetCachedStatement(SQL_FROM_HERE, "ROLLBACK"));
458 rollback.Run(); 458 rollback.Run();
459 needs_rollback_ = false;
459 } 460 }
460 461
461 void Connection::StatementRefCreated(StatementRef* ref) { 462 void Connection::StatementRefCreated(StatementRef* ref) {
462 DCHECK(open_statements_.find(ref) == open_statements_.end()); 463 DCHECK(open_statements_.find(ref) == open_statements_.end());
463 open_statements_.insert(ref); 464 open_statements_.insert(ref);
464 } 465 }
465 466
466 void Connection::StatementRefDeleted(StatementRef* ref) { 467 void Connection::StatementRefDeleted(StatementRef* ref) {
467 StatementRefSet::iterator i = open_statements_.find(ref); 468 StatementRefSet::iterator i = open_statements_.find(ref);
468 if (i == open_statements_.end()) 469 if (i == open_statements_.end())
(...skipping 15 matching lines...) Expand all
484 485
485 int Connection::OnSqliteError(int err, sql::Statement *stmt) { 486 int Connection::OnSqliteError(int err, sql::Statement *stmt) {
486 if (error_delegate_.get()) 487 if (error_delegate_.get())
487 return error_delegate_->OnError(err, this, stmt); 488 return error_delegate_->OnError(err, this, stmt);
488 // The default handling is to assert on debug and to ignore on release. 489 // The default handling is to assert on debug and to ignore on release.
489 DLOG(FATAL) << GetErrorMessage(); 490 DLOG(FATAL) << GetErrorMessage();
490 return err; 491 return err;
491 } 492 }
492 493
493 } // namespace sql 494 } // namespace sql
OLDNEW
« no previous file with comments | « no previous file | sql/connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698