OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class Database; | 38 class Database; |
39 class SQLStatementBackend; | 39 class SQLStatementBackend; |
40 class SQLStatementCallback; | 40 class SQLStatementCallback; |
41 class SQLStatementErrorCallback; | 41 class SQLStatementErrorCallback; |
42 class SQLTransaction; | 42 class SQLTransaction; |
43 | 43 |
44 class SQLStatement final : public GarbageCollectedFinalized<SQLStatement> { | 44 class SQLStatement final : public GarbageCollected<SQLStatement> { |
45 public: | 45 public: |
46 static SQLStatement* create(Database*, SQLStatementCallback*, SQLStatementEr
rorCallback*); | 46 static SQLStatement* create(Database*, SQLStatementCallback*, SQLStatementEr
rorCallback*); |
47 ~SQLStatement(); | |
48 DECLARE_TRACE(); | 47 DECLARE_TRACE(); |
49 | 48 |
50 bool performCallback(SQLTransaction*); | 49 bool performCallback(SQLTransaction*); |
51 | 50 |
52 void setBackend(SQLStatementBackend*); | 51 void setBackend(SQLStatementBackend*); |
53 | 52 |
54 bool hasCallback(); | 53 bool hasCallback(); |
55 bool hasErrorCallback(); | 54 bool hasErrorCallback(); |
56 | 55 |
57 private: | 56 private: |
58 SQLStatement(Database*, SQLStatementCallback*, SQLStatementErrorCallback*); | 57 SQLStatement(Database*, SQLStatementCallback*, SQLStatementErrorCallback*); |
59 | 58 |
60 // The SQLStatementBackend owns the SQLStatement. Hence, the backend is | 59 // The SQLStatementBackend owns the SQLStatement. Hence, the backend is |
61 // guaranteed to be outlive the SQLStatement, and it is safe for us to refer | 60 // guaranteed to be outlive the SQLStatement, and it is safe for us to refer |
62 // to the backend using a raw pointer here. | 61 // to the backend using a raw pointer here. |
63 Member<SQLStatementBackend> m_backend; | 62 Member<SQLStatementBackend> m_backend; |
64 | 63 |
65 Member<SQLStatementCallback> m_statementCallback; | 64 Member<SQLStatementCallback> m_statementCallback; |
66 Member<SQLStatementErrorCallback> m_statementErrorCallback; | 65 Member<SQLStatementErrorCallback> m_statementErrorCallback; |
67 }; | 66 }; |
68 | 67 |
69 } // namespace blink | 68 } // namespace blink |
70 | 69 |
71 #endif // SQLStatement_h | 70 #endif // SQLStatement_h |
OLD | NEW |