OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe
curityError); | 101 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe
curityError); |
102 } | 102 } |
103 | 103 |
104 static void excitingFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 104 static void excitingFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
105 { | 105 { |
106 if (UNLIKELY(info.Length() < 1)) { | 106 if (UNLIKELY(info.Length() < 1)) { |
107 throwTypeError(ExceptionMessages::failedToExecute("excitingFunction", "T
estActiveDOMObject", ExceptionMessages::notEnoughArguments(1, info.Length())), i
nfo.GetIsolate()); | 107 throwTypeError(ExceptionMessages::failedToExecute("excitingFunction", "T
estActiveDOMObject", ExceptionMessages::notEnoughArguments(1, info.Length())), i
nfo.GetIsolate()); |
108 return; | 108 return; |
109 } | 109 } |
110 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder()); | 110 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder()); |
111 ExceptionState es(info.GetIsolate()); | 111 ExceptionState es(info.Holder(), info.GetIsolate()); |
112 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), es)) { | 112 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), es)) { |
113 es.throwIfNeeded(); | 113 es.throwIfNeeded(); |
114 return; | 114 return; |
115 } | 115 } |
116 V8TRYCATCH_VOID(Node*, nextChild, V8Node::HasInstance(info[0], info.GetIsola
te(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::C
ast(info[0])) : 0); | 116 V8TRYCATCH_VOID(Node*, nextChild, V8Node::HasInstance(info[0], info.GetIsola
te(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::C
ast(info[0])) : 0); |
117 imp->excitingFunction(nextChild); | 117 imp->excitingFunction(nextChild); |
118 } | 118 } |
119 | 119 |
120 static void excitingFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 120 static void excitingFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
121 { | 121 { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityA
ttributeGetterForMainWorld(info); | 299 TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityA
ttributeGetterForMainWorld(info); |
300 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 300 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
301 } | 301 } |
302 | 302 |
303 static void TestActiveDOMObjectDomainSafeFunctionSetter(v8::Local<v8::String> na
me, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 303 static void TestActiveDOMObjectDomainSafeFunctionSetter(v8::Local<v8::String> na
me, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
304 { | 304 { |
305 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8
TestActiveDOMObject::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())
)); | 305 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8
TestActiveDOMObject::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())
)); |
306 if (holder.IsEmpty()) | 306 if (holder.IsEmpty()) |
307 return; | 307 return; |
308 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder); | 308 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder); |
309 ExceptionState es(info.GetIsolate()); | 309 ExceptionState es(info.Holder(), info.GetIsolate()); |
310 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), es)) { | 310 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), es)) { |
311 es.throwIfNeeded(); | 311 es.throwIfNeeded(); |
312 return; | 312 return; |
313 } | 313 } |
314 | 314 |
315 info.This()->SetHiddenValue(name, jsValue); | 315 info.This()->SetHiddenValue(name, jsValue); |
316 } | 316 } |
317 | 317 |
318 } // namespace TestActiveDOMObjectV8Internal | 318 } // namespace TestActiveDOMObjectV8Internal |
319 | 319 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 V8DOMWrapper::associateObjectWithWrapper<V8TestActiveDOMObject>(impl, &wrapp
erTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); | 404 V8DOMWrapper::associateObjectWithWrapper<V8TestActiveDOMObject>(impl, &wrapp
erTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
405 return wrapper; | 405 return wrapper; |
406 } | 406 } |
407 | 407 |
408 void V8TestActiveDOMObject::derefObject(void* object) | 408 void V8TestActiveDOMObject::derefObject(void* object) |
409 { | 409 { |
410 fromInternalPointer(object)->deref(); | 410 fromInternalPointer(object)->deref(); |
411 } | 411 } |
412 | 412 |
413 } // namespace WebCore | 413 } // namespace WebCore |
OLD | NEW |