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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 class IDBValue; | 55 class IDBValue; |
56 | 56 |
57 class MODULES_EXPORT IDBRequest | 57 class MODULES_EXPORT IDBRequest |
58 : public RefCountedGarbageCollectedEventTargetWithInlineData<IDBRequest> | 58 : public RefCountedGarbageCollectedEventTargetWithInlineData<IDBRequest> |
59 , public ActiveDOMObject { | 59 , public ActiveDOMObject { |
60 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBRequest); | 60 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBRequest); |
61 DEFINE_WRAPPERTYPEINFO(); | 61 DEFINE_WRAPPERTYPEINFO(); |
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); | 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); |
63 public: | 63 public: |
64 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); | 64 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); |
65 virtual ~IDBRequest(); | 65 ~IDBRequest() override; |
66 DECLARE_VIRTUAL_TRACE(); | 66 DECLARE_VIRTUAL_TRACE(); |
67 | 67 |
68 ScriptState* scriptState() { return m_scriptState.get(); } | 68 ScriptState* scriptState() { return m_scriptState.get(); } |
69 ScriptValue result(ExceptionState&); | 69 ScriptValue result(ExceptionState&); |
70 DOMError* error(ExceptionState&) const; | 70 DOMError* error(ExceptionState&) const; |
71 ScriptValue source() const; | 71 ScriptValue source() const; |
72 IDBTransaction* transaction() const { return m_transaction.get(); } | 72 IDBTransaction* transaction() const { return m_transaction.get(); } |
73 | 73 |
74 bool isResultDirty() const { return m_resultDirty; } | 74 bool isResultDirty() const { return m_resultDirty; } |
75 IDBAny* resultAsAny() const { return m_result; } | 75 IDBAny* resultAsAny() const { return m_result; } |
(...skipping 27 matching lines...) Expand all Loading... |
103 virtual void onSuccess(int64_t); | 103 virtual void onSuccess(int64_t); |
104 virtual void onSuccess(); | 104 virtual void onSuccess(); |
105 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<IDBValue>); | 105 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<IDBValue>); |
106 | 106 |
107 // Only IDBOpenDBRequest instances should receive these: | 107 // Only IDBOpenDBRequest instances should receive these: |
108 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } | 108 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } |
109 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBDatabase>,
const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) { ASSERT_NO
T_REACHED(); } | 109 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBDatabase>,
const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) { ASSERT_NO
T_REACHED(); } |
110 virtual void onSuccess(PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata
&) { ASSERT_NOT_REACHED(); } | 110 virtual void onSuccess(PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata
&) { ASSERT_NOT_REACHED(); } |
111 | 111 |
112 // ActiveDOMObject | 112 // ActiveDOMObject |
113 virtual bool hasPendingActivity() const override final; | 113 bool hasPendingActivity() const final; |
114 virtual void stop() override final; | 114 void stop() final; |
115 | 115 |
116 // EventTarget | 116 // EventTarget |
117 virtual const AtomicString& interfaceName() const override; | 117 const AtomicString& interfaceName() const override; |
118 virtual ExecutionContext* executionContext() const override final; | 118 ExecutionContext* executionContext() const final; |
119 virtual void uncaughtExceptionInEventHandler() override final; | 119 void uncaughtExceptionInEventHandler() final; |
120 | 120 |
121 using EventTarget::dispatchEvent; | 121 using EventTarget::dispatchEvent; |
122 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; | 122 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; |
123 | 123 |
124 // Called by a version change transaction that has finished to set this | 124 // Called by a version change transaction that has finished to set this |
125 // request back from DONE (following "upgradeneeded") back to PENDING (for | 125 // request back from DONE (following "upgradeneeded") back to PENDING (for |
126 // the upcoming "success" or "error"). | 126 // the upcoming "success" or "error"). |
127 void transactionDidFinishAndDispatch(); | 127 void transactionDidFinishAndDispatch(); |
128 | 128 |
129 IDBCursor* getResultCursor() const; | 129 IDBCursor* getResultCursor() const; |
130 | 130 |
131 protected: | 131 protected: |
132 IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*); | 132 IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 RefPtr<IDBValue> m_cursorValue; | 165 RefPtr<IDBValue> m_cursorValue; |
166 | 166 |
167 bool m_didFireUpgradeNeededEvent; | 167 bool m_didFireUpgradeNeededEvent; |
168 bool m_preventPropagation; | 168 bool m_preventPropagation; |
169 bool m_resultDirty; | 169 bool m_resultDirty; |
170 }; | 170 }; |
171 | 171 |
172 } // namespace blink | 172 } // namespace blink |
173 | 173 |
174 #endif // IDBRequest_h | 174 #endif // IDBRequest_h |
OLD | NEW |