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

Side by Side Diff: Source/modules/webdatabase/SQLTransaction.h

Issue 949193002: [bindings] Remove SQLTransaction's usage of custom binding. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using NativeValueTraits Created 5 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
OLDNEW
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 11 matching lines...) Expand all
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef SQLTransaction_h 29 #ifndef SQLTransaction_h
30 #define SQLTransaction_h 30 #define SQLTransaction_h
31 31
32 #include "bindings/core/v8/Nullable.h"
32 #include "bindings/core/v8/ScriptWrappable.h" 33 #include "bindings/core/v8/ScriptWrappable.h"
34 #include "bindings/modules/v8/V8BindingForModules.h"
33 #include "modules/webdatabase/SQLStatement.h" 35 #include "modules/webdatabase/SQLStatement.h"
34 #include "modules/webdatabase/SQLTransactionStateMachine.h" 36 #include "modules/webdatabase/SQLTransactionStateMachine.h"
35 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
36 38
37 namespace blink { 39 namespace blink {
38 40
39 class Database; 41 class Database;
40 class ExceptionState; 42 class ExceptionState;
41 class SQLErrorData; 43 class SQLErrorData;
42 class SQLStatementCallback; 44 class SQLStatementCallback;
43 class SQLStatementErrorCallback; 45 class SQLStatementErrorCallback;
44 class SQLTransactionBackend; 46 class SQLTransactionBackend;
45 class SQLTransactionCallback; 47 class SQLTransactionCallback;
46 class SQLTransactionErrorCallback; 48 class SQLTransactionErrorCallback;
47 class SQLValue; 49 class SQLValue;
50 class ScriptValue;
48 class VoidCallback; 51 class VoidCallback;
49 52
50 class SQLTransaction final 53 class SQLTransaction final
51 : public GarbageCollectedFinalized<SQLTransaction> 54 : public GarbageCollectedFinalized<SQLTransaction>
52 , public SQLTransactionStateMachine<SQLTransaction> 55 , public SQLTransactionStateMachine<SQLTransaction>
53 , public ScriptWrappable { 56 , public ScriptWrappable {
54 DEFINE_WRAPPERTYPEINFO(); 57 DEFINE_WRAPPERTYPEINFO();
55 public: 58 public:
56 static SQLTransaction* create(Database*, SQLTransactionCallback*, 59 static SQLTransaction* create(Database*, SQLTransactionCallback*,
57 VoidCallback* successCallback, SQLTransactionErrorCallback*, bool readOn ly); 60 VoidCallback* successCallback, SQLTransactionErrorCallback*, bool readOn ly);
58 ~SQLTransaction(); 61 ~SQLTransaction();
59 DECLARE_TRACE(); 62 DECLARE_TRACE();
60 63
61 void performPendingCallback(); 64 void performPendingCallback();
62 65
63 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument s, 66 void executeSql(ScriptState*, const String& sqlStatement, const Nullable<Vec tor<ScriptValue>>& arguments,
64 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&); 67 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&);
68 void executeSql(ScriptState*, const String& sqlStatement, ExceptionState&);
65 69
66 Database* database() { return m_database.get(); } 70 Database* database() { return m_database.get(); }
67 71
68 SQLTransactionErrorCallback* releaseErrorCallback(); 72 SQLTransactionErrorCallback* releaseErrorCallback();
69 73
70 // APIs called from the backend published: 74 // APIs called from the backend published:
71 void requestTransitToState(SQLTransactionState); 75 void requestTransitToState(SQLTransactionState);
72 bool hasCallback() const; 76 bool hasCallback() const;
73 bool hasSuccessCallback() const; 77 bool hasSuccessCallback() const;
74 bool hasErrorCallback() const; 78 bool hasErrorCallback() const;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 bool m_executeSqlAllowed; 110 bool m_executeSqlAllowed;
107 OwnPtr<SQLErrorData> m_transactionError; 111 OwnPtr<SQLErrorData> m_transactionError;
108 112
109 bool m_readOnly; 113 bool m_readOnly;
110 int m_asyncOperationId; 114 int m_asyncOperationId;
111 }; 115 };
112 116
113 } // namespace blink 117 } // namespace blink
114 118
115 #endif // SQLTransaction_h 119 #endif // SQLTransaction_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698