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

Side by Side Diff: Source/bindings/dart/custom/DartXMLHttpRequestCustom.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
OLDNEW
1 // Copyright 2011, Google Inc. 1 // Copyright 2011, 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 { 127 {
128 Dart_Handle exception = 0; 128 Dart_Handle exception = 0;
129 { 129 {
130 XMLHttpRequest* receiver = DartDOMWrapper::receiver<XMLHttpRequest>(args ); 130 XMLHttpRequest* receiver = DartDOMWrapper::receiver<XMLHttpRequest>(args );
131 131
132 DartExceptionState es; 132 DartExceptionState es;
133 DartDOMData* domData = static_cast<DartDOMData*>(Dart_GetNativeIsolateDa ta(args)); 133 DartDOMData* domData = static_cast<DartDOMData*>(Dart_GetNativeIsolateDa ta(args));
134 Dart_Handle arg1 = Dart_GetNativeArgument(args, 1); 134 Dart_Handle arg1 = Dart_GetNativeArgument(args, 1);
135 if (Dart_IsNull(arg1)) { 135 if (Dart_IsNull(arg1)) {
136 receiver->send(es); 136 receiver->send(es);
137 } else if (DartDOMWrapper::instanceOf<DartDocument>(domData, arg1)) { 137 } else if (DartDOMWrapper::subtypeOf(arg1, DartDocument::dartClassId)) {
138 Document* asDocument = DartDocument::toNative(arg1, exception); 138 Document* asDocument = DartDocument::toNative(arg1, exception);
139 if (exception) 139 if (exception)
140 goto fail; 140 goto fail;
141 receiver->send(asDocument, es); 141 receiver->send(asDocument, es);
142 } else if (DartDOMWrapper::instanceOf<DartBlob>(domData, arg1)) { 142 } else if (DartDOMWrapper::subtypeOf(arg1, DartBlob::dartClassId)) {
143 Blob* asBlob = DartBlob::toNative(arg1, exception); 143 Blob* asBlob = DartBlob::toNative(arg1, exception);
144 if (exception) 144 if (exception)
145 goto fail; 145 goto fail;
146 receiver->send(asBlob, es); 146 receiver->send(asBlob, es);
147 } else if (DartDOMWrapper::instanceOf<DartFormData>(domData, arg1)) { 147 } else if (DartDOMWrapper::subtypeOf(arg1, DartFormData::dartClassId)) {
148 DOMFormData* asDOMFormData = DartFormData::toNative(arg1, exception) ; 148 DOMFormData* asDOMFormData = DartFormData::toNative(arg1, exception) ;
149 if (exception) 149 if (exception)
150 goto fail; 150 goto fail;
151 receiver->send(asDOMFormData, es); 151 receiver->send(asDOMFormData, es);
152 } else if (DartUtilities::isTypedData(arg1)) { 152 } else if (DartUtilities::isTypedData(arg1)) {
153 RefPtr<ArrayBuffer> asArrayBuffer = DartUtilities::dartToArrayBuffer (arg1, exception); 153 RefPtr<ArrayBuffer> asArrayBuffer = DartUtilities::dartToArrayBuffer (arg1, exception);
154 if (exception) 154 if (exception)
155 goto fail; 155 goto fail;
156 receiver->send(asArrayBuffer.get(), es); 156 receiver->send(asArrayBuffer.get(), es);
157 } else { 157 } else {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 fail: 266 fail:
267 Dart_ThrowException(exception); 267 Dart_ThrowException(exception);
268 ASSERT_NOT_REACHED(); 268 ASSERT_NOT_REACHED();
269 } 269 }
270 270
271 } // DartXMLHttpRequestInternal 271 } // DartXMLHttpRequestInternal
272 272
273 } // WebCore 273 } // WebCore
OLDNEW
« no previous file with comments | « Source/bindings/dart/custom/DartWebSocketCustom.cpp ('k') | Source/bindings/dart/gyp/dartium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698