Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM File.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_FileBinding_h
4 : #define mozilla_dom_FileBinding_h
5 :
6 : #include "FileBinding.h"
7 : #include "js/RootingAPI.h"
8 : #include "jspubtd.h"
9 : #include "mozilla/ErrorResult.h"
10 : #include "mozilla/dom/BindingDeclarations.h"
11 : #include "mozilla/dom/Nullable.h"
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : struct ChromeFilePropertyBagAtoms;
17 : class File;
18 : struct FileAtoms;
19 : struct FilePropertyBagAtoms;
20 : struct NativePropertyHooks;
21 : class ProtoAndIfaceCache;
22 :
23 : } // namespace dom
24 : } // namespace mozilla
25 :
26 : namespace mozilla {
27 : namespace dom {
28 :
29 0 : struct FilePropertyBag : public DictionaryBase
30 : {
31 : MOZ_INIT_OUTSIDE_CTOR Optional<int64_t> mLastModified;
32 : MOZ_INIT_OUTSIDE_CTOR nsString mType;
33 :
34 : FilePropertyBag();
35 :
36 0 : explicit inline FilePropertyBag(const FastDictionaryInitializer& )
37 0 : {
38 : // Do nothing here; this is used by our "Fast" subclass
39 0 : }
40 :
41 : explicit inline FilePropertyBag(const FilePropertyBag& aOther)
42 : {
43 : *this = aOther;
44 : }
45 :
46 : bool
47 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
48 :
49 : bool
50 : Init(const nsAString& aJSON);
51 :
52 : bool
53 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
54 :
55 : bool
56 : ToJSON(nsAString& aJSON) const;
57 :
58 : void
59 : TraceDictionary(JSTracer* trc);
60 :
61 : FilePropertyBag&
62 : operator=(const FilePropertyBag& aOther);
63 :
64 : private:
65 : static bool
66 : InitIds(JSContext* cx, FilePropertyBagAtoms* atomsCache);
67 : };
68 :
69 : namespace binding_detail {
70 0 : struct FastFilePropertyBag : public FilePropertyBag
71 : {
72 0 : inline FastFilePropertyBag()
73 0 : : FilePropertyBag(FastDictionaryInitializer())
74 : {
75 : // Doesn't matter what int we pass to the parent constructor
76 0 : }
77 : };
78 : } // namespace binding_detail
79 :
80 :
81 0 : struct ChromeFilePropertyBag : public FilePropertyBag
82 : {
83 : MOZ_INIT_OUTSIDE_CTOR bool mExistenceCheck;
84 : MOZ_INIT_OUTSIDE_CTOR nsString mName;
85 :
86 : ChromeFilePropertyBag();
87 :
88 0 : explicit inline ChromeFilePropertyBag(const FastDictionaryInitializer& )
89 0 : : FilePropertyBag(FastDictionaryInitializer())
90 : {
91 : // Do nothing here; this is used by our "Fast" subclass
92 0 : }
93 :
94 : explicit inline ChromeFilePropertyBag(const ChromeFilePropertyBag& aOther)
95 : {
96 : *this = aOther;
97 : }
98 :
99 : bool
100 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
101 :
102 : bool
103 : Init(const nsAString& aJSON);
104 :
105 : bool
106 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
107 :
108 : bool
109 : ToJSON(nsAString& aJSON) const;
110 :
111 : void
112 : TraceDictionary(JSTracer* trc);
113 :
114 : ChromeFilePropertyBag&
115 : operator=(const ChromeFilePropertyBag& aOther);
116 :
117 : private:
118 : static bool
119 : InitIds(JSContext* cx, ChromeFilePropertyBagAtoms* atomsCache);
120 : };
121 :
122 : namespace binding_detail {
123 0 : struct FastChromeFilePropertyBag : public ChromeFilePropertyBag
124 : {
125 0 : inline FastChromeFilePropertyBag()
126 0 : : ChromeFilePropertyBag(FastDictionaryInitializer())
127 : {
128 : // Doesn't matter what int we pass to the parent constructor
129 0 : }
130 : };
131 : } // namespace binding_detail
132 :
133 :
134 : namespace FileBinding {
135 :
136 : typedef mozilla::dom::File NativeType;
137 :
138 : JSObject*
139 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
140 :
141 : const JSClass*
142 : GetJSClass();
143 :
144 : bool
145 : Wrap(JSContext* aCx, mozilla::dom::File* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
146 :
147 : template <class T>
148 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
149 : {
150 0 : JS::Rooted<JSObject*> reflector(aCx);
151 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
152 : }
153 :
154 : // We declare this as an array so that retrieving a pointer to this
155 : // binding's property hooks only requires compile/link-time resolvable
156 : // address arithmetic. Declaring it as a pointer instead would require
157 : // doing a run-time load to fetch a pointer to this binding's property
158 : // hooks. And then structures which embedded a pointer to this structure
159 : // would require a run-time load for proper initialization, which would
160 : // then induce static constructors. Lots of static constructors.
161 : extern const NativePropertyHooks sNativePropertyHooks[];
162 :
163 : void
164 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
165 :
166 : JS::Handle<JSObject*>
167 : GetProtoObjectHandle(JSContext* aCx);
168 :
169 : JS::Handle<JSObject*>
170 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
171 :
172 : JSObject*
173 : GetConstructorObject(JSContext* aCx);
174 :
175 : } // namespace FileBinding
176 :
177 :
178 :
179 : } // namespace dom
180 : } // namespace mozilla
181 :
182 : #endif // mozilla_dom_FileBinding_h
|