| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 } | 380 } |
| 381 | 381 |
| 382 Vector<int64_t> objectStoreIds; | 382 Vector<int64_t> objectStoreIds; |
| 383 for (const String& name : scope) { | 383 for (const String& name : scope) { |
| 384 int64_t objectStoreId = findObjectStoreId(name); | 384 int64_t objectStoreId = findObjectStoreId(name); |
| 385 if (objectStoreId == IDBObjectStoreMetadata::InvalidId) { | 385 if (objectStoreId == IDBObjectStoreMetadata::InvalidId) { |
| 386 exceptionState.throwDOMException( | 386 exceptionState.throwDOMException( |
| 387 NotFoundError, "One of the specified object stores was not found."); | 387 NotFoundError, "One of the specified object stores was not found."); |
| 388 return nullptr; | 388 return nullptr; |
| 389 } | 389 } |
| 390 objectStoreIds.append(objectStoreId); | 390 objectStoreIds.push_back(objectStoreId); |
| 391 } | 391 } |
| 392 | 392 |
| 393 WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString); | 393 WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString); |
| 394 if (mode != WebIDBTransactionModeReadOnly && | 394 if (mode != WebIDBTransactionModeReadOnly && |
| 395 mode != WebIDBTransactionModeReadWrite) { | 395 mode != WebIDBTransactionModeReadWrite) { |
| 396 exceptionState.throwTypeError( | 396 exceptionState.throwTypeError( |
| 397 "The mode provided ('" + modeString + | 397 "The mode provided ('" + modeString + |
| 398 "') is not one of 'readonly' or 'readwrite'."); | 398 "') is not one of 'readonly' or 'readwrite'."); |
| 399 return nullptr; | 399 return nullptr; |
| 400 } | 400 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 : Nullable<unsigned long long>(newVersion); | 469 : Nullable<unsigned long long>(newVersion); |
| 470 enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, | 470 enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, |
| 471 oldVersion, newVersionNullable)); | 471 oldVersion, newVersionNullable)); |
| 472 } | 472 } |
| 473 | 473 |
| 474 void IDBDatabase::enqueueEvent(Event* event) { | 474 void IDBDatabase::enqueueEvent(Event* event) { |
| 475 DCHECK(getExecutionContext()); | 475 DCHECK(getExecutionContext()); |
| 476 EventQueue* eventQueue = getExecutionContext()->getEventQueue(); | 476 EventQueue* eventQueue = getExecutionContext()->getEventQueue(); |
| 477 event->setTarget(this); | 477 event->setTarget(this); |
| 478 eventQueue->enqueueEvent(event); | 478 eventQueue->enqueueEvent(event); |
| 479 m_enqueuedEvents.append(event); | 479 m_enqueuedEvents.push_back(event); |
| 480 } | 480 } |
| 481 | 481 |
| 482 DispatchEventResult IDBDatabase::dispatchEventInternal(Event* event) { | 482 DispatchEventResult IDBDatabase::dispatchEventInternal(Event* event) { |
| 483 IDB_TRACE("IDBDatabase::dispatchEvent"); | 483 IDB_TRACE("IDBDatabase::dispatchEvent"); |
| 484 if (!getExecutionContext()) | 484 if (!getExecutionContext()) |
| 485 return DispatchEventResult::CanceledBeforeDispatch; | 485 return DispatchEventResult::CanceledBeforeDispatch; |
| 486 DCHECK(event->type() == EventTypeNames::versionchange || | 486 DCHECK(event->type() == EventTypeNames::versionchange || |
| 487 event->type() == EventTypeNames::close); | 487 event->type() == EventTypeNames::close); |
| 488 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 488 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 489 if (m_enqueuedEvents[i].get() == event) | 489 if (m_enqueuedEvents[i].get() == event) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 580 |
| 581 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { | 581 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { |
| 582 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 582 DEFINE_THREAD_SAFE_STATIC_LOCAL( |
| 583 EnumerationHistogram, apiCallsHistogram, | 583 EnumerationHistogram, apiCallsHistogram, |
| 584 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", | 584 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", |
| 585 IDBMethodsMax)); | 585 IDBMethodsMax)); |
| 586 apiCallsHistogram.count(method); | 586 apiCallsHistogram.count(method); |
| 587 } | 587 } |
| 588 | 588 |
| 589 } // namespace blink | 589 } // namespace blink |
| OLD | NEW |