OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #include "bindings/core/v8/V8PerformanceObserverCallback.h" | 8 #include "bindings/core/v8/V8IntersectionObserverCallback.h" |
9 | 9 |
10 #include "bindings/core/v8/ScriptController.h" | 10 #include "bindings/core/v8/ScriptController.h" |
11 #include "bindings/core/v8/V8Binding.h" | 11 #include "bindings/core/v8/V8Binding.h" |
12 #include "bindings/core/v8/V8PerformanceObserver.h" | 12 #include "bindings/core/v8/V8IntersectionObserver.h" |
13 #include "bindings/core/v8/V8PerformanceObserverEntryList.h" | |
14 #include "core/dom/ExecutionContext.h" | 13 #include "core/dom/ExecutionContext.h" |
15 #include "wtf/Assertions.h" | 14 #include "wtf/Assertions.h" |
16 | 15 |
17 namespace blink { | 16 namespace blink { |
18 | 17 |
19 V8PerformanceObserverCallback::V8PerformanceObserverCallback(v8::Local<v8::Funct
ion> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) | 18 V8IntersectionObserverCallback::V8IntersectionObserverCallback(v8::Local<v8::Fun
ction> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) |
20 : ActiveDOMCallback(scriptState->executionContext()) | 19 : ActiveDOMCallback(scriptState->executionContext()) |
21 , m_callback(scriptState->isolate(), callback) | 20 , m_callback(scriptState->isolate(), callback) |
22 , m_scriptState(scriptState) | 21 , m_scriptState(scriptState) |
23 { | 22 { |
24 V8HiddenValue::setHiddenValue(scriptState->isolate(), owner, V8HiddenValue::
callback(scriptState->isolate()), callback); | 23 V8HiddenValue::setHiddenValue(scriptState->isolate(), owner, V8HiddenValue::
callback(scriptState->isolate()), callback); |
25 m_callback.setWeak(this, &setWeakCallback); | 24 m_callback.setWeak(this, &setWeakCallback); |
26 } | 25 } |
27 | 26 |
28 V8PerformanceObserverCallback::~V8PerformanceObserverCallback() | 27 V8IntersectionObserverCallback::~V8IntersectionObserverCallback() |
29 { | 28 { |
30 } | 29 } |
31 | 30 |
32 void V8PerformanceObserverCallback::handleEvent(PerformanceObserverEntryList* en
tries, PerformanceObserver* observer) | 31 void V8IntersectionObserverCallback::handleEvent(WillBeHeapVector<RefPtrWillBeMe
mber<IntersectionObserverEntry>>& entries, IntersectionObserver* observer) |
33 { | 32 { |
34 if (!canInvokeCallback()) | 33 if (!canInvokeCallback()) |
35 return; | 34 return; |
36 | 35 |
37 if (!m_scriptState->contextIsValid()) | 36 if (!m_scriptState->contextIsValid()) |
38 return; | 37 return; |
39 ScriptState::Scope scope(m_scriptState.get()); | 38 ScriptState::Scope scope(m_scriptState.get()); |
40 | 39 |
41 if (m_callback.isEmpty()) | 40 if (m_callback.isEmpty()) |
42 return; | 41 return; |
(...skipping 12 matching lines...) Expand all Loading... |
55 if (entriesHandle.IsEmpty()) { | 54 if (entriesHandle.IsEmpty()) { |
56 return; | 55 return; |
57 } | 56 } |
58 v8::Local<v8::Value> argv[] = { entriesHandle, observerHandle }; | 57 v8::Local<v8::Value> argv[] = { entriesHandle, observerHandle }; |
59 | 58 |
60 v8::TryCatch exceptionCatcher; | 59 v8::TryCatch exceptionCatcher; |
61 exceptionCatcher.SetVerbose(true); | 60 exceptionCatcher.SetVerbose(true); |
62 ScriptController::callFunction(m_scriptState->executionContext(), m_callback
.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate
()); | 61 ScriptController::callFunction(m_scriptState->executionContext(), m_callback
.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate
()); |
63 } | 62 } |
64 | 63 |
65 void V8PerformanceObserverCallback::setWeakCallback(const v8::WeakCallbackInfo<V
8PerformanceObserverCallback>& data) | 64 void V8IntersectionObserverCallback::setWeakCallback(const v8::WeakCallbackInfo<
V8IntersectionObserverCallback>& data) |
66 { | 65 { |
67 data.GetParameter()->m_callback.clear(); | 66 data.GetParameter()->m_callback.clear(); |
68 } | 67 } |
69 | 68 |
70 DEFINE_TRACE(V8PerformanceObserverCallback) | 69 DEFINE_TRACE(V8IntersectionObserverCallback) |
71 { | 70 { |
72 PerformanceObserverCallback::trace(visitor); | 71 IntersectionObserverCallback::trace(visitor); |
73 ActiveDOMCallback::trace(visitor); | 72 ActiveDOMCallback::trace(visitor); |
74 } | 73 } |
75 | 74 |
76 } // namespace blink | 75 } // namespace blink |
OLD | NEW |