3181177be67167784380ed38ca065a731bbd8d03
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterfaceCheckSecurity.cpp
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 "bindings/v8/V8ObjectConstructor.h"
41 #include "core/dom/ContextFeatures.h"
42 #include "core/dom/Document.h"
43 #include "platform/TraceEvent.h"
44 #include "wtf/GetPtr.h"
45 #include "wtf/RefPtr.h"
46
47 namespace WebCore {
48
49 static void initializeScriptWrappableForInterface(TestInterfaceCheckSecurity* object)
50 {
51     if (ScriptWrappable::wrapperCanBeStoredInObject(object))
52         ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceCheckSecurity::wrapperTypeInfo);
53     else
54         ASSERT_NOT_REACHED();
55 }
56
57 } // namespace WebCore
58
59 // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
60 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
61 // in the global namespace.
62 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
63 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceCheckSecurity* object)
64 {
65     WebCore::initializeScriptWrappableForInterface(object);
66 }
67
68 namespace WebCore {
69 const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecurity::derefObject, 0, 0, 0, V8TestInterfaceCheckSecurity::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
70
71 namespace TestInterfaceCheckSecurityV8Internal {
72
73 template <typename T> void V8_USE(T) { }
74
75 static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
76 {
77     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
78     v8SetReturnValueInt(info, imp->longAttribute());
79 }
80
81 static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
82 {
83     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
84     TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info);
85     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
86 }
87
88 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
89 {
90     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
91     v8SetReturnValueInt(info, imp->doNotCheckSecurityLongAttribute());
92 }
93
94 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
95 {
96     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
97     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetter(info);
98     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
99 }
100
101 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
102 {
103     ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecurityLongAttribute", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
104     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
105     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), exceptionState);
106     imp->setDoNotCheckSecurityLongAttribute(cppValue);
107 }
108
109 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
110 {
111     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
112     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(jsValue, info);
113     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
114 }
115
116 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
117 {
118     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
119     v8SetReturnValueInt(info, imp->doNotCheckSecurityReadonlyLongAttribute());
120 }
121
122 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
123 {
124     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
125     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetter(info);
126     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
127 }
128
129 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
130 {
131     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
132     v8SetReturnValueInt(info, imp->doNotCheckSecurityOnSetterLongAttribute());
133 }
134
135 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
136 {
137     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
138     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetter(info);
139     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
140 }
141
142 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
143 {
144     ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecurityOnSetterLongAttribute", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
145     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
146     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), exceptionState);
147     imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
148 }
149
150 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
151 {
152     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
153     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(jsValue, info);
154     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
155 }
156
157 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
158 {
159     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
160     v8SetReturnValueInt(info, imp->doNotCheckSecurityReplaceableReadonlyLongAttribute());
161 }
162
163 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
164 {
165     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
166     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(info);
167     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
168 }
169
170 static void TestInterfaceCheckSecurityReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
171 {
172     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
173     v8::String::Utf8Value attributeName(name);
174     ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
175     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), exceptionState)) {
176         exceptionState.throwIfNeeded();
177         return;
178     }
179     info.This()->ForceSet(name, jsValue);
180 }
181
182 static void TestInterfaceCheckSecurityReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
183 {
184     TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityReplaceableAttributeSetter(name, jsValue, info);
185 }
186
187 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
188 {
189     TestInterfaceCheckSecurity* imp =  V8TestInterfaceCheckSecurity::toNative(host);
190     return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError);
191 }
192
193 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
194 {
195     TestInterfaceCheckSecurity* imp =  V8TestInterfaceCheckSecurity::toNative(host);
196     return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError);
197 }
198
199 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
200 {
201     ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
202     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
203     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), exceptionState)) {
204         exceptionState.throwIfNeeded();
205         return;
206     }
207     imp->voidMethod();
208 }
209
210 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
211 {
212     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
213     TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info);
214     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
215 }
216
217 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
218 {
219     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
220     imp->doNotCheckSecurityVoidMethod();
221 }
222
223 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
224 {
225     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
226     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(info);
227     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
228 }
229
230 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
231 {
232     // This is only for getting a unique pointer which we can pass to privateTemplate.
233     static int privateTemplateUniqueKey;
234     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
235     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
236     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
237
238     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
239     if (holder.IsEmpty()) {
240         // This is only reachable via |object.__proto__.func|, in which case it
241         // has already passed the same origin security check
242         v8SetReturnValue(info, privateTemplate->GetFunction());
243         return;
244     }
245     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
246     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
247         static int sharedTemplateUniqueKey;
248         v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
249         v8SetReturnValue(info, sharedTemplate->GetFunction());
250         return;
251     }
252
253     v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.This(), "doNotCheckSecurityVoidMethod");
254     if (!hiddenValue.IsEmpty()) {
255         v8SetReturnValue(info, hiddenValue);
256         return;
257     }
258
259     v8SetReturnValue(info, privateTemplate->GetFunction());
260 }
261
262 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
263 {
264     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
265     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetter(info);
266     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
267 }
268
269 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
270 {
271     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
272     imp->doNotCheckSecurityDoNotCheckSignatureVoidMethod();
273 }
274
275 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
276 {
277     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
278     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(info);
279     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
280 }
281
282 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
283 {
284     // This is only for getting a unique pointer which we can pass to privateTemplate.
285     static int privateTemplateUniqueKey;
286     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
287     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
288     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0);
289
290     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
291     if (holder.IsEmpty()) {
292         // This is only reachable via |object.__proto__.func|, in which case it
293         // has already passed the same origin security check
294         v8SetReturnValue(info, privateTemplate->GetFunction());
295         return;
296     }
297     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
298     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
299         static int sharedTemplateUniqueKey;
300         v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0);
301         v8SetReturnValue(info, sharedTemplate->GetFunction());
302         return;
303     }
304
305     v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.This(), "doNotCheckSecurityDoNotCheckSignatureVoidMethod");
306     if (!hiddenValue.IsEmpty()) {
307         v8SetReturnValue(info, hiddenValue);
308         return;
309     }
310
311     v8SetReturnValue(info, privateTemplate->GetFunction());
312 }
313
314 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
315 {
316     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
317     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetter(info);
318     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
319 }
320
321 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
322 {
323     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
324     imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
325 }
326
327 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
328 {
329     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
330     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethod(info);
331     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
332 }
333
334 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
335 {
336     // This is only for getting a unique pointer which we can pass to privateTemplate.
337     static int privateTemplateUniqueKey;
338     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
339     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
340     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
341
342     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
343     if (holder.IsEmpty()) {
344         // This is only reachable via |object.__proto__.func|, in which case it
345         // has already passed the same origin security check
346         v8SetReturnValue(info, privateTemplate->GetFunction());
347         return;
348     }
349     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
350     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
351         static int sharedTemplateUniqueKey;
352         v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
353         v8SetReturnValue(info, sharedTemplate->GetFunction());
354         return;
355     }
356
357     v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.This(), "doNotCheckSecurityPerWorldBindingsVoidMethod");
358     if (!hiddenValue.IsEmpty()) {
359         v8SetReturnValue(info, hiddenValue);
360         return;
361     }
362
363     v8SetReturnValue(info, privateTemplate->GetFunction());
364 }
365
366 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
367 {
368     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
369     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(info);
370     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
371 }
372
373 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
374 {
375     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
376     imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
377 }
378
379 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
380 {
381     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
382     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(info);
383     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
384 }
385
386 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
387 {
388     // This is only for getting a unique pointer which we can pass to privateTemplate.
389     static int privateTemplateUniqueKey;
390     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
391     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
392     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
393
394     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
395     if (holder.IsEmpty()) {
396         // This is only reachable via |object.__proto__.func|, in which case it
397         // has already passed the same origin security check
398         v8SetReturnValue(info, privateTemplate->GetFunction());
399         return;
400     }
401     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
402     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
403         static int sharedTemplateUniqueKey;
404         v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
405         v8SetReturnValue(info, sharedTemplate->GetFunction());
406         return;
407     }
408
409     v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.This(), "doNotCheckSecurityPerWorldBindingsVoidMethod");
410     if (!hiddenValue.IsEmpty()) {
411         v8SetReturnValue(info, hiddenValue);
412         return;
413     }
414
415     v8SetReturnValue(info, privateTemplate->GetFunction());
416 }
417
418 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
419 {
420     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
421     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(info);
422     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
423 }
424
425 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
426 {
427     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
428     imp->doNotCheckSecurityReadOnlyVoidMethod();
429 }
430
431 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
432 {
433     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
434     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethod(info);
435     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
436 }
437
438 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
439 {
440     // This is only for getting a unique pointer which we can pass to privateTemplate.
441     static int privateTemplateUniqueKey;
442     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
443     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
444     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
445
446     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
447     if (holder.IsEmpty()) {
448         // This is only reachable via |object.__proto__.func|, in which case it
449         // has already passed the same origin security check
450         v8SetReturnValue(info, privateTemplate->GetFunction());
451         return;
452     }
453     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
454     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
455         static int sharedTemplateUniqueKey;
456         v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
457         v8SetReturnValue(info, sharedTemplate->GetFunction());
458         return;
459     }
460
461     v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.This(), "doNotCheckSecurityReadOnlyVoidMethod");
462     if (!hiddenValue.IsEmpty()) {
463         v8SetReturnValue(info, hiddenValue);
464         return;
465     }
466
467     v8SetReturnValue(info, privateTemplate->GetFunction());
468 }
469
470 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
471 {
472     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
473     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(info);
474     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
475 }
476
477 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
478 {
479     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
480     imp->doNotCheckSecurityUnforgeableVoidMethod();
481 }
482
483 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
484 {
485     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
486     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethod(info);
487     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
488 }
489
490 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
491 {
492     // This is only for getting a unique pointer which we can pass to privateTemplate.
493     static int privateTemplateUniqueKey;
494     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
495     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
496     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
497
498     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
499     if (holder.IsEmpty()) {
500         // This is only reachable via |object.__proto__.func|, in which case it
501         // has already passed the same origin security check
502         v8SetReturnValue(info, privateTemplate->GetFunction());
503         return;
504     }
505     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
506     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), DoNotReportSecurityError)) {
507         static int sharedTemplateUniqueKey;
508         v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType)), 0);
509         v8SetReturnValue(info, sharedTemplate->GetFunction());
510         return;
511     }
512
513     v8::Local<v8::Value> hiddenValue = getHiddenValue(info.GetIsolate(), info.This(), "doNotCheckSecurityUnforgeableVoidMethod");
514     if (!hiddenValue.IsEmpty()) {
515         v8SetReturnValue(info, hiddenValue);
516         return;
517     }
518
519     v8SetReturnValue(info, privateTemplate->GetFunction());
520 }
521
522 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
523 {
524     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
525     TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(info);
526     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
527 }
528
529 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
530 {
531     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
532     if (holder.IsEmpty())
533         return;
534     TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
535     v8::String::Utf8Value attributeName(name);
536     ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
537     if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame(), exceptionState)) {
538         exceptionState.throwIfNeeded();
539         return;
540     }
541
542     setHiddenValue(info.GetIsolate(), info.This(), name, jsValue);
543 }
544
545 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
546 {
547     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
548     TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetter(name, jsValue, info);
549     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
550 }
551
552 } // namespace TestInterfaceCheckSecurityV8Internal
553
554 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecurityAttributes[] = {
555     {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
556     {"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 */},
557     {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
558     {"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 */},
559     {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
560 };
561
562 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethods[] = {
563     {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallback, 0, 0},
564 };
565
566 static void configureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
567 {
568     functionTemplate->ReadOnlyPrototype();
569
570     v8::Local<v8::Signature> defaultSignature;
571     defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount,
572         V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAttributes),
573         0, 0,
574         V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods),
575         isolate, currentWorldType);
576     v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
577     v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
578     instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Internal::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceCheckSecurity::wrapperTypeInfo)));
579     prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
580     prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityDoNotCheckSignatureVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
581     if (currentWorldType == MainWorld) {
582         prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
583     } else {
584         prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
585     }
586     prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityReadOnlyVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
587     instanceTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityUnforgeableVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
588
589     // Custom toString template
590     functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
591 }
592
593 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
594 {
595     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
596     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
597     if (result != data->templateMap(currentWorldType).end())
598         return result->value.newLocal(isolate);
599
600     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
601     v8::EscapableHandleScope handleScope(isolate);
602     v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
603     configureV8TestInterfaceCheckSecurityTemplate(templ, isolate, currentWorldType);
604     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
605     return handleScope.Escape(templ);
606 }
607
608 bool V8TestInterfaceCheckSecurity::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
609 {
610     return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeInfo, jsValue)
611         || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTypeInfo, jsValue);
612 }
613
614 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::createWrapper(PassRefPtr<TestInterfaceCheckSecurity> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
615 {
616     ASSERT(impl);
617     ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl.get(), isolate));
618     if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
619         const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
620         // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
621         // the same object de-ref functions, though, so use that as the basis of the check.
622         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
623     }
624
625     v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
626     if (UNLIKELY(wrapper.IsEmpty()))
627         return wrapper;
628
629     installPerContextEnabledProperties(wrapper, impl.get(), isolate);
630     V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceCheckSecurity>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
631     return wrapper;
632 }
633
634 void V8TestInterfaceCheckSecurity::derefObject(void* object)
635 {
636     fromInternalPointer(object)->deref();
637 }
638
639 template<>
640 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
641 {
642     return toV8(impl, creationContext, isolate);
643 }
644
645 } // namespace WebCore