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

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: Adding null check for arguments. 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"
33 #include "modules/webdatabase/SQLStatement.h" 34 #include "modules/webdatabase/SQLStatement.h"
34 #include "modules/webdatabase/SQLTransactionStateMachine.h" 35 #include "modules/webdatabase/SQLTransactionStateMachine.h"
35 #include "platform/heap/Handle.h" 36 #include "platform/heap/Handle.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class Database; 40 class Database;
40 class ExceptionState; 41 class ExceptionState;
41 class SQLErrorData; 42 class SQLErrorData;
42 class SQLStatementCallback; 43 class SQLStatementCallback;
43 class SQLStatementErrorCallback; 44 class SQLStatementErrorCallback;
44 class SQLTransactionBackend; 45 class SQLTransactionBackend;
45 class SQLTransactionCallback; 46 class SQLTransactionCallback;
46 class SQLTransactionErrorCallback; 47 class SQLTransactionErrorCallback;
47 class SQLValue; 48 class SQLValue;
49 class ScriptValue;
48 class VoidCallback; 50 class VoidCallback;
49 51
50 class SQLTransaction final 52 class SQLTransaction final
51 : public GarbageCollectedFinalized<SQLTransaction> 53 : public GarbageCollectedFinalized<SQLTransaction>
52 , public SQLTransactionStateMachine<SQLTransaction> 54 , public SQLTransactionStateMachine<SQLTransaction>
53 , public ScriptWrappable { 55 , public ScriptWrappable {
54 DEFINE_WRAPPERTYPEINFO(); 56 DEFINE_WRAPPERTYPEINFO();
55 public: 57 public:
56 static SQLTransaction* create(Database*, SQLTransactionCallback*, 58 static SQLTransaction* create(Database*, SQLTransactionCallback*,
57 VoidCallback* successCallback, SQLTransactionErrorCallback*, bool readOn ly); 59 VoidCallback* successCallback, SQLTransactionErrorCallback*, bool readOn ly);
58 ~SQLTransaction(); 60 ~SQLTransaction();
59 DECLARE_TRACE(); 61 DECLARE_TRACE();
60 62
61 void performPendingCallback(); 63 void performPendingCallback();
62 64
63 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument s, 65 void executeSql(const String& sqlStatement, const Nullable<Vector<ScriptValu e>>& arguments,
64 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&); 66 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&);
67 void executeSql(const String& sqlStatement, ExceptionState&);
65 68
66 Database* database() { return m_database.get(); } 69 Database* database() { return m_database.get(); }
67 70
68 SQLTransactionErrorCallback* releaseErrorCallback(); 71 SQLTransactionErrorCallback* releaseErrorCallback();
69 72
70 // APIs called from the backend published: 73 // APIs called from the backend published:
71 void requestTransitToState(SQLTransactionState); 74 void requestTransitToState(SQLTransactionState);
72 bool hasCallback() const; 75 bool hasCallback() const;
73 bool hasSuccessCallback() const; 76 bool hasSuccessCallback() const;
74 bool hasErrorCallback() const; 77 bool hasErrorCallback() const;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 bool m_executeSqlAllowed; 109 bool m_executeSqlAllowed;
107 OwnPtr<SQLErrorData> m_transactionError; 110 OwnPtr<SQLErrorData> m_transactionError;
108 111
109 bool m_readOnly; 112 bool m_readOnly;
110 int m_asyncOperationId; 113 int m_asyncOperationId;
111 }; 114 };
112 115
113 } // namespace blink 116 } // namespace blink
114 117
115 #endif // SQLTransaction_h 118 #endif // SQLTransaction_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698