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

Side by Side Diff: Source/bindings/tests/results/V8TestNamedConstructor.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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 ASSERT(document); 95 ASSERT(document);
96 96
97 // Make sure the document is added to the DOM Node map. Otherwise, the TestN amedConstructor instance 97 // Make sure the document is added to the DOM Node map. Otherwise, the TestN amedConstructor instance
98 // may end up being the only node in the map and get garbage-collected prema turely. 98 // may end up being the only node in the map and get garbage-collected prema turely.
99 toV8(document, info.Holder(), info.GetIsolate()); 99 toV8(document, info.Holder(), info.GetIsolate());
100 100
101 if (UNLIKELY(info.Length() < 1)) { 101 if (UNLIKELY(info.Length() < 1)) {
102 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T estNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); 102 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T estNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
103 return; 103 return;
104 } 104 }
105 ExceptionState exceptionState(info.GetIsolate()); 105 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
106 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); 106 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); 107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
108 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul l(info, 2)); 108 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul l(info, 2));
109 109
110 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru ctor(*document, str1, str2, str3, exceptionState); 110 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru ctor(*document, str1, str2, str3, exceptionState);
111 v8::Handle<v8::Object> wrapper = info.Holder(); 111 v8::Handle<v8::Object> wrapper = info.Holder();
112 if (exceptionState.throwIfNeeded()) 112 if (exceptionState.throwIfNeeded())
113 return; 113 return;
114 114
115 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.releas e(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsola te(), WrapperConfiguration::Dependent); 115 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.releas e(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsola te(), WrapperConfiguration::Dependent);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &wrap perTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent); 209 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &wrap perTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
210 return wrapper; 210 return wrapper;
211 } 211 }
212 212
213 void V8TestNamedConstructor::derefObject(void* object) 213 void V8TestNamedConstructor::derefObject(void* object)
214 { 214 {
215 fromInternalPointer(object)->deref(); 215 fromInternalPointer(object)->deref();
216 } 216 }
217 217
218 } // namespace WebCore 218 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698