| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 | 344 |
| 345 backend_->DeleteObjectStore(version_change_transaction_->Id(), | 345 backend_->DeleteObjectStore(version_change_transaction_->Id(), |
| 346 object_store_id); | 346 object_store_id); |
| 347 version_change_transaction_->ObjectStoreDeleted(object_store_id, name); | 347 version_change_transaction_->ObjectStoreDeleted(object_store_id, name); |
| 348 metadata_.object_stores.erase(object_store_id); | 348 metadata_.object_stores.erase(object_store_id); |
| 349 } | 349 } |
| 350 | 350 |
| 351 IDBTransaction* IDBDatabase::transaction( | 351 IDBTransaction* IDBDatabase::transaction( |
| 352 ScriptState* script_state, | 352 ScriptState* script_state, |
| 353 const StringOrStringSequenceOrDOMStringList& store_names, | 353 const StringOrStringSequence& store_names, |
| 354 const String& mode_string, | 354 const String& mode_string, |
| 355 ExceptionState& exception_state) { | 355 ExceptionState& exception_state) { |
| 356 IDB_TRACE("IDBDatabase::transaction"); | 356 IDB_TRACE("IDBDatabase::transaction"); |
| 357 RecordApiCallsHistogram(kIDBTransactionCall); | 357 RecordApiCallsHistogram(kIDBTransactionCall); |
| 358 | 358 |
| 359 HashSet<String> scope; | 359 HashSet<String> scope; |
| 360 if (store_names.isString()) { | 360 if (store_names.isString()) { |
| 361 scope.insert(store_names.getAsString()); | 361 scope.insert(store_names.getAsString()); |
| 362 } else if (store_names.isStringSequence()) { | 362 } else if (store_names.isStringSequence()) { |
| 363 for (const String& name : store_names.getAsStringSequence()) | 363 for (const String& name : store_names.getAsStringSequence()) |
| 364 scope.insert(name); | 364 scope.insert(name); |
| 365 } else if (store_names.isDOMStringList()) { | |
| 366 const Vector<String>& list = *store_names.getAsDOMStringList(); | |
| 367 for (const String& name : list) | |
| 368 scope.insert(name); | |
| 369 } else { | 365 } else { |
| 370 NOTREACHED(); | 366 NOTREACHED(); |
| 371 } | 367 } |
| 372 | 368 |
| 373 if (version_change_transaction_) { | 369 if (version_change_transaction_) { |
| 374 exception_state.ThrowDOMException( | 370 exception_state.ThrowDOMException( |
| 375 kInvalidStateError, "A version change transaction is running."); | 371 kInvalidStateError, "A version change transaction is running."); |
| 376 return nullptr; | 372 return nullptr; |
| 377 } | 373 } |
| 378 | 374 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 | 591 |
| 596 void IDBDatabase::RecordApiCallsHistogram(IndexedDatabaseMethods method) { | 592 void IDBDatabase::RecordApiCallsHistogram(IndexedDatabaseMethods method) { |
| 597 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 593 DEFINE_THREAD_SAFE_STATIC_LOCAL( |
| 598 EnumerationHistogram, api_calls_histogram, | 594 EnumerationHistogram, api_calls_histogram, |
| 599 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", | 595 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", |
| 600 kIDBMethodsMax)); | 596 kIDBMethodsMax)); |
| 601 api_calls_histogram.Count(method); | 597 api_calls_histogram.Count(method); |
| 602 } | 598 } |
| 603 | 599 |
| 604 } // namespace blink | 600 } // namespace blink |
| OLD | NEW |