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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 79 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
80 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 80 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
81 return nullptr; 81 return nullptr;
82 } 82 }
83 if (!m_transaction->isActive()) { 83 if (!m_transaction->isActive()) {
84 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 84 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
85 return nullptr; 85 return nullptr;
86 } 86 }
87 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri ng); 87 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri ng);
88 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC ontext(), range, exceptionState); 88 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecuti onContext(), range, exceptionState);
89 if (exceptionState.hadException()) 89 if (exceptionState.hadException())
90 return nullptr; 90 return nullptr;
91 91
92 if (!backendDB()) { 92 if (!backendDB()) {
93 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage); 93 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage);
94 return nullptr; 94 return nullptr;
95 } 95 }
96 96
97 return openCursor(scriptState, keyRange, direction); 97 return openCursor(scriptState, keyRange, direction);
98 } 98 }
(...skipping 15 matching lines...) Expand all
114 } 114 }
115 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 115 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
116 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 116 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
117 return nullptr; 117 return nullptr;
118 } 118 }
119 if (!m_transaction->isActive()) { 119 if (!m_transaction->isActive()) {
120 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 120 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
121 return nullptr; 121 return nullptr;
122 } 122 }
123 123
124 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC ontext(), range, exceptionState); 124 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecuti onContext(), range, exceptionState);
125 if (exceptionState.hadException()) 125 if (exceptionState.hadException())
126 return nullptr; 126 return nullptr;
127 127
128 if (!backendDB()) { 128 if (!backendDB()) {
129 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage); 129 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage);
130 return nullptr; 130 return nullptr;
131 } 131 }
132 132
133 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get()); 133 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
134 backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, WebIDBCallbacksImpl::create(request).leakPtr()); 134 backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, WebIDBCallbacksImpl::create(request).leakPtr());
135 return request; 135 return request;
136 } 136 }
137 137
138 IDBRequest* IDBIndex::openKeyCursor(ScriptState* scriptState, const ScriptValue& range, const String& directionString, ExceptionState& exceptionState) 138 IDBRequest* IDBIndex::openKeyCursor(ScriptState* scriptState, const ScriptValue& range, const String& directionString, ExceptionState& exceptionState)
139 { 139 {
140 IDB_TRACE("IDBIndex::openKeyCursor"); 140 IDB_TRACE("IDBIndex::openKeyCursor");
141 if (isDeleted()) { 141 if (isDeleted()) {
142 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::indexDe letedErrorMessage); 142 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::indexDe letedErrorMessage);
143 return nullptr; 143 return nullptr;
144 } 144 }
145 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 145 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
146 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 146 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
147 return nullptr; 147 return nullptr;
148 } 148 }
149 if (!m_transaction->isActive()) { 149 if (!m_transaction->isActive()) {
150 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 150 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
151 return nullptr; 151 return nullptr;
152 } 152 }
153 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri ng); 153 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri ng);
154 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC ontext(), range, exceptionState); 154 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecuti onContext(), range, exceptionState);
155 if (exceptionState.hadException()) 155 if (exceptionState.hadException())
156 return nullptr; 156 return nullptr;
157 if (!backendDB()) { 157 if (!backendDB()) {
158 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage); 158 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage);
159 return nullptr; 159 return nullptr;
160 } 160 }
161 161
162 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get()); 162 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
163 request->setCursorDetails(IndexedDB::CursorKeyOnly, direction); 163 request->setCursorDetails(IndexedDB::CursorKeyOnly, direction);
164 backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata .id, keyRange, direction, true, WebIDBTaskTypeNormal, WebIDBCallbacksImpl::creat e(request).leakPtr()); 164 backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata .id, keyRange, direction, true, WebIDBTaskTypeNormal, WebIDBCallbacksImpl::creat e(request).leakPtr());
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 208 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
209 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 209 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
210 return nullptr; 210 return nullptr;
211 } 211 }
212 if (!m_transaction->isActive()) { 212 if (!m_transaction->isActive()) {
213 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 213 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
214 return nullptr; 214 return nullptr;
215 } 215 }
216 216
217 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC ontext(), key, exceptionState); 217 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecuti onContext(), key, exceptionState);
218 if (exceptionState.hadException()) 218 if (exceptionState.hadException())
219 return nullptr; 219 return nullptr;
220 if (!keyRange) { 220 if (!keyRange) {
221 exceptionState.throwDOMException(DataError, IDBDatabase::noKeyOrKeyRange ErrorMessage); 221 exceptionState.throwDOMException(DataError, IDBDatabase::noKeyOrKeyRange ErrorMessage);
222 return nullptr; 222 return nullptr;
223 } 223 }
224 if (!backendDB()) { 224 if (!backendDB()) {
225 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage); 225 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage);
226 return nullptr; 226 return nullptr;
227 } 227 }
(...skipping 14 matching lines...) Expand all
242 } 242 }
243 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 243 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
244 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 244 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
245 return nullptr; 245 return nullptr;
246 } 246 }
247 if (!m_transaction->isActive()) { 247 if (!m_transaction->isActive()) {
248 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 248 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
249 return nullptr; 249 return nullptr;
250 } 250 }
251 251
252 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC ontext(), range, exceptionState); 252 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecuti onContext(), range, exceptionState);
253 if (exceptionState.hadException()) 253 if (exceptionState.hadException())
254 return nullptr; 254 return nullptr;
255 if (!backendDB()) { 255 if (!backendDB()) {
256 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage); 256 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas eClosedErrorMessage);
257 return nullptr; 257 return nullptr;
258 } 258 }
259 259
260 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get()); 260 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
261 backendDB()->getAll(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, maxCount, keyOnly, WebIDBCallbacksImpl::create(request).leakPtr()); 261 backendDB()->getAll(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, maxCount, keyOnly, WebIDBCallbacksImpl::create(request).leakPtr());
262 return request; 262 return request;
263 } 263 }
264 264
265 WebIDBDatabase* IDBIndex::backendDB() const 265 WebIDBDatabase* IDBIndex::backendDB() const
266 { 266 {
267 return m_transaction->backendDB(); 267 return m_transaction->backendDB();
268 } 268 }
269 269
270 bool IDBIndex::isDeleted() const 270 bool IDBIndex::isDeleted() const
271 { 271 {
272 return m_deleted || m_objectStore->isDeleted(); 272 return m_deleted || m_objectStore->isDeleted();
273 } 273 }
274 274
275 } // namespace blink 275 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698