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

Side by Side Diff: Source/bindings/v8/CustomElementConstructorBuilder.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
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/ExceptionState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 throwUninformativeAndGenericTypeError(isolate); 265 throwUninformativeAndGenericTypeError(isolate);
266 return; 266 return;
267 } 267 }
268 268
269 Document* document = V8Document::toNative(info.Callee()->GetHiddenValue(V8Hi ddenPropertyName::customElementDocument(isolate)).As<v8::Object>()); 269 Document* document = V8Document::toNative(info.Callee()->GetHiddenValue(V8Hi ddenPropertyName::customElementDocument(isolate)).As<v8::Object>());
270 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, info. Callee()->GetHiddenValue(V8HiddenPropertyName::customElementNamespaceURI(isolate ))); 270 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, info. Callee()->GetHiddenValue(V8HiddenPropertyName::customElementNamespaceURI(isolate )));
271 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, tagName, info.Calle e()->GetHiddenValue(V8HiddenPropertyName::customElementTagName(isolate))); 271 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, tagName, info.Calle e()->GetHiddenValue(V8HiddenPropertyName::customElementTagName(isolate)));
272 v8::Handle<v8::Value> maybeType = info.Callee()->GetHiddenValue(V8HiddenProp ertyName::customElementType(isolate)); 272 v8::Handle<v8::Value> maybeType = info.Callee()->GetHiddenValue(V8HiddenProp ertyName::customElementType(isolate));
273 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType); 273 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType);
274 274
275 ExceptionState exceptionState(info.GetIsolate()); 275 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
276 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 276 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
277 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, exceptionState); 277 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, exceptionState);
278 if (exceptionState.throwIfNeeded()) 278 if (exceptionState.throwIfNeeded())
279 return; 279 return;
280 v8SetReturnValueFast(info, element.release(), document); 280 v8SetReturnValueFast(info, element.release(), document);
281 } 281 }
282 282
283 } // namespace WebCore 283 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/ExceptionState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698