1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29 */
30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32
33 #include "config.h"
34 #include "V8TestInterfaceCheckSecurity.h"
35
36 #include "RuntimeEnabledFeatures.h"
37 #include "bindings/v8/BindingSecurity.h"
38 #include "bindings/v8/ExceptionState.h"
39 #include "bindings/v8/V8DOMConfiguration.h"
40 #include "core/dom/ContextFeatures.h"
41 #include "core/dom/Document.h"
42 #include "platform/TraceEvent.h"
43
44 namespace WebCore {
45
initializeScriptWrappableForInterface(TestInterfaceCheckSecurity * object)46 static void initializeScriptWrappableForInterface(TestInterfaceCheckSecurity* object)
47 {
48 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
49 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceCheckSecurity::wrapperTypeInfo);
50 else
51 ASSERT_NOT_REACHED();
52 }
53
54 } // namespace WebCore
55
56 // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
57 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
58 // in the global namespace.
59 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceCheckSecurity * object)60 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceCheckSecurity* object)
61 {
62 WebCore::initializeScriptWrappableForInterface(object);
63 }
64
65 namespace WebCore {
66 const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecurity::derefObject, 0, 0, 0, V8TestInterfaceCheckSecurity::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
67
68 namespace TestInterfaceCheckSecurityV8Internal {
69
V8_USE(T)70 template <typename T> void V8_USE(T) { }
71
longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value> & info)72 static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
73 {
74 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
75 v8SetReturnValueInt(info, imp->longAttribute());
76 }
77
longAttributeAttributeGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)78 static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
79 {
80 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
81 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info);
82 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
83 }
84
doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value> & info)85 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
86 {
87 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
88 v8SetReturnValueInt(info, imp->doNotCheckSecurityLongAttribute());
89 }
90
doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)91 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
92 {
93 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
94 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetter(info);
95 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
96 }
97
doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue,const v8::PropertyCallbackInfo<void> & info)98 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
99 {
100 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
101 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
102 imp->setDoNotCheckSecurityLongAttribute(cppValue);
103 }
104
doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8::String>,v8::Local<v8::Value> jsValue,const v8::PropertyCallbackInfo<void> & info)105 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
106 {
107 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
108 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(jsValue, info);
109 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
110 }
111
doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value> & info)112 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
113 {
114 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
115 v8SetReturnValueInt(info, imp->doNotCheckSecurityReadonlyLongAttribute());
116 }
117
doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)118 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
119 {
120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
121 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetter(info);
122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
123 }
124
doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value> & info)125 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
126 {
127 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
128 v8SetReturnValueInt(info, imp->doNotCheckSecurityOnSetterLongAttribute());
129 }
130
doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)131 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
132 {
133 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
134 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetter(info);
135 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
136 }
137
doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue,const v8::PropertyCallbackInfo<void> & info)138 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
139 {
140 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
141 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
142 imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
143 }
144
doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>,v8::Local<v8::Value> jsValue,const v8::PropertyCallbackInfo<void> & info)145 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
146 {
147 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
148 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(jsValue, info);
149 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
150 }
151
indexedSecurityCheck(v8::Local<v8::Object> host,uint32_t index,v8::AccessType type,v8::Local<v8::Value>)152 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
153 {
154 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(host);
155 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
156 }
157
namedSecurityCheck(v8::Local<v8::Object> host,v8::Local<v8::Value> key,v8::AccessType type,v8::Local<v8::Value>)158 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
159 {
160 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(host);
161 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
162 }
163
voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)164 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
165 {
166 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
167 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
168 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
169 exceptionState.throwIfNeeded();
170 return;
171 }
172 imp->voidMethod();
173 }
174
voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)175 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
176 {
177 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
178 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info);
179 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
180 }
181
doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)182 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
183 {
184 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
185 imp->doNotCheckSecurityVoidMethod();
186 }
187
doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)188 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
189 {
190 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
191 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(info);
192 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
193 }
194
doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value> & info)195 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
196 {
197 // This is only for getting a unique pointer which we can pass to privateTemplate.
198 static int privateTemplateUniqueKey;
199 WrapperWorldType currentWorldType = worldType(info.GetIsolate());
200 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
201 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
202
203 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
204 if (holder.IsEmpty()) {
205 // This is only reachable via |object.__proto__.func|, in which case it
206 // has already passed the same origin security check
207 v8SetReturnValue(info, privateTemplate->GetFunction());
208 return;
209 }
210 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
211 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
212 static int sharedTemplateUniqueKey;
213 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
214 v8SetReturnValue(info, sharedTemplate->GetFunction());
215 return;
216 }
217
218 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityVoidMethod", v8::String::kInternalizedString));
219 if (!hiddenValue.IsEmpty()) {
220 v8SetReturnValue(info, hiddenValue);
221 return;
222 }
223
224 v8SetReturnValue(info, privateTemplate->GetFunction());
225 }
226
doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)227 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
228 {
229 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
230 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetter(info);
231 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
232 }
233
doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)234 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
235 {
236 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
237 imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
238 }
239
doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)240 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
241 {
242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
243 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethod(info);
244 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
245 }
246
doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value> & info)247 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
248 {
249 // This is only for getting a unique pointer which we can pass to privateTemplate.
250 static int privateTemplateUniqueKey;
251 WrapperWorldType currentWorldType = worldType(info.GetIsolate());
252 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
253 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
254
255 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
256 if (holder.IsEmpty()) {
257 // This is only reachable via |object.__proto__.func|, in which case it
258 // has already passed the same origin security check
259 v8SetReturnValue(info, privateTemplate->GetFunction());
260 return;
261 }
262 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
263 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
264 static int sharedTemplateUniqueKey;
265 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
266 v8SetReturnValue(info, sharedTemplate->GetFunction());
267 return;
268 }
269
270 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString));
271 if (!hiddenValue.IsEmpty()) {
272 v8SetReturnValue(info, hiddenValue);
273 return;
274 }
275
276 v8SetReturnValue(info, privateTemplate->GetFunction());
277 }
278
doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)279 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
280 {
281 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
282 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(info);
283 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
284 }
285
doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value> & info)286 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
287 {
288 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
289 imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
290 }
291
doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value> & info)292 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
293 {
294 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
295 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(info);
296 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
297 }
298
doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value> & info)299 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
300 {
301 // This is only for getting a unique pointer which we can pass to privateTemplate.
302 static int privateTemplateUniqueKey;
303 WrapperWorldType currentWorldType = worldType(info.GetIsolate());
304 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
305 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
306
307 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
308 if (holder.IsEmpty()) {
309 // This is only reachable via |object.__proto__.func|, in which case it
310 // has already passed the same origin security check
311 v8SetReturnValue(info, privateTemplate->GetFunction());
312 return;
313 }
314 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
315 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
316 static int sharedTemplateUniqueKey;
317 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
318 v8SetReturnValue(info, sharedTemplate->GetFunction());
319 return;
320 }
321
322 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString));
323 if (!hiddenValue.IsEmpty()) {
324 v8SetReturnValue(info, hiddenValue);
325 return;
326 }
327
328 v8SetReturnValue(info, privateTemplate->GetFunction());
329 }
330
doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)331 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
332 {
333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
334 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(info);
335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
336 }
337
doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)338 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
339 {
340 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
341 imp->doNotCheckSecurityReadOnlyVoidMethod();
342 }
343
doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)344 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
345 {
346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
347 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethod(info);
348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
349 }
350
doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value> & info)351 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
352 {
353 // This is only for getting a unique pointer which we can pass to privateTemplate.
354 static int privateTemplateUniqueKey;
355 WrapperWorldType currentWorldType = worldType(info.GetIsolate());
356 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
357 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
358
359 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
360 if (holder.IsEmpty()) {
361 // This is only reachable via |object.__proto__.func|, in which case it
362 // has already passed the same origin security check
363 v8SetReturnValue(info, privateTemplate->GetFunction());
364 return;
365 }
366 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
367 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
368 static int sharedTemplateUniqueKey;
369 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
370 v8SetReturnValue(info, sharedTemplate->GetFunction());
371 return;
372 }
373
374 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod", v8::String::kInternalizedString));
375 if (!hiddenValue.IsEmpty()) {
376 v8SetReturnValue(info, hiddenValue);
377 return;
378 }
379
380 v8SetReturnValue(info, privateTemplate->GetFunction());
381 }
382
doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)383 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
384 {
385 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
386 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(info);
387 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
388 }
389
doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)390 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
391 {
392 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
393 imp->doNotCheckSecurityUnforgeableVoidMethod();
394 }
395
doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)396 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
397 {
398 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
399 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethod(info);
400 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
401 }
402
doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value> & info)403 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
404 {
405 // This is only for getting a unique pointer which we can pass to privateTemplate.
406 static int privateTemplateUniqueKey;
407 WrapperWorldType currentWorldType = worldType(info.GetIsolate());
408 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
409 v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
410
411 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
412 if (holder.IsEmpty()) {
413 // This is only reachable via |object.__proto__.func|, in which case it
414 // has already passed the same origin security check
415 v8SetReturnValue(info, privateTemplate->GetFunction());
416 return;
417 }
418 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
419 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
420 static int sharedTemplateUniqueKey;
421 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
422 v8SetReturnValue(info, sharedTemplate->GetFunction());
423 return;
424 }
425
426 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod", v8::String::kInternalizedString));
427 if (!hiddenValue.IsEmpty()) {
428 v8SetReturnValue(info, hiddenValue);
429 return;
430 }
431
432 v8SetReturnValue(info, privateTemplate->GetFunction());
433 }
434
doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>,const v8::PropertyCallbackInfo<v8::Value> & info)435 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
436 {
437 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
438 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(info);
439 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
440 }
441
TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::String> name,v8::Local<v8::Value> jsValue,const v8::PropertyCallbackInfo<void> & info)442 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
443 {
444 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
445 if (holder.IsEmpty())
446 return;
447 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
448 v8::String::Utf8Value attributeName(name);
449 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
450 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
451 exceptionState.throwIfNeeded();
452 return;
453 }
454
455 info.This()->SetHiddenValue(name, jsValue);
456 }
457
TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v8::String> name,v8::Local<v8::Value> jsValue,const v8::PropertyCallbackInfo<void> & info)458 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
459 {
460 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
461 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetter(name, jsValue, info);
462 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
463 }
464
465 } // namespace TestInterfaceCheckSecurityV8Internal
466
467 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecurityAttributes[] = {
468 {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
469 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
470 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
471 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
472 };
473
474 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethods[] = {
475 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallback, 0, 0},
476 };
477
ConfigureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate,v8::Isolate * isolate,WrapperWorldType currentWorldType)478 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
479 {
480 functionTemplate->ReadOnlyPrototype();
481
482 v8::Local<v8::Signature> defaultSignature;
483 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount,
484 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAttributes),
485 0, 0,
486 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods),
487 isolate, currentWorldType);
488 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
489 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
490 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Internal::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceCheckSecurity::wrapperTypeInfo)));
491 prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
492 if (currentWorldType == MainWorld) {
493 prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
494 } else {
495 prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
496 }
497 prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityReadOnlyVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
498 instanceTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityUnforgeableVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
499
500 // Custom toString template
501 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
502 return functionTemplate;
503 }
504
domTemplate(v8::Isolate * isolate,WrapperWorldType currentWorldType)505 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
506 {
507 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
508 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
509 if (result != data->templateMap(currentWorldType).end())
510 return result->value.newLocal(isolate);
511
512 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
513 v8::EscapableHandleScope handleScope(isolate);
514 v8::Local<v8::FunctionTemplate> templ =
515 ConfigureV8TestInterfaceCheckSecurityTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
516 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
517 return handleScope.Escape(templ);
518 }
519
hasInstance(v8::Handle<v8::Value> jsValue,v8::Isolate * isolate,WrapperWorldType currentWorldType)520 bool V8TestInterfaceCheckSecurity::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
521 {
522 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
523 }
524
hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue,v8::Isolate * isolate)525 bool V8TestInterfaceCheckSecurity::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
526 {
527 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
528 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
529 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
530 }
531
createWrapper(PassRefPtr<TestInterfaceCheckSecurity> impl,v8::Handle<v8::Object> creationContext,v8::Isolate * isolate)532 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::createWrapper(PassRefPtr<TestInterfaceCheckSecurity> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
533 {
534 ASSERT(impl);
535 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl.get(), isolate));
536 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
537 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
538 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
539 // the same object de-ref functions, though, so use that as the basis of the check.
540 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
541 }
542
543 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
544 if (UNLIKELY(wrapper.IsEmpty()))
545 return wrapper;
546
547 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
548 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceCheckSecurity>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
549 return wrapper;
550 }
551
derefObject(void * object)552 void V8TestInterfaceCheckSecurity::derefObject(void* object)
553 {
554 fromInternalPointer(object)->deref();
555 }
556
557 template<>
toV8NoInline(TestInterfaceCheckSecurity * impl,v8::Handle<v8::Object> creationContext,v8::Isolate * isolate)558 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
559 {
560 return toV8(impl, creationContext, isolate);
561 }
562
563 } // namespace WebCore
564