| Index: third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp
|
| index b6b52f225454ff1cbcea33d5410a96abffd77b9f..34e4b3a9b43476686d049836a6219dad1e861fa8 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp
|
| @@ -18,11 +18,10 @@ namespace blink {
|
|
|
| V8PerformanceObserverCallback::V8PerformanceObserverCallback(v8::Local<v8::Function> callback, v8::Local<v8::Object> owner, ScriptState* scriptState)
|
| : ActiveDOMCallback(scriptState->getExecutionContext())
|
| - , m_callback(scriptState->isolate(), callback)
|
| + , m_callback(V8PerformanceObserverInnerCallback::create(scriptState->isolate(), callback))
|
| , m_scriptState(scriptState)
|
| {
|
| V8PrivateProperty::getPerformanceObserverCallback(scriptState->isolate()).set(scriptState->context(), owner, callback);
|
| - m_callback.setPhantom();
|
| }
|
|
|
| V8PerformanceObserverCallback::~V8PerformanceObserverCallback()
|
| @@ -31,35 +30,17 @@ V8PerformanceObserverCallback::~V8PerformanceObserverCallback()
|
|
|
| void V8PerformanceObserverCallback::handleEvent(PerformanceObserverEntryList* entries, PerformanceObserver* observer)
|
| {
|
| - if (!canInvokeCallback())
|
| - return;
|
| + ScriptWrappable* scriptWrappable;
|
| + ScriptState* scriptState;
|
|
|
| - if (!m_scriptState->contextIsValid())
|
| - return;
|
| - ScriptState::Scope scope(m_scriptState.get());
|
| -
|
| - if (m_callback.isEmpty())
|
| - return;
|
| - v8::Local<v8::Value> observerHandle = toV8(observer, m_scriptState->context()->Global(), m_scriptState->isolate());
|
| - if (!observerHandle->IsObject())
|
| - return;
|
| -
|
| - v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandle);
|
| - v8::Local<v8::Value> entriesHandle = toV8(entries, m_scriptState->context()->Global(), m_scriptState->isolate());
|
| - if (entriesHandle.IsEmpty()) {
|
| - return;
|
| - }
|
| - v8::Local<v8::Value> argv[] = { entriesHandle, observerHandle };
|
| -
|
| - v8::TryCatch exceptionCatcher(m_scriptState->isolate());
|
| - exceptionCatcher.SetVerbose(true);
|
| - V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()), m_scriptState->getExecutionContext(), thisObject, 2, argv, m_scriptState->isolate());
|
| + m_callback->call(scriptState = nullptr , scriptWrappable = nullptr , entries, observer);
|
| }
|
|
|
| DEFINE_TRACE(V8PerformanceObserverCallback)
|
| {
|
| PerformanceObserverCallback::trace(visitor);
|
| ActiveDOMCallback::trace(visitor);
|
| + visitor->trace(m_callback);
|
| }
|
|
|
| } // namespace blink
|
|
|