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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp

Issue 2031113002: IndexedDB Observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: idl changes Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..013381ec4467b1c69d97383b20e7a47b13a0c17e
--- /dev/null
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/indexeddb/IDBObserver.h"
+
+#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/ExceptionStatePlaceholder.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/SerializedScriptValueFactory.h"
+#include "bindings/modules/v8/ToV8ForModules.h"
+#include "bindings/modules/v8/V8BindingForModules.h"
+#include "core/dom/DOMStringList.h"
+#include "core/dom/ExceptionCode.h"
+#include "core/dom/ExecutionContext.h"
+#include "modules/indexeddb/IDBObserverCallback.h"
+#include "modules/indexeddb/IDBObserverChanges.h"
+#include "modules/indexeddb/IDBObserverInit.h"
+#include "platform/SharedBuffer.h"
+#include <v8.h>
+
+namespace blink {
+
+IDBObserver* IDBObserver::create(IDBObserverCallback& callback, const IDBObserverInit& options)
+{
+ return new IDBObserver(callback, options.transaction(), options.values(), options.noRecords());
+}
+
+IDBObserver::IDBObserver(IDBObserverCallback& callback, bool transaction, bool values, bool noRecords)
+ : m_callback(&callback)
+ , m_transaction(transaction)
+ , m_values(values)
+ , m_noRecords(noRecords)
+{
+ id = 1;
+}
+
+void IDBObserver::clearWeakMembers(Visitor* visitor)
+{
+}
+
+void IDBObserver::observe(IDBDatabase* db, IDBTransaction* tx, ExceptionState& exceptionState)
Marijn Kruisselbrink 2016/06/02 23:51:24 Blink coding style doesn't like using abbreviation
palakj1 2016/06/03 01:21:53 Done. Thanks for the tip.
+{
+}
+
+DEFINE_TRACE(IDBObserver)
+{
+ visitor->template registerWeakMembers<IDBObserver, &IDBObserver::clearWeakMembers>(this);
dmurph 2016/06/02 23:48:37 I did not even know that this syntax was a thing h
palakj1 2016/06/03 01:21:52 I don't think we'd need this. Removing it.
+ visitor->trace(m_callback);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698