| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 ASSERT(m_transactions.contains(transactionId)); | 175 ASSERT(m_transactions.contains(transactionId)); |
| 176 m_transactions.get(transactionId)->onAbort(error); | 176 m_transactions.get(transactionId)->onAbort(error); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void IDBDatabase::onComplete(int64_t transactionId) | 179 void IDBDatabase::onComplete(int64_t transactionId) |
| 180 { | 180 { |
| 181 ASSERT(m_transactions.contains(transactionId)); | 181 ASSERT(m_transactions.contains(transactionId)); |
| 182 m_transactions.get(transactionId)->onComplete(); | 182 m_transactions.get(transactionId)->onComplete(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 PassRefPtr<DOMStringList> IDBDatabase::objectStoreNames() const | 185 PassRefPtrWillBeRawPtr<DOMStringList> IDBDatabase::objectStoreNames() const |
| 186 { | 186 { |
| 187 RefPtr<DOMStringList> objectStoreNames = DOMStringList::create(); | 187 RefPtrWillBeRawPtr<DOMStringList> objectStoreNames = DOMStringList::create()
; |
| 188 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator it = m_metadata.obj
ectStores.begin(); it != m_metadata.objectStores.end(); ++it) | 188 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator it = m_metadata.obj
ectStores.begin(); it != m_metadata.objectStores.end(); ++it) |
| 189 objectStoreNames->append(it->value.name); | 189 objectStoreNames->append(it->value.name); |
| 190 objectStoreNames->sort(); | 190 objectStoreNames->sort(); |
| 191 return objectStoreNames.release(); | 191 return objectStoreNames.release(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 ScriptValue IDBDatabase::version(ScriptState* scriptState) const | 194 ScriptValue IDBDatabase::version(ScriptState* scriptState) const |
| 195 { | 195 { |
| 196 int64_t intVersion = m_metadata.intVersion; | 196 int64_t intVersion = m_metadata.intVersion; |
| 197 if (intVersion == IDBDatabaseMetadata::NoIntVersion) | 197 if (intVersion == IDBDatabaseMetadata::NoIntVersion) |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 int64_t transactionId = nextTransactionId(); | 341 int64_t transactionId = nextTransactionId(); |
| 342 m_backend->createTransaction(transactionId, WebIDBDatabaseCallbacksImpl::cre
ate(m_databaseCallbacks).leakPtr(), objectStoreIds, mode); | 342 m_backend->createTransaction(transactionId, WebIDBDatabaseCallbacksImpl::cre
ate(m_databaseCallbacks).leakPtr(), objectStoreIds, mode); |
| 343 | 343 |
| 344 return IDBTransaction::create(context, transactionId, scope, mode, this); | 344 return IDBTransaction::create(context, transactionId, scope, mode, this); |
| 345 } | 345 } |
| 346 | 346 |
| 347 PassRefPtrWillBeRawPtr<IDBTransaction> IDBDatabase::transaction(ExecutionContext
* context, const String& storeName, const String& mode, ExceptionState& exceptio
nState) | 347 PassRefPtrWillBeRawPtr<IDBTransaction> IDBDatabase::transaction(ExecutionContext
* context, const String& storeName, const String& mode, ExceptionState& exceptio
nState) |
| 348 { | 348 { |
| 349 RefPtr<DOMStringList> storeNames = DOMStringList::create(); | 349 RefPtrWillBeRawPtr<DOMStringList> storeNames = DOMStringList::create(); |
| 350 storeNames->append(storeName); | 350 storeNames->append(storeName); |
| 351 return transaction(context, storeNames, mode, exceptionState); | 351 return transaction(context, storeNames, mode, exceptionState); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void IDBDatabase::forceClose() | 354 void IDBDatabase::forceClose() |
| 355 { | 355 { |
| 356 for (TransactionMap::const_iterator::Values it = m_transactions.begin().valu
es(), end = m_transactions.end().values(); it != end; ++it) | 356 for (TransactionMap::const_iterator::Values it = m_transactions.begin().valu
es(), end = m_transactions.end().values(); it != end; ++it) |
| 357 (*it)->abort(IGNORE_EXCEPTION); | 357 (*it)->abort(IGNORE_EXCEPTION); |
| 358 this->close(); | 358 this->close(); |
| 359 enqueueEvent(Event::create(EventTypeNames::close)); | 359 enqueueEvent(Event::create(EventTypeNames::close)); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 { | 466 { |
| 467 return EventTargetNames::IDBDatabase; | 467 return EventTargetNames::IDBDatabase; |
| 468 } | 468 } |
| 469 | 469 |
| 470 ExecutionContext* IDBDatabase::executionContext() const | 470 ExecutionContext* IDBDatabase::executionContext() const |
| 471 { | 471 { |
| 472 return ActiveDOMObject::executionContext(); | 472 return ActiveDOMObject::executionContext(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace WebCore | 475 } // namespace WebCore |
| OLD | NEW |