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

Side by Side Diff: sql/connection.h

Issue 8538031: export StatementRef (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef SQL_CONNECTION_H_ 5 #ifndef SQL_CONNECTION_H_
6 #define SQL_CONNECTION_H_ 6 #define SQL_CONNECTION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // Refcounting allows us to give these statements out to sql::Statement 287 // Refcounting allows us to give these statements out to sql::Statement
288 // objects while also optionally maintaining a cache of compiled statements 288 // objects while also optionally maintaining a cache of compiled statements
289 // by just keeping a refptr to these objects. 289 // by just keeping a refptr to these objects.
290 // 290 //
291 // A statement ref can be valid, in which case it can be used, or invalid to 291 // A statement ref can be valid, in which case it can be used, or invalid to
292 // indicate that the statement hasn't been created yet, has an error, or has 292 // indicate that the statement hasn't been created yet, has an error, or has
293 // been destroyed. 293 // been destroyed.
294 // 294 //
295 // The Connection may revoke a StatementRef in some error cases, so callers 295 // The Connection may revoke a StatementRef in some error cases, so callers
296 // should always check validity before using. 296 // should always check validity before using.
297 class StatementRef : public base::RefCounted<StatementRef> { 297 class SQL_EXPORT StatementRef : public base::RefCounted<StatementRef> {
298 public: 298 public:
299 // Default constructor initializes to an invalid statement. 299 // Default constructor initializes to an invalid statement.
300 StatementRef(); 300 StatementRef();
301 StatementRef(Connection* connection, sqlite3_stmt* stmt); 301 StatementRef(Connection* connection, sqlite3_stmt* stmt);
302 302
303 // When true, the statement can be used. 303 // When true, the statement can be used.
304 bool is_valid() const { return !!stmt_; } 304 bool is_valid() const { return !!stmt_; }
305 305
306 // If we've not been linked to a connection, this will be NULL. Guaranteed 306 // If we've not been linked to a connection, this will be NULL. Guaranteed
307 // non-NULL when is_valid(). 307 // non-NULL when is_valid().
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // This object handles errors resulting from all forms of executing sqlite 379 // This object handles errors resulting from all forms of executing sqlite
380 // commands or statements. It can be null which means default handling. 380 // commands or statements. It can be null which means default handling.
381 scoped_refptr<ErrorDelegate> error_delegate_; 381 scoped_refptr<ErrorDelegate> error_delegate_;
382 382
383 DISALLOW_COPY_AND_ASSIGN(Connection); 383 DISALLOW_COPY_AND_ASSIGN(Connection);
384 }; 384 };
385 385
386 } // namespace sql 386 } // namespace sql
387 387
388 #endif // SQL_CONNECTION_H_ 388 #endif // SQL_CONNECTION_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698