| 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..f4d8fdf45fa315025f75477a972f6a5899f98ea4 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,18 @@ 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): Don't set private property (and remove this custom
|
| + // constructor) when we can call setWrapperReference() correctly.
|
| + V8PrivateProperty::getIDBObserverCallback(info.GetIsolate())
|
| + .set(info.GetIsolate()->GetCurrentContext(), wrapper, v8Callback);
|
| v8SetReturnValue(info,
|
| V8DOMWrapper::associateObjectWithWrapper(
|
| info.GetIsolate(), observer, &wrapperTypeInfo, wrapper));
|
|
|