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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Require explicit wrapping when discarding map keys. Created 4 years, 2 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // Requests made during index population are implementation details and so 79 // Requests made during index population are implementation details and so
80 // events should not be visible to script. 80 // events should not be visible to script.
81 void preventPropagation() { m_preventPropagation = true; } 81 void preventPropagation() { m_preventPropagation = true; }
82 82
83 // Defined in the IDL 83 // Defined in the IDL
84 enum ReadyState { PENDING = 1, DONE = 2, EarlyDeath = 3 }; 84 enum ReadyState { PENDING = 1, DONE = 2, EarlyDeath = 3 };
85 85
86 const String& readyState() const; 86 const String& readyState() const;
87 87
88 // Returns a new WebIDBCallbacks for this request. Must only be called once.
89 std::unique_ptr<WebIDBCallbacks> createWebCallbacks();
90 void webCallbacksDestroyed();
91
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
89 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
90 94
91 void setCursorDetails(IndexedDB::CursorType, WebIDBCursorDirection); 95 void setCursorDetails(IndexedDB::CursorType, WebIDBCursorDirection);
92 void setPendingCursor(IDBCursor*); 96 void setPendingCursor(IDBCursor*);
93 void abort(); 97 void abort();
94 98
95 virtual void onError(DOMException*); 99 virtual void onError(DOMException*);
96 virtual void onSuccess(const Vector<String>&); 100 virtual void onSuccess(const Vector<String>&);
97 virtual void onSuccess(std::unique_ptr<WebIDBCursor>, 101 virtual void onSuccess(std::unique_ptr<WebIDBCursor>,
(...skipping 18 matching lines...) Expand all
116 } 120 }
117 virtual void onSuccess(std::unique_ptr<WebIDBDatabase>, 121 virtual void onSuccess(std::unique_ptr<WebIDBDatabase>,
118 const IDBDatabaseMetadata&) { 122 const IDBDatabaseMetadata&) {
119 ASSERT_NOT_REACHED(); 123 ASSERT_NOT_REACHED();
120 } 124 }
121 125
122 // ScriptWrappable 126 // ScriptWrappable
123 bool hasPendingActivity() const final; 127 bool hasPendingActivity() const final;
124 128
125 // ActiveDOMObject 129 // ActiveDOMObject
126 void contextDestroyed() final; 130 void contextDestroyed() override;
127 131
128 // EventTarget 132 // EventTarget
129 const AtomicString& interfaceName() const override; 133 const AtomicString& interfaceName() const override;
130 ExecutionContext* getExecutionContext() const final; 134 ExecutionContext* getExecutionContext() const final;
131 void uncaughtExceptionInEventHandler() final; 135 void uncaughtExceptionInEventHandler() final;
132 136
133 // Called by a version change transaction that has finished to set this 137 // Called by a version change transaction that has finished to set this
134 // request back from DONE (following "upgradeneeded") back to PENDING (for 138 // request back from DONE (following "upgradeneeded") back to PENDING (for
135 // the upcoming "success" or "error"). 139 // the upcoming "success" or "error").
136 void transactionDidFinishAndDispatch(); 140 void transactionDidFinishAndDispatch();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 Member<IDBCursor> m_pendingCursor; 182 Member<IDBCursor> m_pendingCursor;
179 // New state is not applied to the cursor object until the event is 183 // New state is not applied to the cursor object until the event is
180 // dispatched. 184 // dispatched.
181 Member<IDBKey> m_cursorKey; 185 Member<IDBKey> m_cursorKey;
182 Member<IDBKey> m_cursorPrimaryKey; 186 Member<IDBKey> m_cursorPrimaryKey;
183 RefPtr<IDBValue> m_cursorValue; 187 RefPtr<IDBValue> m_cursorValue;
184 188
185 bool m_didFireUpgradeNeededEvent = false; 189 bool m_didFireUpgradeNeededEvent = false;
186 bool m_preventPropagation = false; 190 bool m_preventPropagation = false;
187 bool m_resultDirty = true; 191 bool m_resultDirty = true;
192
193 // Pointer back to the WebIDBCallbacks that holds a persistent reference to
194 // this object.
195 WebIDBCallbacks* m_webCallbacks = nullptr;
188 }; 196 };
189 197
190 } // namespace blink 198 } // namespace blink
191 199
192 #endif // IDBRequest_h 200 #endif // IDBRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698