OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 12 matching lines...) Expand all Loading... | |
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 #include "config.h" | 29 #include "config.h" |
30 #include "modules/webdatabase/InspectorDatabaseAgent.h" | 30 #include "modules/webdatabase/InspectorDatabaseAgent.h" |
31 | 31 |
32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
33 #include "bindings/core/v8/V8Binding.h" | |
33 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
34 #include "core/html/VoidCallback.h" | 35 #include "core/html/VoidCallback.h" |
35 #include "core/inspector/InspectorState.h" | 36 #include "core/inspector/InspectorState.h" |
36 #include "core/loader/DocumentLoader.h" | 37 #include "core/loader/DocumentLoader.h" |
37 #include "core/page/Page.h" | 38 #include "core/page/Page.h" |
38 #include "modules/webdatabase/Database.h" | 39 #include "modules/webdatabase/Database.h" |
39 #include "modules/webdatabase/DatabaseClient.h" | 40 #include "modules/webdatabase/DatabaseClient.h" |
40 #include "modules/webdatabase/InspectorDatabaseResource.h" | 41 #include "modules/webdatabase/InspectorDatabaseResource.h" |
41 #include "modules/webdatabase/SQLError.h" | 42 #include "modules/webdatabase/SQLError.h" |
42 #include "modules/webdatabase/SQLResultSet.h" | 43 #include "modules/webdatabase/SQLResultSet.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 { | 153 { |
153 visitor->trace(m_requestCallback); | 154 visitor->trace(m_requestCallback); |
154 SQLTransactionCallback::trace(visitor); | 155 SQLTransactionCallback::trace(visitor); |
155 } | 156 } |
156 | 157 |
157 virtual bool handleEvent(SQLTransaction* transaction) override | 158 virtual bool handleEvent(SQLTransaction* transaction) override |
158 { | 159 { |
159 if (!m_requestCallback->isActive()) | 160 if (!m_requestCallback->isActive()) |
160 return true; | 161 return true; |
161 | 162 |
162 Vector<SQLValue> sqlValues; | |
163 SQLStatementCallback* callback = StatementCallback::create(m_requestCall back.get()); | 163 SQLStatementCallback* callback = StatementCallback::create(m_requestCall back.get()); |
164 SQLStatementErrorCallback* errorCallback = StatementErrorCallback::creat e(m_requestCallback.get()); | 164 SQLStatementErrorCallback* errorCallback = StatementErrorCallback::creat e(m_requestCallback.get()); |
165 transaction->executeSQL(m_sqlStatement, sqlValues, callback, errorCallba ck, IGNORE_EXCEPTION); | 165 transaction->executeSql(ScriptState::current(v8::Isolate::GetCurrent()), m_sqlStatement, Vector<ScriptValue>(), callback, errorCallback, IGNORE_EXCEPTIO N); |
vivekg
2015/03/06 14:15:13
Is there a way to avoid using the v8::Isolate here
vivekg
2015/03/06 14:19:44
Also I could see its usage at these many places he
Jens Widell
2015/03/06 14:26:03
One way to avoid it would be to keep the old execu
| |
166 return true; | 166 return true; |
167 } | 167 } |
168 private: | 168 private: |
169 TransactionCallback(const String& sqlStatement, PassRefPtrWillBeRawPtr<Execu teSQLCallback> requestCallback) | 169 TransactionCallback(const String& sqlStatement, PassRefPtrWillBeRawPtr<Execu teSQLCallback> requestCallback) |
170 : m_sqlStatement(sqlStatement) | 170 : m_sqlStatement(sqlStatement) |
171 , m_requestCallback(requestCallback) { } | 171 , m_requestCallback(requestCallback) { } |
172 String m_sqlStatement; | 172 String m_sqlStatement; |
173 RefPtrWillBeMember<ExecuteSQLCallback> m_requestCallback; | 173 RefPtrWillBeMember<ExecuteSQLCallback> m_requestCallback; |
174 }; | 174 }; |
175 | 175 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
341 | 341 |
342 DEFINE_TRACE(InspectorDatabaseAgent) | 342 DEFINE_TRACE(InspectorDatabaseAgent) |
343 { | 343 { |
344 #if ENABLE(OILPAN) | 344 #if ENABLE(OILPAN) |
345 visitor->trace(m_resources); | 345 visitor->trace(m_resources); |
346 #endif | 346 #endif |
347 InspectorBaseAgent::trace(visitor); | 347 InspectorBaseAgent::trace(visitor); |
348 } | 348 } |
349 | 349 |
350 } // namespace blink | 350 } // namespace blink |
OLD | NEW |