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

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

Issue 373423002: Split Dictionary's get and convert into DictionaryHelper. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return idbAnyToScriptValue(scriptState, IDBAny::create(intVersion)); 196 return idbAnyToScriptValue(scriptState, IDBAny::create(intVersion));
197 } 197 }
198 198
199 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const Diction ary& options, ExceptionState& exceptionState) 199 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const Diction ary& options, ExceptionState& exceptionState)
200 { 200 {
201 IDBKeyPath keyPath; 201 IDBKeyPath keyPath;
202 bool autoIncrement = false; 202 bool autoIncrement = false;
203 if (!options.isUndefinedOrNull()) { 203 if (!options.isUndefinedOrNull()) {
204 String keyPathString; 204 String keyPathString;
205 Vector<String> keyPathArray; 205 Vector<String> keyPathArray;
206 if (options.get("keyPath", keyPathArray)) 206 if (DictionaryHelper::get(options, "keyPath", keyPathArray))
207 keyPath = IDBKeyPath(keyPathArray); 207 keyPath = IDBKeyPath(keyPathArray);
208 else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString)) 208 else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString))
209 keyPath = IDBKeyPath(keyPathString); 209 keyPath = IDBKeyPath(keyPathString);
210 210
211 options.get("autoIncrement", autoIncrement); 211 DictionaryHelper::get(options, "autoIncrement", autoIncrement);
212 } 212 }
213 213
214 return createObjectStore(name, keyPath, autoIncrement, exceptionState); 214 return createObjectStore(name, keyPath, autoIncrement, exceptionState);
215 } 215 }
216 216
217 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP ath& keyPath, bool autoIncrement, ExceptionState& exceptionState) 217 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP ath& keyPath, bool autoIncrement, ExceptionState& exceptionState)
218 { 218 {
219 IDB_TRACE("IDBDatabase::createObjectStore"); 219 IDB_TRACE("IDBDatabase::createObjectStore");
220 blink::Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEnd APICalls", IDBCreateObjectStoreCall, IDBMethodsMax); 220 blink::Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEnd APICalls", IDBCreateObjectStoreCall, IDBMethodsMax);
221 if (!m_versionChangeTransaction) { 221 if (!m_versionChangeTransaction) {
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 { 471 {
472 return EventTargetNames::IDBDatabase; 472 return EventTargetNames::IDBDatabase;
473 } 473 }
474 474
475 ExecutionContext* IDBDatabase::executionContext() const 475 ExecutionContext* IDBDatabase::executionContext() const
476 { 476 {
477 return ActiveDOMObject::executionContext(); 477 return ActiveDOMObject::executionContext();
478 } 478 }
479 479
480 } // namespace WebCore 480 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/geolocation/PositionOptions.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698