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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/V8IDBObserverCallback.cpp

Issue 2031113002: IndexedDB Observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Observer idl 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/bindings/modules/v8/V8IDBObserverCallback.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8IDBObserverCallback.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8IDBObserverCallback.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4b49d6bd61c2b3b1bb1cd9283ed1f35e8bb65ab8
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8IDBObserverCallback.cpp
@@ -0,0 +1,40 @@
+// 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 "bindings/modules/v8/V8IDBObserverCallback.h"
+
+#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "bindings/modules/v8/V8IDBObserver.h"
+#include "core/dom/ExecutionContext.h"
+#include "wtf/Assertions.h"
+
+namespace blink {
+
+V8IDBObserverCallback::V8IDBObserverCallback(v8::Local<v8::Function> callback, v8::Local<v8::Object> owner, ScriptState* scriptState)
+ : ActiveDOMCallback(scriptState->getExecutionContext())
+ , m_callback(scriptState->isolate(), callback)
+ , m_scriptState(scriptState)
+{
+ // has been changed for intersection observer
+ V8HiddenValue::setHiddenValue(scriptState, owner, V8HiddenValue::callback(scriptState->isolate()), callback);
dmurph 2016/06/04 00:56:18 As discussed, please change to match. You'll have
palakj1 2016/06/06 19:49:30 Done
+ m_callback.setWeak(this, &setWeakCallback);
+}
+
+V8IDBObserverCallback::~V8IDBObserverCallback()
+{
+}
+
+void V8IDBObserverCallback::setWeakCallback(const v8::WeakCallbackInfo<V8IDBObserverCallback>& data)
+{
+ data.GetParameter()->m_callback.clear();
+}
+
+DEFINE_TRACE(V8IDBObserverCallback)
+{
+ IDBObserverCallback::trace(visitor);
+ ActiveDOMCallback::trace(visitor);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698