Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: Source/bindings/core/v8/V8ObjectConstructor.h

Issue 1278983003: Adding allocator annotations to blink classes and structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed patch conflict Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 15 matching lines...) Expand all
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 "bindings/core/v8/V8RecursionScope.h" 35 #include "bindings/core/v8/V8RecursionScope.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 {
45 STACK_ALLOCATED();
44 public: 46 public:
45 enum Mode { 47 enum Mode {
46 WrapExistingObject, 48 WrapExistingObject,
47 CreateNewObject 49 CreateNewObject
48 }; 50 };
49 51
50 ConstructorMode(v8::Isolate* isolate) 52 ConstructorMode(v8::Isolate* isolate)
51 : m_isolate(isolate) 53 : m_isolate(isolate)
52 , m_microtaskSuppression(isolate) 54 , m_microtaskSuppression(isolate)
53 { 55 {
(...skipping 13 matching lines...) Expand all
67 return V8PerIsolateData::from(isolate)->m_constructorMode; 69 return V8PerIsolateData::from(isolate)->m_constructorMode;
68 } 70 }
69 71
70 private: 72 private:
71 v8::Isolate* m_isolate; 73 v8::Isolate* m_isolate;
72 bool m_previous; 74 bool m_previous;
73 V8RecursionScope::MicrotaskSuppression m_microtaskSuppression; 75 V8RecursionScope::MicrotaskSuppression m_microtaskSuppression;
74 }; 76 };
75 77
76 class V8ObjectConstructor { 78 class V8ObjectConstructor {
79 STATIC_ONLY(V8ObjectConstructor);
77 public: 80 public:
78 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>);
79 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[]);
80 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*);
81 84
82 static void isValidConstructorMode(const v8::FunctionCallbackInfo<v8::Value> &); 85 static void isValidConstructorMode(const v8::FunctionCallbackInfo<v8::Value> &);
83 }; 86 };
84 87
85 } // namespace blink 88 } // namespace blink
86 89
87 #endif // V8ObjectConstructor_h 90 #endif // V8ObjectConstructor_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8NPUtils.h ('k') | Source/bindings/core/v8/V8PagePopupControllerBinding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698