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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 ASSERT(m_transactions.contains(transactionId)); | 160 ASSERT(m_transactions.contains(transactionId)); |
161 m_transactions.get(transactionId)->onAbort(error); | 161 m_transactions.get(transactionId)->onAbort(error); |
162 } | 162 } |
163 | 163 |
164 void IDBDatabase::onComplete(int64_t transactionId) | 164 void IDBDatabase::onComplete(int64_t transactionId) |
165 { | 165 { |
166 ASSERT(m_transactions.contains(transactionId)); | 166 ASSERT(m_transactions.contains(transactionId)); |
167 m_transactions.get(transactionId)->onComplete(); | 167 m_transactions.get(transactionId)->onComplete(); |
168 } | 168 } |
169 | 169 |
170 PassRefPtr<DOMStringList> IDBDatabase::objectStoreNames() const | 170 PassRefPtrWillBeRawPtr<DOMStringList> IDBDatabase::objectStoreNames() const |
171 { | 171 { |
172 RefPtr<DOMStringList> objectStoreNames = DOMStringList::create(); | 172 RefPtrWillBeMember<DOMStringList> objectStoreNames = DOMStringList::create()
; |
173 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator it = m_metadata.obj
ectStores.begin(); it != m_metadata.objectStores.end(); ++it) | 173 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator it = m_metadata.obj
ectStores.begin(); it != m_metadata.objectStores.end(); ++it) |
174 objectStoreNames->append(it->value.name); | 174 objectStoreNames->append(it->value.name); |
175 objectStoreNames->sort(); | 175 objectStoreNames->sort(); |
176 return objectStoreNames.release(); | 176 return objectStoreNames.release(); |
177 } | 177 } |
178 | 178 |
179 ScriptValue IDBDatabase::version(NewScriptState* scriptState) const | 179 ScriptValue IDBDatabase::version(NewScriptState* scriptState) const |
180 { | 180 { |
181 int64_t intVersion = m_metadata.intVersion; | 181 int64_t intVersion = m_metadata.intVersion; |
182 if (intVersion == IDBDatabaseMetadata::NoIntVersion) | 182 if (intVersion == IDBDatabaseMetadata::NoIntVersion) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 int64_t transactionId = nextTransactionId(); | 326 int64_t transactionId = nextTransactionId(); |
327 m_backend->createTransaction(transactionId, WebIDBDatabaseCallbacksImpl::cre
ate(m_databaseCallbacks).leakPtr(), objectStoreIds, mode); | 327 m_backend->createTransaction(transactionId, WebIDBDatabaseCallbacksImpl::cre
ate(m_databaseCallbacks).leakPtr(), objectStoreIds, mode); |
328 | 328 |
329 RefPtr<IDBTransaction> transaction = IDBTransaction::create(context, transac
tionId, scope, mode, this); | 329 RefPtr<IDBTransaction> transaction = IDBTransaction::create(context, transac
tionId, scope, mode, this); |
330 return transaction.release(); | 330 return transaction.release(); |
331 } | 331 } |
332 | 332 |
333 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ExecutionContext* context, c
onst String& storeName, const String& mode, ExceptionState& exceptionState) | 333 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ExecutionContext* context, c
onst String& storeName, const String& mode, ExceptionState& exceptionState) |
334 { | 334 { |
335 RefPtr<DOMStringList> storeNames = DOMStringList::create(); | 335 RefPtrWillBeMember<DOMStringList> storeNames = DOMStringList::create(); |
336 storeNames->append(storeName); | 336 storeNames->append(storeName); |
337 return transaction(context, storeNames, mode, exceptionState); | 337 return transaction(context, storeNames, mode, exceptionState); |
338 } | 338 } |
339 | 339 |
340 void IDBDatabase::forceClose() | 340 void IDBDatabase::forceClose() |
341 { | 341 { |
342 for (TransactionMap::const_iterator::Values it = m_transactions.begin().valu
es(), end = m_transactions.end().values(); it != end; ++it) | 342 for (TransactionMap::const_iterator::Values it = m_transactions.begin().valu
es(), end = m_transactions.end().values(); it != end; ++it) |
343 (*it)->abort(IGNORE_EXCEPTION); | 343 (*it)->abort(IGNORE_EXCEPTION); |
344 this->close(); | 344 this->close(); |
345 enqueueEvent(Event::create(EventTypeNames::close)); | 345 enqueueEvent(Event::create(EventTypeNames::close)); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 { | 452 { |
453 return EventTargetNames::IDBDatabase; | 453 return EventTargetNames::IDBDatabase; |
454 } | 454 } |
455 | 455 |
456 ExecutionContext* IDBDatabase::executionContext() const | 456 ExecutionContext* IDBDatabase::executionContext() const |
457 { | 457 { |
458 return ActiveDOMObject::executionContext(); | 458 return ActiveDOMObject::executionContext(); |
459 } | 459 } |
460 | 460 |
461 } // namespace WebCore | 461 } // namespace WebCore |
OLD | NEW |