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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Addressed most of dcheng@'s feedback. 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // When a cursor is continued/advanced, m_result is cleared and m_pendingCurso r holds it. 180 // When a cursor is continued/advanced, m_result is cleared and m_pendingCurso r holds it.
177 Member<IDBCursor> m_pendingCursor; 181 Member<IDBCursor> m_pendingCursor;
178 // New state is not applied to the cursor object until the event is dispatched . 182 // New state is not applied to the cursor object until the event is dispatched .
179 Member<IDBKey> m_cursorKey; 183 Member<IDBKey> m_cursorKey;
180 Member<IDBKey> m_cursorPrimaryKey; 184 Member<IDBKey> m_cursorPrimaryKey;
181 RefPtr<IDBValue> m_cursorValue; 185 RefPtr<IDBValue> m_cursorValue;
182 186
183 bool m_didFireUpgradeNeededEvent = false; 187 bool m_didFireUpgradeNeededEvent = false;
184 bool m_preventPropagation = false; 188 bool m_preventPropagation = false;
185 bool m_resultDirty = true; 189 bool m_resultDirty = true;
190
191 // Pointer back to the WebIDBCallbacks that holds a persistent reference to
192 // this object.
193 WebIDBCallbacks* m_webCallbacks = nullptr;
186 }; 194 };
187 195
188 } // namespace blink 196 } // namespace blink
189 197
190 #endif // IDBRequest_h 198 #endif // IDBRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698