| OLD | NEW |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 DartApiScope dartApiScope; | 50 DartApiScope dartApiScope; |
| 51 Dart_Handle exception; | 51 Dart_Handle exception; |
| 52 { | 52 { |
| 53 ScriptExecutionContext* context = DartUtilities::scriptExecutionContext(
); | 53 ScriptExecutionContext* context = DartUtilities::scriptExecutionContext(
); |
| 54 if (!context) { | 54 if (!context) { |
| 55 exception = Dart_NewString("XMLHttpRequest constructor's associated
context is not available"); | 55 exception = Dart_NewString("XMLHttpRequest constructor's associated
context is not available"); |
| 56 goto fail; | 56 goto fail; |
| 57 } | 57 } |
| 58 | 58 |
| 59 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context); | 59 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context); |
| 60 DartDOMWrapper::bindDOMObjectToDartWrapper(xmlHttpRequest.get(), Dart_Ge
tNativeArgument(args, 0)); | 60 DartDOMWrapper::returnValue(args, xmlHttpRequest.get()); |
| 61 return; | 61 return; |
| 62 } | 62 } |
| 63 | 63 |
| 64 fail: | 64 fail: |
| 65 Dart_ThrowException(exception); | 65 Dart_ThrowException(exception); |
| 66 ASSERT_NOT_REACHED(); | 66 ASSERT_NOT_REACHED(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void openCallback(Dart_NativeArguments args) | 69 void openCallback(Dart_NativeArguments args) |
| 70 { | 70 { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 void responseGetter(Dart_NativeArguments args) | 219 void responseGetter(Dart_NativeArguments args) |
| 220 { | 220 { |
| 221 // FIXME: implement. | 221 // FIXME: implement. |
| 222 DART_UNIMPLEMENTED(); | 222 DART_UNIMPLEMENTED(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // DartXMLHttpRequestInternal | 225 } // DartXMLHttpRequestInternal |
| 226 | 226 |
| 227 } // WebCore | 227 } // WebCore |
| OLD | NEW |