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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 | 163 |
164 DOMStringList* IDBDatabase::objectStoreNames() const | 164 DOMStringList* IDBDatabase::objectStoreNames() const |
165 { | 165 { |
166 DOMStringList* objectStoreNames = DOMStringList::create(DOMStringList::Index edDB); | 166 DOMStringList* objectStoreNames = DOMStringList::create(DOMStringList::Index edDB); |
167 for (const auto& it : m_metadata.objectStores) | 167 for (const auto& it : m_metadata.objectStores) |
168 objectStoreNames->append(it.value.name); | 168 objectStoreNames->append(it.value.name); |
169 objectStoreNames->sort(); | 169 objectStoreNames->sort(); |
170 return objectStoreNames; | 170 return objectStoreNames; |
171 } | 171 } |
172 | 172 |
173 const String& IDBDatabase::getObjectStoreName(int64_t objectStoreId) const | |
174 { | |
175 auto it = m_metadata.objectStores.find(objectStoreId); | |
jsbell
2016/07/11 18:25:33
Should this have ASSERT_WITH_SECURITY_IMPLICATION(
palakj1
2016/07/11 22:25:40
changed to using []
| |
176 return it->value.name; | |
177 } | |
178 | |
173 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP ath& keyPath, bool autoIncrement, ExceptionState& exceptionState) | 179 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP ath& keyPath, bool autoIncrement, ExceptionState& exceptionState) |
174 { | 180 { |
175 IDB_TRACE("IDBDatabase::createObjectStore"); | 181 IDB_TRACE("IDBDatabase::createObjectStore"); |
176 recordApiCallsHistogram(IDBCreateObjectStoreCall); | 182 recordApiCallsHistogram(IDBCreateObjectStoreCall); |
177 | 183 |
178 if (!m_versionChangeTransaction) { | 184 if (!m_versionChangeTransaction) { |
179 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVers ionChangeTransactionErrorMessage); | 185 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVers ionChangeTransactionErrorMessage); |
180 return nullptr; | 186 return nullptr; |
181 } | 187 } |
182 if (m_versionChangeTransaction->isFinished() || m_versionChangeTransaction-> isFinishing()) { | 188 if (m_versionChangeTransaction->isFinished() || m_versionChangeTransaction-> isFinishing()) { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 return ActiveDOMObject::getExecutionContext(); | 453 return ActiveDOMObject::getExecutionContext(); |
448 } | 454 } |
449 | 455 |
450 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) | 456 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) |
451 { | 457 { |
452 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax)); | 458 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax)); |
453 apiCallsHistogram.count(method); | 459 apiCallsHistogram.count(method); |
454 } | 460 } |
455 | 461 |
456 } // namespace blink | 462 } // namespace blink |
OLD | NEW |