| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 DartApiScope dartApiScope; | 46 DartApiScope dartApiScope; |
| 47 Dart_Handle exception; | 47 Dart_Handle exception; |
| 48 { | 48 { |
| 49 ScriptExecutionContext* context = DartUtilities::scriptExecutionContext(
); | 49 ScriptExecutionContext* context = DartUtilities::scriptExecutionContext(
); |
| 50 if (!context) { | 50 if (!context) { |
| 51 exception = Dart_NewString("XMLHttpRequest constructor's associated
context is not available"); | 51 exception = Dart_NewString("XMLHttpRequest constructor's associated
context is not available"); |
| 52 goto fail; | 52 goto fail; |
| 53 } | 53 } |
| 54 | 54 |
| 55 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context); | 55 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context); |
| 56 DartDOMWrapper::bindDOMObjectToDartWrapper(xmlHttpRequest.get(), Dart_Ge
tNativeArgument(args, 0)); | 56 DartDOMWrapper::returnValue(args, xmlHttpRequest.get()); |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 | 59 |
| 60 fail: | 60 fail: |
| 61 Dart_ThrowException(exception); | 61 Dart_ThrowException(exception); |
| 62 ASSERT_NOT_REACHED(); | 62 ASSERT_NOT_REACHED(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void openCallback(Dart_NativeArguments args) | 65 void openCallback(Dart_NativeArguments args) |
| 66 { | 66 { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 void responseGetter(Dart_NativeArguments args) | 180 void responseGetter(Dart_NativeArguments args) |
| 181 { | 181 { |
| 182 // FIXME: implement. | 182 // FIXME: implement. |
| 183 DART_UNIMPLEMENTED(); | 183 DART_UNIMPLEMENTED(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // DartXMLHttpRequestInternal | 186 } // DartXMLHttpRequestInternal |
| 187 | 187 |
| 188 } // WebCore | 188 } // WebCore |
| OLD | NEW |