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 14 matching lines...) Expand all Loading... |
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 V8ObjectConstructor_h | 31 #ifndef V8ObjectConstructor_h |
32 #define V8ObjectConstructor_h | 32 #define V8ObjectConstructor_h |
33 | 33 |
34 #include "bindings/core/v8/V8PerIsolateData.h" | 34 #include "bindings/core/v8/V8PerIsolateData.h" |
| 35 #include "core/CoreExport.h" |
35 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
36 | 37 |
37 #include <v8.h> | 38 #include <v8.h> |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 class Document; | 42 class Document; |
42 | 43 |
43 class ConstructorMode { | 44 class ConstructorMode { |
44 STACK_ALLOCATED(); | 45 STACK_ALLOCATED(); |
(...skipping 22 matching lines...) Expand all Loading... |
67 { | 68 { |
68 return V8PerIsolateData::from(isolate)->m_constructorMode; | 69 return V8PerIsolateData::from(isolate)->m_constructorMode; |
69 } | 70 } |
70 | 71 |
71 private: | 72 private: |
72 v8::Isolate* m_isolate; | 73 v8::Isolate* m_isolate; |
73 bool m_previous; | 74 bool m_previous; |
74 v8::MicrotasksScope m_microtaskSuppression; | 75 v8::MicrotasksScope m_microtaskSuppression; |
75 }; | 76 }; |
76 | 77 |
77 class V8ObjectConstructor { | 78 class CORE_EXPORT V8ObjectConstructor { |
78 STATIC_ONLY(V8ObjectConstructor); | 79 STATIC_ONLY(V8ObjectConstructor); |
79 public: | 80 public: |
80 static v8::MaybeLocal<v8::Object> newInstance(v8::Isolate*, v8::Local<v8::Fu
nction>); | 81 static v8::MaybeLocal<v8::Object> newInstance(v8::Isolate*, v8::Local<v8::Fu
nction>); |
81 static v8::MaybeLocal<v8::Object> newInstance(v8::Isolate*, v8::Local<v8::Fu
nction>, int, v8::Local<v8::Value> argv[]); | 82 static v8::MaybeLocal<v8::Object> newInstance(v8::Isolate*, v8::Local<v8::Fu
nction>, int, v8::Local<v8::Value> argv[]); |
82 static v8::MaybeLocal<v8::Object> newInstanceInDocument(v8::Isolate*, v8::Lo
cal<v8::Function>, int, v8::Local<v8::Value> argv[], Document*); | 83 static v8::MaybeLocal<v8::Object> newInstanceInDocument(v8::Isolate*, v8::Lo
cal<v8::Function>, int, v8::Local<v8::Value> argv[], Document*); |
83 | 84 |
84 static void isValidConstructorMode(const v8::FunctionCallbackInfo<v8::Value>
&); | 85 static void isValidConstructorMode(const v8::FunctionCallbackInfo<v8::Value>
&); |
85 }; | 86 }; |
86 | 87 |
87 } // namespace blink | 88 } // namespace blink |
88 | 89 |
89 #endif // V8ObjectConstructor_h | 90 #endif // V8ObjectConstructor_h |
OLD | NEW |