OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "bindings/core/v8/ScriptCustomElementDefinition.h" | 5 #include "bindings/core/v8/ScriptCustomElementDefinition.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "bindings/core/v8/V8BindingMacros.h" | 9 #include "bindings/core/v8/V8BindingMacros.h" |
10 #include "bindings/core/v8/V8CustomElementRegistry.h" | 10 #include "bindings/core/v8/V8CustomElementRegistry.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 template <typename T> | 88 template <typename T> |
89 static void keepAlive(v8::Local<v8::Object>& object, | 89 static void keepAlive(v8::Local<v8::Object>& object, |
90 SymbolGetter symbolGetter, | 90 SymbolGetter symbolGetter, |
91 const v8::Local<T>& value, | 91 const v8::Local<T>& value, |
92 ScopedPersistent<T>& persistent, | 92 ScopedPersistent<T>& persistent, |
93 ScriptState* scriptState) { | 93 ScriptState* scriptState) { |
94 if (value.IsEmpty()) | 94 if (value.IsEmpty()) |
95 return; | 95 return; |
96 | 96 |
97 v8::Isolate* isolate = scriptState->isolate(); | 97 v8::Isolate* isolate = scriptState->isolate(); |
98 symbolGetter(isolate).set(scriptState->context(), object, value); | 98 symbolGetter(isolate).set(object, value); |
99 persistent.set(isolate, value); | 99 persistent.set(isolate, value); |
100 persistent.setPhantom(); | 100 persistent.setPhantom(); |
101 } | 101 } |
102 | 102 |
103 ScriptCustomElementDefinition* ScriptCustomElementDefinition::create( | 103 ScriptCustomElementDefinition* ScriptCustomElementDefinition::create( |
104 ScriptState* scriptState, | 104 ScriptState* scriptState, |
105 CustomElementRegistry* registry, | 105 CustomElementRegistry* registry, |
106 const CustomElementDescriptor& descriptor, | 106 const CustomElementDescriptor& descriptor, |
107 const v8::Local<v8::Object>& constructor, | 107 const v8::Local<v8::Object>& constructor, |
108 const v8::Local<v8::Function>& connectedCallback, | 108 const v8::Local<v8::Function>& connectedCallback, |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 v8::Local<v8::Value> argv[] = { | 363 v8::Local<v8::Value> argv[] = { |
364 v8String(isolate, name.localName()), v8StringOrNull(isolate, oldValue), | 364 v8String(isolate, name.localName()), v8StringOrNull(isolate, oldValue), |
365 v8StringOrNull(isolate, newValue), | 365 v8StringOrNull(isolate, newValue), |
366 v8StringOrNull(isolate, name.namespaceURI()), | 366 v8StringOrNull(isolate, name.namespaceURI()), |
367 }; | 367 }; |
368 runCallback(m_attributeChangedCallback.newLocal(isolate), element, | 368 runCallback(m_attributeChangedCallback.newLocal(isolate), element, |
369 WTF_ARRAY_LENGTH(argv), argv); | 369 WTF_ARRAY_LENGTH(argv), argv); |
370 } | 370 } |
371 | 371 |
372 } // namespace blink | 372 } // namespace blink |
OLD | NEW |