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

Side by Side Diff: Source/modules/indexeddb/IDBCursor.cpp

Issue 1021713003: [bindings] Let NativeValueTraits<T>::nativeValue be variadic function and merge various convers… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: IDB related changes alone. Created 5 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 m_request->setPendingCursor(this); 144 m_request->setPendingCursor(this);
145 m_gotValue = false; 145 m_gotValue = false;
146 m_backend->advance(count, WebIDBCallbacksImpl::create(m_request).leakPtr()); 146 m_backend->advance(count, WebIDBCallbacksImpl::create(m_request).leakPtr());
147 } 147 }
148 148
149 void IDBCursor::continueFunction(ScriptState* scriptState, const ScriptValue& ke yValue, ExceptionState& exceptionState) 149 void IDBCursor::continueFunction(ScriptState* scriptState, const ScriptValue& ke yValue, ExceptionState& exceptionState)
150 { 150 {
151 IDB_TRACE("IDBCursor::continue"); 151 IDB_TRACE("IDBCursor::continue");
152 IDBKey* key = keyValue.isUndefined() || keyValue.isNull() ? nullptr : keyVal ue.to<IDBKey*>(exceptionState); 152 IDBKey* key = keyValue.isUndefined() || keyValue.isNull() ? nullptr : Script Value::to<IDBKey*>(scriptState->isolate(), keyValue, exceptionState);
153 if (key && !key->isValid()) { 153 if (key && !key->isValid()) {
154 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage); 154 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage);
155 return; 155 return;
156 } 156 }
157 continueFunction(key, 0, exceptionState); 157 continueFunction(key, 0, exceptionState);
158 } 158 }
159 159
160 void IDBCursor::continuePrimaryKey(ScriptState* scriptState, const ScriptValue& keyValue, const ScriptValue& primaryKeyValue, ExceptionState& exceptionState) 160 void IDBCursor::continuePrimaryKey(ScriptState* scriptState, const ScriptValue& keyValue, const ScriptValue& primaryKeyValue, ExceptionState& exceptionState)
161 { 161 {
162 IDB_TRACE("IDBCursor::continuePrimaryKey"); 162 IDB_TRACE("IDBCursor::continuePrimaryKey");
163 IDBKey* key = keyValue.to<IDBKey*>(exceptionState); 163 IDBKey* key = ScriptValue::to<IDBKey*>(scriptState->isolate(), keyValue, exc eptionState);
164 IDBKey* primaryKey = primaryKeyValue.to<IDBKey*>(exceptionState); 164 IDBKey* primaryKey = ScriptValue::to<IDBKey*>(scriptState->isolate(), primar yKeyValue, exceptionState);
165 if (!key->isValid() || !primaryKey->isValid()) { 165 if (!key->isValid() || !primaryKey->isValid()) {
166 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage); 166 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage);
167 return; 167 return;
168 } 168 }
169 continueFunction(key, primaryKey, exceptionState); 169 continueFunction(key, primaryKey, exceptionState);
170 } 170 }
171 171
172 void IDBCursor::continueFunction(IDBKey* key, IDBKey* primaryKey, ExceptionState & exceptionState) 172 void IDBCursor::continueFunction(IDBKey* key, IDBKey* primaryKey, ExceptionState & exceptionState)
173 { 173 {
174 ASSERT(!primaryKey || (key && primaryKey)); 174 ASSERT(!primaryKey || (key && primaryKey));
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 case WebIDBCursorDirectionPrevNoDuplicate: 372 case WebIDBCursorDirectionPrevNoDuplicate:
373 return IndexedDBNames::prevunique; 373 return IndexedDBNames::prevunique;
374 374
375 default: 375 default:
376 ASSERT_NOT_REACHED(); 376 ASSERT_NOT_REACHED();
377 return IndexedDBNames::next; 377 return IndexedDBNames::next;
378 } 378 }
379 } 379 }
380 380
381 } // namespace blink 381 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/modules/v8/V8BindingForModulesTest.cpp ('k') | Source/modules/indexeddb/IDBFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698