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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBRequest.h

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 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) 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 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 IDBRequest_h 29 #ifndef IDBRequest_h
30 #define IDBRequest_h 30 #define IDBRequest_h
31 31
32 #include "bindings/core/v8/ActiveScriptWrappable.h"
32 #include "bindings/core/v8/ScriptState.h" 33 #include "bindings/core/v8/ScriptState.h"
33 #include "bindings/core/v8/ScriptValue.h" 34 #include "bindings/core/v8/ScriptValue.h"
34 #include "core/dom/ActiveDOMObject.h" 35 #include "core/dom/ActiveDOMObject.h"
35 #include "core/dom/DOMStringList.h" 36 #include "core/dom/DOMStringList.h"
36 #include "core/events/EventListener.h" 37 #include "core/events/EventListener.h"
37 #include "core/events/EventTarget.h" 38 #include "core/events/EventTarget.h"
38 #include "modules/EventModules.h" 39 #include "modules/EventModules.h"
39 #include "modules/ModulesExport.h" 40 #include "modules/ModulesExport.h"
40 #include "modules/indexeddb/IDBAny.h" 41 #include "modules/indexeddb/IDBAny.h"
41 #include "modules/indexeddb/IDBTransaction.h" 42 #include "modules/indexeddb/IDBTransaction.h"
42 #include "modules/indexeddb/IndexedDB.h" 43 #include "modules/indexeddb/IndexedDB.h"
43 #include "platform/blob/BlobData.h" 44 #include "platform/blob/BlobData.h"
44 #include "platform/heap/Handle.h" 45 #include "platform/heap/Handle.h"
45 #include "public/platform/WebBlobInfo.h" 46 #include "public/platform/WebBlobInfo.h"
46 #include "public/platform/modules/indexeddb/WebIDBCursor.h" 47 #include "public/platform/modules/indexeddb/WebIDBCursor.h"
47 #include "public/platform/modules/indexeddb/WebIDBTypes.h" 48 #include "public/platform/modules/indexeddb/WebIDBTypes.h"
48 49
49 namespace blink { 50 namespace blink {
50 51
51 class DOMException; 52 class DOMException;
52 class ExceptionState; 53 class ExceptionState;
53 class IDBCursor; 54 class IDBCursor;
54 struct IDBDatabaseMetadata; 55 struct IDBDatabaseMetadata;
55 class IDBValue; 56 class IDBValue;
56 57
57 class MODULES_EXPORT IDBRequest 58 class MODULES_EXPORT IDBRequest
58 : public RefCountedGarbageCollectedEventTargetWithInlineData<IDBRequest> 59 : public RefCountedGarbageCollectedEventTargetWithInlineData<IDBRequest>
60 , public ActiveScriptWrappable
59 , public ActiveDOMObject { 61 , public ActiveDOMObject {
60 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBRequest); 62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(IDBRequest);
61 DEFINE_WRAPPERTYPEINFO(); 63 DEFINE_WRAPPERTYPEINFO();
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); 64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBRequest);
63 public: 65 public:
64 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); 66 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*);
65 ~IDBRequest() override; 67 ~IDBRequest() override;
66 DECLARE_VIRTUAL_TRACE(); 68 DECLARE_VIRTUAL_TRACE();
67 69
68 ScriptState* getScriptState() { return m_scriptState.get(); } 70 ScriptState* getScriptState() { return m_scriptState.get(); }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 virtual void onSuccess(const Vector<RefPtr<IDBValue>>&); 104 virtual void onSuccess(const Vector<RefPtr<IDBValue>>&);
103 virtual void onSuccess(int64_t); 105 virtual void onSuccess(int64_t);
104 virtual void onSuccess(); 106 virtual void onSuccess();
105 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<IDBValue>); 107 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<IDBValue>);
106 108
107 // Only IDBOpenDBRequest instances should receive these: 109 // Only IDBOpenDBRequest instances should receive these:
108 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } 110 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(); } 111 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(); } 112 virtual void onSuccess(PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata &) { ASSERT_NOT_REACHED(); }
111 113
114 // ActiveScriptWrappable
115 bool hasPendingActivity() const final;
116
112 // ActiveDOMObject 117 // ActiveDOMObject
113 bool hasPendingActivity() const final;
114 void stop() final; 118 void stop() final;
115 119
116 // EventTarget 120 // EventTarget
117 const AtomicString& interfaceName() const override; 121 const AtomicString& interfaceName() const override;
118 ExecutionContext* getExecutionContext() const final; 122 ExecutionContext* getExecutionContext() const final;
119 void uncaughtExceptionInEventHandler() final; 123 void uncaughtExceptionInEventHandler() final;
120 124
121 // Called by a version change transaction that has finished to set this 125 // Called by a version change transaction that has finished to set this
122 // request back from DONE (following "upgradeneeded") back to PENDING (for 126 // request back from DONE (following "upgradeneeded") back to PENDING (for
123 // the upcoming "success" or "error"). 127 // the upcoming "success" or "error").
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 RefPtr<IDBValue> m_cursorValue; 169 RefPtr<IDBValue> m_cursorValue;
166 170
167 bool m_didFireUpgradeNeededEvent = false; 171 bool m_didFireUpgradeNeededEvent = false;
168 bool m_preventPropagation = false; 172 bool m_preventPropagation = false;
169 bool m_resultDirty = true; 173 bool m_resultDirty = true;
170 }; 174 };
171 175
172 } // namespace blink 176 } // namespace blink
173 177
174 #endif // IDBRequest_h 178 #endif // IDBRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698