OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef V8PerContextData_h | 31 #ifndef V8PerContextData_h |
32 #define V8PerContextData_h | 32 #define V8PerContextData_h |
33 | 33 |
34 #include "bindings/core/v8/CSSPaintBinding.h" | |
34 #include "bindings/core/v8/CustomElementBinding.h" | 35 #include "bindings/core/v8/CustomElementBinding.h" |
35 #include "bindings/core/v8/ScopedPersistent.h" | 36 #include "bindings/core/v8/ScopedPersistent.h" |
36 #include "bindings/core/v8/V8GlobalValueMap.h" | 37 #include "bindings/core/v8/V8GlobalValueMap.h" |
37 #include "bindings/core/v8/WrapperTypeInfo.h" | 38 #include "bindings/core/v8/WrapperTypeInfo.h" |
38 #include "core/CoreExport.h" | 39 #include "core/CoreExport.h" |
39 #include "gin/public/context_holder.h" | 40 #include "gin/public/context_holder.h" |
40 #include "gin/public/gin_embedders.h" | 41 #include "gin/public/gin_embedders.h" |
41 #include "wtf/Allocator.h" | 42 #include "wtf/Allocator.h" |
42 #include "wtf/HashMap.h" | 43 #include "wtf/HashMap.h" |
43 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 { | 85 { |
85 v8::Local<v8::Function> interfaceObject = m_constructorMap.Get(type); | 86 v8::Local<v8::Function> interfaceObject = m_constructorMap.Get(type); |
86 return (!interfaceObject.IsEmpty()) ? interfaceObject : constructorForTy peSlowCase(type); | 87 return (!interfaceObject.IsEmpty()) ? interfaceObject : constructorForTy peSlowCase(type); |
87 } | 88 } |
88 | 89 |
89 v8::Local<v8::Object> prototypeForType(const WrapperTypeInfo*); | 90 v8::Local<v8::Object> prototypeForType(const WrapperTypeInfo*); |
90 | 91 |
91 V8NPObjectMap* getV8NPObjectMap() { return &m_v8NPObjectMap; } | 92 V8NPObjectMap* getV8NPObjectMap() { return &m_v8NPObjectMap; } |
92 | 93 |
93 void addCustomElementBinding(CustomElementDefinition*, PassOwnPtr<CustomElem entBinding>); | 94 void addCustomElementBinding(CustomElementDefinition*, PassOwnPtr<CustomElem entBinding>); |
95 void addCSSPaintBinding(PassOwnPtr<CSSPaintBinding>); | |
94 | 96 |
95 V8DOMActivityLogger* activityLogger() const { return m_activityLogger; } | 97 V8DOMActivityLogger* activityLogger() const { return m_activityLogger; } |
96 void setActivityLogger(V8DOMActivityLogger* activityLogger) { m_activityLogg er = activityLogger; } | 98 void setActivityLogger(V8DOMActivityLogger* activityLogger) { m_activityLogg er = activityLogger; } |
97 | 99 |
98 v8::Local<v8::Value> compiledPrivateScript(String); | 100 v8::Local<v8::Value> compiledPrivateScript(String); |
99 void setCompiledPrivateScript(String, v8::Local<v8::Value>); | 101 void setCompiledPrivateScript(String, v8::Local<v8::Value>); |
100 | 102 |
101 private: | 103 private: |
102 V8PerContextData(v8::Local<v8::Context>); | 104 V8PerContextData(v8::Local<v8::Context>); |
103 | 105 |
(...skipping 13 matching lines...) Expand all Loading... | |
117 V8NPObjectMap m_v8NPObjectMap; | 119 V8NPObjectMap m_v8NPObjectMap; |
118 | 120 |
119 OwnPtr<gin::ContextHolder> m_contextHolder; | 121 OwnPtr<gin::ContextHolder> m_contextHolder; |
120 | 122 |
121 ScopedPersistent<v8::Context> m_context; | 123 ScopedPersistent<v8::Context> m_context; |
122 ScopedPersistent<v8::Value> m_errorPrototype; | 124 ScopedPersistent<v8::Value> m_errorPrototype; |
123 | 125 |
124 typedef Vector<OwnPtr<CustomElementBinding>> CustomElementBindingList; | 126 typedef Vector<OwnPtr<CustomElementBinding>> CustomElementBindingList; |
125 CustomElementBindingList m_customElementBindings; | 127 CustomElementBindingList m_customElementBindings; |
126 | 128 |
129 typedef Vector<OwnPtr<CSSPaintBinding>> CSSPaintBindingList; | |
130 CSSPaintBindingList m_cssPaintBindings; | |
ikilpatrick
2016/03/30 19:12:50
Instead of this I could also add a V8PerContextDat
| |
131 | |
127 // This is owned by a static hash map in V8DOMActivityLogger. | 132 // This is owned by a static hash map in V8DOMActivityLogger. |
128 V8DOMActivityLogger* m_activityLogger; | 133 V8DOMActivityLogger* m_activityLogger; |
129 | 134 |
130 V8GlobalValueMap<String, v8::Value, v8::kNotWeak> m_compiledPrivateScript; | 135 V8GlobalValueMap<String, v8::Value, v8::kNotWeak> m_compiledPrivateScript; |
131 }; | 136 }; |
132 | 137 |
133 } // namespace blink | 138 } // namespace blink |
134 | 139 |
135 #endif // V8PerContextData_h | 140 #endif // V8PerContextData_h |
OLD | NEW |