Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp |
| diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp |
| index a3d4e48d73ef923772049742b3bd8b4f5de7f624..0a66aae0c8c9b6a6186813ee10d95a402fdf4fbf 100644 |
| --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp |
| +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp |
| @@ -8,7 +8,8 @@ |
| #include "bindings/core/v8/ExceptionState.h" |
| #include "bindings/core/v8/V8Binding.h" |
| #include "bindings/core/v8/V8DOMWrapper.h" |
| -#include "bindings/modules/v8/V8IDBObserverCallback.h" |
| +#include "bindings/core/v8/V8PrivateProperty.h" |
| +#include "bindings/modules/v8/IDBObserverCallback.h" |
| #include "bindings/modules/v8/V8IDBObserverInit.h" |
| namespace blink { |
| @@ -44,13 +45,17 @@ void V8IDBObserver::constructorCustom( |
| if (exceptionState.hadException()) |
| return; |
| + v8::Local<v8::Function> v8Callback = v8::Local<v8::Function>::Cast(info[0]); |
| IDBObserverCallback* callback = |
| - new V8IDBObserverCallback(v8::Local<v8::Function>::Cast(info[0]), wrapper, |
| - ScriptState::current(info.GetIsolate())); |
| - IDBObserver* observer = IDBObserver::create(*callback, idbObserverInit); |
| + IDBObserverCallback::create(info.GetIsolate(), v8Callback); |
| + IDBObserver* observer = IDBObserver::create( |
| + ScriptState::forReceiverObject(info), callback, idbObserverInit); |
| if (exceptionState.hadException()) |
| return; |
| DCHECK(observer); |
| + // TODO(bashi): Do we need this? |
| + V8PrivateProperty::getIDBObserverCallback(info.GetIsolate()) |
|
bashi
2016/10/07 07:07:26
Auto-generated IDBObserverCallback calls setPhanto
haraken
2016/10/07 07:23:35
The point is that we need to add a strong referenc
bashi
2016/10/07 07:28:38
OK, let me ask another question. Who/when to call
|
| + .set(info.GetIsolate()->GetCurrentContext(), wrapper, v8Callback); |
| v8SetReturnValue(info, |
| V8DOMWrapper::associateObjectWithWrapper( |
| info.GetIsolate(), observer, &wrapperTypeInfo, wrapper)); |