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

Side by Side Diff: Source/bindings/dart/DartNativeUtilities.cpp

Issue 26789007: Add a native subtype of function that uses the native C++ class hierarchy to check if an element (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit/
Patch Set: Created 7 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/dart/DartLibraryIds.h ('k') | Source/bindings/dart/DartUtilities.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 // Copyright 2012, Google Inc. 1 // Copyright 2012, Google Inc.
2 // All rights reserved. 2 // 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 fail: 187 fail:
188 Dart_ThrowException(exception); 188 Dart_ThrowException(exception);
189 ASSERT_NOT_REACHED(); 189 ASSERT_NOT_REACHED();
190 } 190 }
191 191
192 void initializeCustomElement(Dart_NativeArguments args) 192 void initializeCustomElement(Dart_NativeArguments args)
193 { 193 {
194 Dart_Handle exception = 0; 194 Dart_Handle exception = 0;
195 { 195 {
196 Dart_Handle elementWrapper = Dart_GetNativeArgument(args, 0); 196 Dart_Handle elementWrapper = Dart_GetNativeArgument(args, 0);
197 DartDOMData* domData = static_cast<DartDOMData*>(Dart_GetNativeIsolateDa ta(args)); 197 if (!DartDOMWrapper::subtypeOf(elementWrapper, DartHTMLElement::dartClas sId)) {
198 if (!DartUtilities::isHtmlElement(domData, elementWrapper)) {
199 exception = Dart_NewStringFromCString("Invalid class: expected insta nce of HtmlElement"); 198 exception = Dart_NewStringFromCString("Invalid class: expected insta nce of HtmlElement");
200 goto fail; 199 goto fail;
201 } 200 }
202 DartCustomElementWrapper<HTMLElement>::initializeCustomElement(elementWr apper, exception); 201 DartCustomElementWrapper<HTMLElement>::initializeCustomElement(elementWr apper, exception);
203 if (exception) { 202 if (exception) {
204 goto fail; 203 goto fail;
205 } 204 }
206 return; 205 return;
207 } 206 }
208 207
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (argumentCount == 1 && str == "Utils_initializeCustomElement") 244 if (argumentCount == 1 && str == "Utils_initializeCustomElement")
246 return DartNativeUtilitiesInternal::initializeCustomElement; 245 return DartNativeUtilitiesInternal::initializeCustomElement;
247 if (argumentCount == 1 && str == "Window_history_cross_frame_Getter") 246 if (argumentCount == 1 && str == "Window_history_cross_frame_Getter")
248 return DartWindowInternal::historyCrossFrameGetter; 247 return DartWindowInternal::historyCrossFrameGetter;
249 if (argumentCount == 1 && str == "Window_location_cross_frame_Getter") 248 if (argumentCount == 1 && str == "Window_location_cross_frame_Getter")
250 return DartWindowInternal::locationCrossFrameGetter; 249 return DartWindowInternal::locationCrossFrameGetter;
251 return 0; 250 return 0;
252 } 251 }
253 252
254 } 253 }
OLDNEW
« no previous file with comments | « Source/bindings/dart/DartLibraryIds.h ('k') | Source/bindings/dart/DartUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698