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

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

Issue 1323323002: IndexedDB: Various C++11isms and cleanup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: True, false, whatever Created 5 years, 3 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 | Annotate | Revision Log
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*); 129 IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*);
130 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); 130 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>);
131 void dequeueEvent(Event*); 131 void dequeueEvent(Event*);
132 virtual bool shouldEnqueueEvent() const; 132 virtual bool shouldEnqueueEvent() const;
133 void onSuccessInternal(IDBAny*); 133 void onSuccessInternal(IDBAny*);
134 void setResult(IDBAny*); 134 void setResult(IDBAny*);
135 135
136 // EventTarget 136 // EventTarget
137 bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override; 137 bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) override;
138 138
139 bool m_contextStopped; 139 bool m_contextStopped = false;
140 Member<IDBTransaction> m_transaction; 140 Member<IDBTransaction> m_transaction;
141 ReadyState m_readyState; 141 ReadyState m_readyState = PENDING;
142 bool m_requestAborted; // May be aborted by transaction then receive async o nsuccess; ignore vs. assert. 142 bool m_requestAborted = false; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
143 143
144 private: 144 private:
145 void setResultCursor(IDBCursor*, IDBKey*, IDBKey* primaryKey, PassRefPtr<IDB Value>); 145 void setResultCursor(IDBCursor*, IDBKey*, IDBKey* primaryKey, PassRefPtr<IDB Value>);
146 void ackReceivedBlobs(const IDBValue*); 146 void ackReceivedBlobs(const IDBValue*);
147 void ackReceivedBlobs(const Vector<RefPtr<IDBValue>>&); 147 void ackReceivedBlobs(const Vector<RefPtr<IDBValue>>&);
148 148
149 RefPtr<ScriptState> m_scriptState; 149 RefPtr<ScriptState> m_scriptState;
150 Member<IDBAny> m_source; 150 Member<IDBAny> m_source;
151 Member<IDBAny> m_result; 151 Member<IDBAny> m_result;
152 Member<DOMError> m_error; 152 Member<DOMError> m_error;
153 153
154 bool m_hasPendingActivity; 154 bool m_hasPendingActivity = true;
155 WillBeHeapVector<RefPtrWillBeMember<Event>> m_enqueuedEvents; 155 WillBeHeapVector<RefPtrWillBeMember<Event>> m_enqueuedEvents;
156 156
157 // Only used if the result type will be a cursor. 157 // Only used if the result type will be a cursor.
158 IndexedDB::CursorType m_cursorType; 158 IndexedDB::CursorType m_cursorType = IndexedDB::CursorKeyAndValue;
159 WebIDBCursorDirection m_cursorDirection; 159 WebIDBCursorDirection m_cursorDirection = WebIDBCursorDirectionNext;
160 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur sor holds it. 160 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur sor holds it.
161 Member<IDBCursor> m_pendingCursor; 161 Member<IDBCursor> m_pendingCursor;
cmumford 2015/09/03 23:21:03 The constructor initialized this to nullptr - I'm
jsbell 2015/09/03 23:29:54 Right - it was a raw pointer at one point, not nee
162 // New state is not applied to the cursor object until the event is dispatch ed. 162 // New state is not applied to the cursor object until the event is dispatch ed.
163 Member<IDBKey> m_cursorKey; 163 Member<IDBKey> m_cursorKey;
164 Member<IDBKey> m_cursorPrimaryKey; 164 Member<IDBKey> m_cursorPrimaryKey;
165 RefPtr<IDBValue> m_cursorValue; 165 RefPtr<IDBValue> m_cursorValue;
166 166
167 bool m_didFireUpgradeNeededEvent; 167 bool m_didFireUpgradeNeededEvent = false;
168 bool m_preventPropagation; 168 bool m_preventPropagation = false;
169 bool m_resultDirty; 169 bool m_resultDirty = true;
170 }; 170 };
171 171
172 } // namespace blink 172 } // namespace blink
173 173
174 #endif // IDBRequest_h 174 #endif // IDBRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698