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

Side by Side Diff: Source/bindings/tests/results/V8SupportTestInterface.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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 #endif // ENABLE(Condition11) || ENABLE(Condition12) 320 #endif // ENABLE(Condition11) || ENABLE(Condition12)
321 321
322 #if ENABLE(Condition11) || ENABLE(Condition12) 322 #if ENABLE(Condition11) || ENABLE(Condition12)
323 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 323 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
324 { 324 {
325 if (UNLIKELY(info.Length() < 2)) { 325 if (UNLIKELY(info.Length() < 2)) {
326 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2", "SupportTestInterface", ExceptionMessages::notEnoughArguments(2, info.Length()) ), info.GetIsolate()); 326 throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2", "SupportTestInterface", ExceptionMessages::notEnoughArguments(2, info.Length()) ), info.GetIsolate());
327 return; 327 return;
328 } 328 }
329 SupportTestInterface* imp = V8SupportTestInterface::toNative(info.Holder()); 329 SupportTestInterface* imp = V8SupportTestInterface::toNative(info.Holder());
330 ExceptionState exceptionState(info.GetIsolate()); 330 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
331 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); 331 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
332 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0); 332 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0);
333 ExecutionContext* scriptContext = getExecutionContext(); 333 ExecutionContext* scriptContext = getExecutionContext();
334 RefPtr<TestObj> result = SupportTestPartialInterface::supplementalMethod2(sc riptContext, imp, strArg, objArg, exceptionState); 334 RefPtr<TestObj> result = SupportTestPartialInterface::supplementalMethod2(sc riptContext, imp, strArg, objArg, exceptionState);
335 if (exceptionState.throwIfNeeded()) 335 if (exceptionState.throwIfNeeded())
336 return; 336 return;
337 v8SetReturnValue(info, result.release()); 337 v8SetReturnValue(info, result.release());
338 } 338 }
339 #endif // ENABLE(Condition11) || ENABLE(Condition12) 339 #endif // ENABLE(Condition11) || ENABLE(Condition12)
340 340
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 V8DOMWrapper::associateObjectWithWrapper<V8SupportTestInterface>(impl, &wrap perTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); 505 V8DOMWrapper::associateObjectWithWrapper<V8SupportTestInterface>(impl, &wrap perTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
506 return wrapper; 506 return wrapper;
507 } 507 }
508 508
509 void V8SupportTestInterface::derefObject(void* object) 509 void V8SupportTestInterface::derefObject(void* object)
510 { 510 {
511 fromInternalPointer(object)->deref(); 511 fromInternalPointer(object)->deref();
512 } 512 }
513 513
514 } // namespace WebCore 514 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestActiveDOMObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698