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

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

Issue 1009503003: [bindings] Introduce ScriptValue.to<T> to convert to native values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing 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
« no previous file with comments | « Source/modules/indexeddb/IDBCursor.cpp ('k') | Source/modules/indexeddb/IDBKeyRange.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 request->onError(DOMError::create(UnknownError, permissionDeniedErrorMes sage)); 148 request->onError(DOMError::create(UnknownError, permissionDeniedErrorMes sage));
149 return request; 149 return request;
150 } 150 }
151 151
152 Platform::current()->idbFactory()->deleteDatabase(name, WebIDBCallbacksImpl: :create(request).leakPtr(), createDatabaseIdentifierFromSecurityOrigin(scriptSta te->executionContext()->securityOrigin())); 152 Platform::current()->idbFactory()->deleteDatabase(name, WebIDBCallbacksImpl: :create(request).leakPtr(), createDatabaseIdentifierFromSecurityOrigin(scriptSta te->executionContext()->securityOrigin()));
153 return request; 153 return request;
154 } 154 }
155 155
156 short IDBFactory::cmp(ScriptState* scriptState, const ScriptValue& firstValue, c onst ScriptValue& secondValue, ExceptionState& exceptionState) 156 short IDBFactory::cmp(ScriptState* scriptState, const ScriptValue& firstValue, c onst ScriptValue& secondValue, ExceptionState& exceptionState)
157 { 157 {
158 IDBKey* first = scriptValueToIDBKey(scriptState->isolate(), firstValue); 158 IDBKey* first = firstValue.to<IDBKey*>(exceptionState);
159 IDBKey* second = scriptValueToIDBKey(scriptState->isolate(), secondValue); 159 IDBKey* second = secondValue.to<IDBKey*>(exceptionState);
160 160
161 ASSERT(first); 161 ASSERT(first);
162 ASSERT(second); 162 ASSERT(second);
163 163
164 if (!first->isValid() || !second->isValid()) { 164 if (!first->isValid() || !second->isValid()) {
165 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage); 165 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage);
166 return 0; 166 return 0;
167 } 167 }
168 168
169 return static_cast<short>(first->compare(second)); 169 return static_cast<short>(first->compare(second));
170 } 170 }
171 171
172 } // namespace blink 172 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBCursor.cpp ('k') | Source/modules/indexeddb/IDBKeyRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698