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

Side by Side Diff: app/sql/connection.cc

Issue 223003: Add basic sqlite error handling to the new sqlite handlers... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « app/sql/connection.h ('k') | app/sql/statement.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/sql/connection.h" 5 #include "app/sql/connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "app/sql/statement.h" 9 #include "app/sql/statement.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 statement_cache_.clear(); 306 statement_cache_.clear();
307 307
308 // The cache clear will get most statements. There may be still be references 308 // The cache clear will get most statements. There may be still be references
309 // to some statements that are held by others (including one-shot statements). 309 // to some statements that are held by others (including one-shot statements).
310 // This will deactivate them so they can't be used again. 310 // This will deactivate them so they can't be used again.
311 for (StatementRefSet::iterator i = open_statements_.begin(); 311 for (StatementRefSet::iterator i = open_statements_.begin();
312 i != open_statements_.end(); ++i) 312 i != open_statements_.end(); ++i)
313 (*i)->Close(); 313 (*i)->Close();
314 } 314 }
315 315
316 int Connection::OnSqliteError(int err, sql::Statement *stmt) {
317 if (error_delegate_.get())
318 return error_delegate_->OnError(err, this, stmt);
319 // The default handling is to assert on debug and to ignore on release.
320 NOTREACHED() << GetErrorMessage();
321 return err;
322 }
323
316 } // namespace sql 324 } // namespace sql
OLDNEW
« no previous file with comments | « app/sql/connection.h ('k') | app/sql/statement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698