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

Side by Side Diff: Source/bindings/core/v8/CustomElementConstructorBuilder.cpp

Issue 709743002: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « no previous file | Source/bindings/core/v8/ExceptionState.cpp » ('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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 return false; 244 return false;
245 } 245 }
246 246
247 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>& in fo) 247 static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>& in fo)
248 { 248 {
249 v8::Isolate* isolate = info.GetIsolate(); 249 v8::Isolate* isolate = info.GetIsolate();
250 250
251 if (!info.IsConstructCall()) { 251 if (!info.IsConstructCall()) {
252 V8ThrowException::throwTypeError("DOM object constructor cannot be calle d as a function.", isolate); 252 V8ThrowException::throwTypeError(isolate, "DOM object constructor cannot be called as a function.");
253 return; 253 return;
254 } 254 }
255 255
256 if (info.Length() > 0) { 256 if (info.Length() > 0) {
257 V8ThrowException::throwTypeError("This constructor should be called with out arguments.", isolate); 257 V8ThrowException::throwTypeError(isolate, "This constructor should be ca lled without arguments.");
258 return; 258 return;
259 } 259 }
260 260
261 Document* document = V8Document::toImpl(V8HiddenValue::getHiddenValue(info.G etIsolate(), info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<v8 ::Object>()); 261 Document* document = V8Document::toImpl(V8HiddenValue::getHiddenValue(info.G etIsolate(), info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<v8 ::Object>());
262 TOSTRING_VOID(V8StringResource<>, namespaceURI, V8HiddenValue::getHiddenValu e(isolate, info.Callee(), V8HiddenValue::customElementNamespaceURI(isolate))); 262 TOSTRING_VOID(V8StringResource<>, namespaceURI, V8HiddenValue::getHiddenValu e(isolate, info.Callee(), V8HiddenValue::customElementNamespaceURI(isolate)));
263 TOSTRING_VOID(V8StringResource<>, tagName, V8HiddenValue::getHiddenValue(iso late, info.Callee(), V8HiddenValue::customElementTagName(isolate))); 263 TOSTRING_VOID(V8StringResource<>, tagName, V8HiddenValue::getHiddenValue(iso late, info.Callee(), V8HiddenValue::customElementTagName(isolate)));
264 v8::Handle<v8::Value> maybeType = V8HiddenValue::getHiddenValue(info.GetIsol ate(), info.Callee(), V8HiddenValue::customElementType(isolate)); 264 v8::Handle<v8::Value> maybeType = V8HiddenValue::getHiddenValue(info.GetIsol ate(), info.Callee(), V8HiddenValue::customElementType(isolate));
265 TOSTRING_VOID(V8StringResource<>, type, maybeType); 265 TOSTRING_VOID(V8StringResource<>, type, maybeType);
266 266
267 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate()); 267 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate());
268 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 268 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
269 RefPtrWillBeRawPtr<Element> element = document->createElementNS(namespaceURI , tagName, maybeType->IsNull() ? nullAtom : type, exceptionState); 269 RefPtrWillBeRawPtr<Element> element = document->createElementNS(namespaceURI , tagName, maybeType->IsNull() ? nullAtom : type, exceptionState);
270 if (exceptionState.throwIfNeeded()) 270 if (exceptionState.throwIfNeeded())
271 return; 271 return;
272 v8SetReturnValueFast(info, element.release(), document); 272 v8SetReturnValueFast(info, element.release(), document);
273 } 273 }
274 274
275 } // namespace blink 275 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/ExceptionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698