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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 visitor->trace(m_transaction); 68 visitor->trace(m_transaction);
69 visitor->trace(m_indexMap); 69 visitor->trace(m_indexMap);
70 visitor->trace(m_createdIndexes); 70 visitor->trace(m_createdIndexes);
71 } 71 }
72 72
73 ScriptValue IDBObjectStore::keyPath(ScriptState* scriptState) const 73 ScriptValue IDBObjectStore::keyPath(ScriptState* scriptState) const
74 { 74 {
75 return ScriptValue::from(scriptState, m_metadata.keyPath); 75 return ScriptValue::from(scriptState, m_metadata.keyPath);
76 } 76 }
77 77
78 PassRefPtrWillBeRawPtr<DOMStringList> IDBObjectStore::indexNames() const 78 RawPtr<DOMStringList> IDBObjectStore::indexNames() const
79 { 79 {
80 IDB_TRACE("IDBObjectStore::indexNames"); 80 IDB_TRACE("IDBObjectStore::indexNames");
81 RefPtrWillBeRawPtr<DOMStringList> indexNames = DOMStringList::create(DOMStri ngList::IndexedDB); 81 RawPtr<DOMStringList> indexNames = DOMStringList::create(DOMStringList::Inde xedDB);
82 for (const auto& it : m_metadata.indexes) 82 for (const auto& it : m_metadata.indexes)
83 indexNames->append(it.value.name); 83 indexNames->append(it.value.name);
84 indexNames->sort(); 84 indexNames->sort();
85 return indexNames.release(); 85 return indexNames.release();
86 } 86 }
87 87
88 IDBRequest* IDBObjectStore::get(ScriptState* scriptState, const ScriptValue& key , ExceptionState& exceptionState) 88 IDBRequest* IDBObjectStore::get(ScriptState* scriptState, const ScriptValue& key , ExceptionState& exceptionState)
89 { 89 {
90 IDB_TRACE("IDBObjectStore::get"); 90 IDB_TRACE("IDBObjectStore::get");
91 if (isDeleted()) { 91 if (isDeleted()) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 409 }
410 410
411 namespace { 411 namespace {
412 // This class creates the index keys for a given index by extracting 412 // This class creates the index keys for a given index by extracting
413 // them from the SerializedScriptValue, for all the existing values in 413 // them from the SerializedScriptValue, for all the existing values in
414 // the objectStore. It only needs to be kept alive by virtue of being 414 // the objectStore. It only needs to be kept alive by virtue of being
415 // a listener on an IDBRequest object, in the same way that JavaScript 415 // a listener on an IDBRequest object, in the same way that JavaScript
416 // cursor success handlers are kept alive. 416 // cursor success handlers are kept alive.
417 class IndexPopulator final : public EventListener { 417 class IndexPopulator final : public EventListener {
418 public: 418 public:
419 static PassRefPtrWillBeRawPtr<IndexPopulator> create(ScriptState* scriptStat e, IDBDatabase* database, int64_t transactionId, int64_t objectStoreId, const ID BIndexMetadata& indexMetadata) 419 static RawPtr<IndexPopulator> create(ScriptState* scriptState, IDBDatabase* database, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
420 { 420 {
421 return adoptRefWillBeNoop(new IndexPopulator(scriptState, database, tran sactionId, objectStoreId, indexMetadata)); 421 return new IndexPopulator(scriptState, database, transactionId, objectSt oreId, indexMetadata);
422 } 422 }
423 423
424 bool operator==(const EventListener& other) const override 424 bool operator==(const EventListener& other) const override
425 { 425 {
426 return this == &other; 426 return this == &other;
427 } 427 }
428 428
429 DEFINE_INLINE_VIRTUAL_TRACE() 429 DEFINE_INLINE_VIRTUAL_TRACE()
430 { 430 {
431 visitor->trace(m_database); 431 visitor->trace(m_database);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } else { 476 } else {
477 // Now that we are done indexing, tell the backend to go 477 // Now that we are done indexing, tell the backend to go
478 // back to processing tasks of type NormalTask. 478 // back to processing tasks of type NormalTask.
479 m_database->backend()->setIndexesReady(m_transactionId, m_objectStor eId, indexIds); 479 m_database->backend()->setIndexesReady(m_transactionId, m_objectStor eId, indexIds);
480 m_database.clear(); 480 m_database.clear();
481 } 481 }
482 482
483 } 483 }
484 484
485 RefPtr<ScriptState> m_scriptState; 485 RefPtr<ScriptState> m_scriptState;
486 PersistentWillBeMember<IDBDatabase> m_database; 486 Member<IDBDatabase> m_database;
487 const int64_t m_transactionId; 487 const int64_t m_transactionId;
488 const int64_t m_objectStoreId; 488 const int64_t m_objectStoreId;
489 const IDBIndexMetadata m_indexMetadata; 489 const IDBIndexMetadata m_indexMetadata;
490 }; 490 };
491 } // namespace 491 } // namespace
492 492
493 IDBIndex* IDBObjectStore::createIndex(ScriptState* scriptState, const String& na me, const IDBKeyPath& keyPath, const IDBIndexParameters& options, ExceptionState & exceptionState) 493 IDBIndex* IDBObjectStore::createIndex(ScriptState* scriptState, const String& na me, const IDBKeyPath& keyPath, const IDBIndexParameters& options, ExceptionState & exceptionState)
494 { 494 {
495 IDB_TRACE("IDBObjectStore::createIndex"); 495 IDB_TRACE("IDBObjectStore::createIndex");
496 if (!m_transaction->isVersionChange()) { 496 if (!m_transaction->isVersionChange()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 m_transaction->db()->indexCreated(id(), metadata); 540 m_transaction->db()->indexCreated(id(), metadata);
541 541
542 ASSERT(!exceptionState.hadException()); 542 ASSERT(!exceptionState.hadException());
543 if (exceptionState.hadException()) 543 if (exceptionState.hadException())
544 return nullptr; 544 return nullptr;
545 545
546 IDBRequest* indexRequest = openCursor(scriptState, nullptr, WebIDBCursorDire ctionNext, WebIDBTaskTypePreemptive); 546 IDBRequest* indexRequest = openCursor(scriptState, nullptr, WebIDBCursorDire ctionNext, WebIDBTaskTypePreemptive);
547 indexRequest->preventPropagation(); 547 indexRequest->preventPropagation();
548 548
549 // This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction. 549 // This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction.
550 RefPtrWillBeRawPtr<IndexPopulator> indexPopulator = IndexPopulator::create(s criptState, transaction()->db(), m_transaction->id(), id(), metadata); 550 RawPtr<IndexPopulator> indexPopulator = IndexPopulator::create(scriptState, transaction()->db(), m_transaction->id(), id(), metadata);
551 indexRequest->setOnsuccess(indexPopulator); 551 indexRequest->setOnsuccess(indexPopulator);
552 return index; 552 return index;
553 } 553 }
554 554
555 IDBIndex* IDBObjectStore::index(const String& name, ExceptionState& exceptionSta te) 555 IDBIndex* IDBObjectStore::index(const String& name, ExceptionState& exceptionSta te)
556 { 556 {
557 IDB_TRACE("IDBObjectStore::index"); 557 IDB_TRACE("IDBObjectStore::index");
558 if (isDeleted()) { 558 if (isDeleted()) {
559 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage); 559 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage);
560 return nullptr; 560 return nullptr;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 } 756 }
757 return IDBIndexMetadata::InvalidId; 757 return IDBIndexMetadata::InvalidId;
758 } 758 }
759 759
760 WebIDBDatabase* IDBObjectStore::backendDB() const 760 WebIDBDatabase* IDBObjectStore::backendDB() const
761 { 761 {
762 return m_transaction->backendDB(); 762 return m_transaction->backendDB();
763 } 763 }
764 764
765 } // namespace blink 765 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698