OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 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 30 matching lines...) Expand all Loading... |
41 #include "modules/webdatabase/SQLStatementCallback.h" | 41 #include "modules/webdatabase/SQLStatementCallback.h" |
42 #include "modules/webdatabase/SQLStatementErrorCallback.h" | 42 #include "modules/webdatabase/SQLStatementErrorCallback.h" |
43 #include "modules/webdatabase/SQLTransactionCallback.h" | 43 #include "modules/webdatabase/SQLTransactionCallback.h" |
44 #include "modules/webdatabase/SQLTransactionClient.h" // FIXME: Should be used i
n the backend only. | 44 #include "modules/webdatabase/SQLTransactionClient.h" // FIXME: Should be used i
n the backend only. |
45 #include "modules/webdatabase/SQLTransactionErrorCallback.h" | 45 #include "modules/webdatabase/SQLTransactionErrorCallback.h" |
46 #include "wtf/StdLibExtras.h" | 46 #include "wtf/StdLibExtras.h" |
47 #include "wtf/Vector.h" | 47 #include "wtf/Vector.h" |
48 | 48 |
49 namespace WebCore { | 49 namespace WebCore { |
50 | 50 |
51 PassRefPtr<SQLTransaction> SQLTransaction::create(Database* db, PassOwnPtr<SQLTr
ansactionCallback> callback, | 51 PassRefPtrWillBeRawPtr<SQLTransaction> SQLTransaction::create(Database* db, Pass
OwnPtr<SQLTransactionCallback> callback, |
52 PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCall
back> errorCallback, | 52 PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCall
back> errorCallback, |
53 bool readOnly) | 53 bool readOnly) |
54 { | 54 { |
55 return adoptRef(new SQLTransaction(db, callback, successCallback, errorCallb
ack, readOnly)); | 55 return adoptRefWillBeNoop(new SQLTransaction(db, callback, successCallback,
errorCallback, readOnly)); |
56 } | 56 } |
57 | 57 |
58 SQLTransaction::SQLTransaction(Database* db, PassOwnPtr<SQLTransactionCallback>
callback, | 58 SQLTransaction::SQLTransaction(Database* db, PassOwnPtr<SQLTransactionCallback>
callback, |
59 PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCall
back> errorCallback, | 59 PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCall
back> errorCallback, |
60 bool readOnly) | 60 bool readOnly) |
61 : m_database(db) | 61 : m_database(db) |
62 , m_callbackWrapper(callback, db->executionContext()) | 62 , m_callbackWrapper(callback, db->executionContext()) |
63 , m_successCallbackWrapper(successCallback, db->executionContext()) | 63 , m_successCallbackWrapper(successCallback, db->executionContext()) |
64 , m_errorCallbackWrapper(errorCallback, db->executionContext()) | 64 , m_errorCallbackWrapper(errorCallback, db->executionContext()) |
65 , m_executeSqlAllowed(false) | 65 , m_executeSqlAllowed(false) |
66 , m_readOnly(readOnly) | 66 , m_readOnly(readOnly) |
67 { | 67 { |
68 ASSERT(m_database); | 68 ASSERT(m_database); |
69 ScriptWrappable::init(this); | 69 ScriptWrappable::init(this); |
70 } | 70 } |
71 | 71 |
| 72 void SQLTransaction::trace(Visitor* visitor) |
| 73 { |
| 74 visitor->trace(m_database); |
| 75 AbstractSQLTransaction::trace(visitor); |
| 76 } |
| 77 |
72 bool SQLTransaction::hasCallback() const | 78 bool SQLTransaction::hasCallback() const |
73 { | 79 { |
74 return m_callbackWrapper.hasCallback(); | 80 return m_callbackWrapper.hasCallback(); |
75 } | 81 } |
76 | 82 |
77 bool SQLTransaction::hasSuccessCallback() const | 83 bool SQLTransaction::hasSuccessCallback() const |
78 { | 84 { |
79 return m_successCallbackWrapper.hasCallback(); | 85 return m_successCallbackWrapper.hasCallback(); |
80 } | 86 } |
81 | 87 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 m_successCallbackWrapper.clear(); | 309 m_successCallbackWrapper.clear(); |
304 m_errorCallbackWrapper.clear(); | 310 m_errorCallbackWrapper.clear(); |
305 } | 311 } |
306 | 312 |
307 PassOwnPtr<SQLTransactionErrorCallback> SQLTransaction::releaseErrorCallback() | 313 PassOwnPtr<SQLTransactionErrorCallback> SQLTransaction::releaseErrorCallback() |
308 { | 314 { |
309 return m_errorCallbackWrapper.unwrap(); | 315 return m_errorCallbackWrapper.unwrap(); |
310 } | 316 } |
311 | 317 |
312 } // namespace WebCore | 318 } // namespace WebCore |
OLD | NEW |