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

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

Issue 2449563002: [IndexedDB] Add Observer Tests (Closed)
Patch Set: Fixed errors in other tests, and marked observer tests as long Created 4 years, 1 month 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/indexeddb/IDBObserver.h" 5 #include "modules/indexeddb/IDBObserver.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/modules/v8/IDBObserverCallback.h" 8 #include "bindings/modules/v8/IDBObserverCallback.h"
9 #include "bindings/modules/v8/ToV8ForModules.h" 9 #include "bindings/modules/v8/ToV8ForModules.h"
10 #include "bindings/modules/v8/V8BindingForModules.h" 10 #include "bindings/modules/v8/V8BindingForModules.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 IDBObserver::IDBObserver(ScriptState* scriptState, 27 IDBObserver::IDBObserver(ScriptState* scriptState,
28 IDBObserverCallback* callback, 28 IDBObserverCallback* callback,
29 const IDBObserverInit& options) 29 const IDBObserverInit& options)
30 : m_scriptState(scriptState), 30 : m_scriptState(scriptState),
31 m_callback(callback), 31 m_callback(callback),
32 m_transaction(options.transaction()), 32 m_transaction(options.transaction()),
33 m_values(options.values()), 33 m_values(options.values()),
34 m_noRecords(options.noRecords()) { 34 m_noRecords(options.noRecords()) {
35 // TODO(palakj): Throw an exception if unknown operation type.
36 DCHECK_EQ(m_operationTypes.size(), 35 DCHECK_EQ(m_operationTypes.size(),
37 static_cast<size_t>(WebIDBOperationTypeCount)); 36 static_cast<size_t>(WebIDBOperationTypeCount));
38 m_operationTypes.reset(); 37 m_operationTypes.reset();
39 m_operationTypes[WebIDBAdd] = 38 m_operationTypes[WebIDBAdd] =
40 options.operationTypes().contains(IndexedDBNames::add); 39 options.operationTypes().contains(IndexedDBNames::add);
41 m_operationTypes[WebIDBPut] = 40 m_operationTypes[WebIDBPut] =
42 options.operationTypes().contains(IndexedDBNames::put); 41 options.operationTypes().contains(IndexedDBNames::put);
43 m_operationTypes[WebIDBDelete] = 42 m_operationTypes[WebIDBDelete] =
44 options.operationTypes().contains(IndexedDBNames::kDelete); 43 options.operationTypes().contains(IndexedDBNames::kDelete);
45 m_operationTypes[WebIDBClear] = 44 m_operationTypes[WebIDBClear] =
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 m_scriptState.get(), this, 105 m_scriptState.get(), this,
107 IDBObserverChanges::create(it->value, observations, observationIndex)); 106 IDBObserverChanges::create(it->value, observations, observationIndex));
108 } 107 }
109 108
110 DEFINE_TRACE(IDBObserver) { 109 DEFINE_TRACE(IDBObserver) {
111 visitor->trace(m_callback); 110 visitor->trace(m_callback);
112 visitor->trace(m_observerIds); 111 visitor->trace(m_observerIds);
113 } 112 }
114 113
115 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698