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 GarbageCollected<SQLStatement> { | 44 class SQLStatement final : public GarbageCollectedFinalized<SQLStatement> { |
45 public: | 45 public: |
46 static SQLStatement* create(Database*, SQLStatementCallback*, SQLStatementEr
rorCallback*); | 46 static SQLStatement* create(Database*, SQLStatementCallback*, SQLStatementEr
rorCallback*); |
| 47 ~SQLStatement(); |
47 DECLARE_TRACE(); | 48 DECLARE_TRACE(); |
48 | 49 |
49 bool performCallback(SQLTransaction*); | 50 bool performCallback(SQLTransaction*); |
50 | 51 |
51 void setBackend(SQLStatementBackend*); | 52 void setBackend(SQLStatementBackend*); |
52 | 53 |
53 bool hasCallback(); | 54 bool hasCallback(); |
54 bool hasErrorCallback(); | 55 bool hasErrorCallback(); |
55 | 56 |
56 private: | 57 private: |
57 SQLStatement(Database*, SQLStatementCallback*, SQLStatementErrorCallback*); | 58 SQLStatement(Database*, SQLStatementCallback*, SQLStatementErrorCallback*); |
58 | 59 |
59 // The SQLStatementBackend owns the SQLStatement. Hence, the backend is | 60 // The SQLStatementBackend owns the SQLStatement. Hence, the backend is |
60 // guaranteed to be outlive the SQLStatement, and it is safe for us to refer | 61 // guaranteed to be outlive the SQLStatement, and it is safe for us to refer |
61 // to the backend using a raw pointer here. | 62 // to the backend using a raw pointer here. |
62 Member<SQLStatementBackend> m_backend; | 63 Member<SQLStatementBackend> m_backend; |
63 | 64 |
64 Member<SQLStatementCallback> m_statementCallback; | 65 Member<SQLStatementCallback> m_statementCallback; |
65 Member<SQLStatementErrorCallback> m_statementErrorCallback; | 66 Member<SQLStatementErrorCallback> m_statementErrorCallback; |
66 }; | 67 }; |
67 | 68 |
68 } // namespace blink | 69 } // namespace blink |
69 | 70 |
70 #endif // SQLStatement_h | 71 #endif // SQLStatement_h |
OLD | NEW |