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

Side by Side Diff: Source/bindings/tests/results/V8TestActiveDOMObject.cpp

Issue 68563003: Create DOM exceptions in the correct context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased onto df9a982fbe97 Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 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
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 exceptionState(info.GetIsolate()); 111 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
112 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState) ) { 112 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState) ) {
113 exceptionState.throwIfNeeded(); 113 exceptionState.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
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 exceptionState(info.GetIsolate()); 309 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
310 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState) ) { 310 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState) ) {
311 exceptionState.throwIfNeeded(); 311 exceptionState.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
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
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8SupportTestInterface.cpp ('k') | Source/bindings/tests/results/V8TestEventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698