| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 namespace DartIntentInternal { | 38 namespace DartIntentInternal { |
| 39 | 39 |
| 40 void constructorCallback(Dart_NativeArguments args) | 40 void constructorCallback(Dart_NativeArguments args) |
| 41 { | 41 { |
| 42 DartApiScope dartApiScope; | 42 DartApiScope dartApiScope; |
| 43 Dart_Handle exception = 0; | 43 Dart_Handle exception = 0; |
| 44 { | 44 { |
| 45 const ParameterAdapter<String> action(Dart_GetNativeArgument(args, 0)); | 45 DartStringAdapter action = DartUtilities::dartToString(Dart_GetNativeArg
ument(args, 0), exception); |
| 46 if (!action.conversionSuccessful()) { | 46 if (exception) |
| 47 exception = action.exception(); | |
| 48 goto fail; | 47 goto fail; |
| 49 } | |
| 50 | 48 |
| 51 const ParameterAdapter<String> type(Dart_GetNativeArgument(args, 1)); | 49 DartStringAdapter type = DartUtilities::dartToString(Dart_GetNativeArgum
ent(args, 1), exception); |
| 52 if (!type.conversionSuccessful()) { | 50 if (exception) |
| 53 exception = type.exception(); | |
| 54 goto fail; | 51 goto fail; |
| 55 } | |
| 56 | 52 |
| 57 RefPtr<SerializedScriptValue> data; | 53 RefPtr<SerializedScriptValue> data; |
| 58 if (!Dart_IsNull(Dart_GetNativeArgument(args, 2))) { | 54 if (!Dart_IsNull(Dart_GetNativeArgument(args, 2))) { |
| 59 data = DartUtilities::dartToSerializedScriptValue(Dart_GetNativeArgu
ment(args, 2), exception); | 55 data = DartUtilities::dartToSerializedScriptValue(Dart_GetNativeArgu
ment(args, 2), exception); |
| 60 if (exception) | 56 if (exception) |
| 61 goto fail; | 57 goto fail; |
| 62 } | 58 } |
| 63 | 59 |
| 64 MessagePortArray transferList; | 60 MessagePortArray transferList; |
| 65 ArrayBufferArray arrayBufferArray; | 61 ArrayBufferArray arrayBufferArray; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 fail: | 77 fail: |
| 82 Dart_ThrowException(exception); | 78 Dart_ThrowException(exception); |
| 83 ASSERT_NOT_REACHED(); | 79 ASSERT_NOT_REACHED(); |
| 84 } | 80 } |
| 85 | 81 |
| 86 } | 82 } |
| 87 | 83 |
| 88 } | 84 } |
| 89 | 85 |
| 90 #endif | 86 #endif |
| OLD | NEW |