| 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 "modules/csspaint/CSSPaintDefinition.h" | 5 #include "modules/csspaint/CSSPaintDefinition.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8BindingForCore.h" | 7 #include "bindings/core/v8/V8BindingForCore.h" |
| 8 #include "core/css/CSSComputedStyleDeclaration.h" | 8 #include "core/css/CSSComputedStyleDeclaration.h" |
| 9 #include "core/css/cssom/FilteredComputedStylePropertyMap.h" | 9 #include "core/css/cssom/FilteredComputedStylePropertyMap.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 CSSPaintDefinition::CSSPaintDefinition( | 49 CSSPaintDefinition::CSSPaintDefinition( |
| 50 ScriptState* script_state, | 50 ScriptState* script_state, |
| 51 v8::Local<v8::Function> constructor, | 51 v8::Local<v8::Function> constructor, |
| 52 v8::Local<v8::Function> paint, | 52 v8::Local<v8::Function> paint, |
| 53 Vector<CSSPropertyID>& native_invalidation_properties, | 53 Vector<CSSPropertyID>& native_invalidation_properties, |
| 54 Vector<AtomicString>& custom_invalidation_properties, | 54 Vector<AtomicString>& custom_invalidation_properties, |
| 55 Vector<CSSSyntaxDescriptor>& input_argument_types, | 55 Vector<CSSSyntaxDescriptor>& input_argument_types, |
| 56 bool has_alpha) | 56 bool has_alpha) |
| 57 : script_state_(script_state), | 57 : script_state_(script_state), |
| 58 constructor_(script_state->GetIsolate(), constructor), | 58 constructor_(script_state->GetIsolate(), this, constructor), |
| 59 paint_(script_state->GetIsolate(), paint), | 59 paint_(script_state->GetIsolate(), this, paint), |
| 60 instance_(this), |
| 60 did_call_constructor_(false), | 61 did_call_constructor_(false), |
| 61 has_alpha_(has_alpha) { | 62 has_alpha_(has_alpha) { |
| 62 native_invalidation_properties_.swap(native_invalidation_properties); | 63 native_invalidation_properties_.swap(native_invalidation_properties); |
| 63 custom_invalidation_properties_.swap(custom_invalidation_properties); | 64 custom_invalidation_properties_.swap(custom_invalidation_properties); |
| 64 input_argument_types_.swap(input_argument_types); | 65 input_argument_types_.swap(input_argument_types); |
| 65 } | 66 } |
| 66 | 67 |
| 67 CSSPaintDefinition::~CSSPaintDefinition() {} | 68 CSSPaintDefinition::~CSSPaintDefinition() {} |
| 68 | 69 |
| 69 PassRefPtr<Image> CSSPaintDefinition::Paint( | 70 PassRefPtr<Image> CSSPaintDefinition::Paint( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 139 |
| 139 v8::Local<v8::Object> paint_instance; | 140 v8::Local<v8::Object> paint_instance; |
| 140 if (V8ObjectConstructor::NewInstance(isolate, constructor) | 141 if (V8ObjectConstructor::NewInstance(isolate, constructor) |
| 141 .ToLocal(&paint_instance)) { | 142 .ToLocal(&paint_instance)) { |
| 142 instance_.Set(isolate, paint_instance); | 143 instance_.Set(isolate, paint_instance); |
| 143 } | 144 } |
| 144 | 145 |
| 145 did_call_constructor_ = true; | 146 did_call_constructor_ = true; |
| 146 } | 147 } |
| 147 | 148 |
| 149 DEFINE_TRACE_WRAPPERS(CSSPaintDefinition) { |
| 150 visitor->TraceWrappers(constructor_.Cast<v8::Value>()); |
| 151 visitor->TraceWrappers(paint_.Cast<v8::Value>()); |
| 152 visitor->TraceWrappers(instance_.Cast<v8::Value>()); |
| 153 } |
| 154 |
| 148 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |