OLD | NEW |
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 return idbAnyToScriptValue(scriptState, IDBAny::create(intVersion)); | 195 return idbAnyToScriptValue(scriptState, IDBAny::create(intVersion)); |
196 } | 196 } |
197 | 197 |
198 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const Diction
ary& options, ExceptionState& exceptionState) | 198 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const Diction
ary& options, ExceptionState& exceptionState) |
199 { | 199 { |
200 IDBKeyPath keyPath; | 200 IDBKeyPath keyPath; |
201 bool autoIncrement = false; | 201 bool autoIncrement = false; |
202 if (!options.isUndefinedOrNull()) { | 202 if (!options.isUndefinedOrNull()) { |
203 String keyPathString; | 203 String keyPathString; |
204 Vector<String> keyPathArray; | 204 Vector<String> keyPathArray; |
205 if (DictionaryHelper::get(options, "keyPath", keyPathArray)) | 205 if (options.get("keyPath", keyPathArray)) |
206 keyPath = IDBKeyPath(keyPathArray); | 206 keyPath = IDBKeyPath(keyPathArray); |
207 else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString)) | 207 else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString)) |
208 keyPath = IDBKeyPath(keyPathString); | 208 keyPath = IDBKeyPath(keyPathString); |
209 | 209 |
210 DictionaryHelper::get(options, "autoIncrement", autoIncrement); | 210 options.get("autoIncrement", autoIncrement); |
211 } | 211 } |
212 | 212 |
213 return createObjectStore(name, keyPath, autoIncrement, exceptionState); | 213 return createObjectStore(name, keyPath, autoIncrement, exceptionState); |
214 } | 214 } |
215 | 215 |
216 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP
ath& keyPath, bool autoIncrement, ExceptionState& exceptionState) | 216 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP
ath& keyPath, bool autoIncrement, ExceptionState& exceptionState) |
217 { | 217 { |
218 IDB_TRACE("IDBDatabase::createObjectStore"); | 218 IDB_TRACE("IDBDatabase::createObjectStore"); |
219 Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEndAPICall
s", IDBCreateObjectStoreCall, IDBMethodsMax); | 219 Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEndAPICall
s", IDBCreateObjectStoreCall, IDBMethodsMax); |
220 if (!m_versionChangeTransaction) { | 220 if (!m_versionChangeTransaction) { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 { | 470 { |
471 return EventTargetNames::IDBDatabase; | 471 return EventTargetNames::IDBDatabase; |
472 } | 472 } |
473 | 473 |
474 ExecutionContext* IDBDatabase::executionContext() const | 474 ExecutionContext* IDBDatabase::executionContext() const |
475 { | 475 { |
476 return ActiveDOMObject::executionContext(); | 476 return ActiveDOMObject::executionContext(); |
477 } | 477 } |
478 | 478 |
479 } // namespace blink | 479 } // namespace blink |
OLD | NEW |