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 24 matching lines...) Expand all Loading... |
35 #include "modules/webdatabase/AbstractSQLStatementBackend.h" | 35 #include "modules/webdatabase/AbstractSQLStatementBackend.h" |
36 #include "modules/webdatabase/Database.h" | 36 #include "modules/webdatabase/Database.h" |
37 #include "modules/webdatabase/DatabaseManager.h" | 37 #include "modules/webdatabase/DatabaseManager.h" |
38 #include "modules/webdatabase/SQLStatementCallback.h" | 38 #include "modules/webdatabase/SQLStatementCallback.h" |
39 #include "modules/webdatabase/SQLStatementErrorCallback.h" | 39 #include "modules/webdatabase/SQLStatementErrorCallback.h" |
40 #include "modules/webdatabase/SQLTransaction.h" | 40 #include "modules/webdatabase/SQLTransaction.h" |
41 #include "wtf/text/CString.h" | 41 #include "wtf/text/CString.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 PassOwnPtr<SQLStatement> SQLStatement::create(Database* database, | 45 PassOwnPtrWillBeRawPtr<SQLStatement> SQLStatement::create(Database* database, |
46 PassOwnPtr<SQLStatementCallback> callback, PassOwnPtr<SQLStatementErrorCallb
ack> errorCallback) | 46 PassOwnPtr<SQLStatementCallback> callback, PassOwnPtr<SQLStatementErrorCallb
ack> errorCallback) |
47 { | 47 { |
48 return adoptPtr(new SQLStatement(database, callback, errorCallback)); | 48 return adoptPtrWillBeNoop(new SQLStatement(database, callback, errorCallback
)); |
49 } | 49 } |
50 | 50 |
51 SQLStatement::SQLStatement(Database* database, PassOwnPtr<SQLStatementCallback>
callback, | 51 SQLStatement::SQLStatement(Database* database, PassOwnPtr<SQLStatementCallback>
callback, |
52 PassOwnPtr<SQLStatementErrorCallback> errorCallback) | 52 PassOwnPtr<SQLStatementErrorCallback> errorCallback) |
53 : m_statementCallbackWrapper(callback, database->executionContext()) | 53 : m_statementCallbackWrapper(callback, database->executionContext()) |
54 , m_statementErrorCallbackWrapper(errorCallback, database->executionContext(
)) | 54 , m_statementErrorCallbackWrapper(errorCallback, database->executionContext(
)) |
55 { | 55 { |
56 } | 56 } |
57 | 57 |
| 58 void SQLStatement::trace(Visitor* visitor) |
| 59 { |
| 60 visitor->trace(m_backend); |
| 61 visitor->trace(m_statementCallbackWrapper); |
| 62 visitor->trace(m_statementErrorCallbackWrapper); |
| 63 AbstractSQLStatement::trace(visitor); |
| 64 } |
| 65 |
58 void SQLStatement::setBackend(AbstractSQLStatementBackend* backend) | 66 void SQLStatement::setBackend(AbstractSQLStatementBackend* backend) |
59 { | 67 { |
60 m_backend = backend; | 68 m_backend = backend; |
61 } | 69 } |
62 | 70 |
63 bool SQLStatement::hasCallback() | 71 bool SQLStatement::hasCallback() |
64 { | 72 { |
65 return m_statementCallbackWrapper.hasCallback(); | 73 return m_statementCallbackWrapper.hasCallback(); |
66 } | 74 } |
67 | 75 |
(...skipping 22 matching lines...) Expand all Loading... |
90 } | 98 } |
91 } else if (callback) { | 99 } else if (callback) { |
92 RefPtrWillBeRawPtr<SQLResultSet> resultSet = m_backend->sqlResultSet(); | 100 RefPtrWillBeRawPtr<SQLResultSet> resultSet = m_backend->sqlResultSet(); |
93 callbackError = !callback->handleEvent(transaction, resultSet.get()); | 101 callbackError = !callback->handleEvent(transaction, resultSet.get()); |
94 } | 102 } |
95 | 103 |
96 return callbackError; | 104 return callbackError; |
97 } | 105 } |
98 | 106 |
99 } // namespace WebCore | 107 } // namespace WebCore |
OLD | NEW |