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

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

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: Minor fix Created 4 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const auto& it = m_metadata.objectStores.find(objectStoreId);
176 SECURITY_DCHECK(it != m_metadata.objectStores.end());
haraken 2016/07/20 16:22:11 SECURITY_DCHECK => DCHECK I don't think this is s
jsbell 2016/07/20 17:18:31 The objectStoreId in this case was sent browser->r
palakj1 2016/07/20 18:22:11 As re-confimred by jsbell, changing back to DCHECK
177 return it->value.name;
178 }
179
173 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP ath& keyPath, bool autoIncrement, ExceptionState& exceptionState) 180 IDBObjectStore* IDBDatabase::createObjectStore(const String& name, const IDBKeyP ath& keyPath, bool autoIncrement, ExceptionState& exceptionState)
174 { 181 {
175 IDB_TRACE("IDBDatabase::createObjectStore"); 182 IDB_TRACE("IDBDatabase::createObjectStore");
176 recordApiCallsHistogram(IDBCreateObjectStoreCall); 183 recordApiCallsHistogram(IDBCreateObjectStoreCall);
177 184
178 if (!m_versionChangeTransaction) { 185 if (!m_versionChangeTransaction) {
179 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVers ionChangeTransactionErrorMessage); 186 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVers ionChangeTransactionErrorMessage);
180 return nullptr; 187 return nullptr;
181 } 188 }
182 if (m_versionChangeTransaction->isFinished() || m_versionChangeTransaction-> isFinishing()) { 189 if (m_versionChangeTransaction->isFinished() || m_versionChangeTransaction-> isFinishing()) {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 return ActiveDOMObject::getExecutionContext(); 454 return ActiveDOMObject::getExecutionContext();
448 } 455 }
449 456
450 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) 457 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method)
451 { 458 {
452 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax)); 459 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax));
453 apiCallsHistogram.count(method); 460 apiCallsHistogram.count(method);
454 } 461 }
455 462
456 } // namespace blink 463 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698