| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace DartDirectoryEntrySyncInternal { | 39 namespace DartDirectoryEntrySyncInternal { |
| 40 | 40 |
| 41 void getFileCallback(Dart_NativeArguments args) | 41 void getFileCallback(Dart_NativeArguments args) |
| 42 { | 42 { |
| 43 DartApiScope dartApiScope; | 43 DartApiScope dartApiScope; |
| 44 Dart_Handle exception = 0; | 44 Dart_Handle exception = 0; |
| 45 { | 45 { |
| 46 DirectoryEntrySync* receiver = DartDOMWrapper::receiver<DirectoryEntrySy
nc>(args); | 46 DirectoryEntrySync* receiver = DartDOMWrapper::receiver<DirectoryEntrySy
nc>(args); |
| 47 | 47 |
| 48 ParameterAdapter<String> path(Dart_GetNativeArgument(args, 1), DartUtili
ties::ConvertNullToDefaultValue); | 48 DartStringAdapter path = DartUtilities::dartToStringWithNullCheck(Dart_G
etNativeArgument(args, 1), exception); |
| 49 if (!path.conversionSuccessful()) { | 49 if (exception) |
| 50 exception = path.exception(); | |
| 51 goto fail; | 50 goto fail; |
| 52 } | |
| 53 | 51 |
| 54 RefPtr<WebKitFlags> flags = 0; | 52 RefPtr<WebKitFlags> flags = 0; |
| 55 Dart_Handle flagsHandle = Dart_GetNativeArgument(args, 2); | 53 Dart_Handle flagsHandle = Dart_GetNativeArgument(args, 2); |
| 56 if (!Dart_IsNull(flagsHandle)) { | 54 if (!Dart_IsNull(flagsHandle)) { |
| 57 flags = DartUtilities::toWebKitFlags(flagsHandle, exception); | 55 flags = DartUtilities::toWebKitFlags(flagsHandle, exception); |
| 58 if (exception) | 56 if (exception) |
| 59 goto fail; | 57 goto fail; |
| 60 } | 58 } |
| 61 | 59 |
| 62 ExceptionCode ec = 0; | 60 ExceptionCode ec = 0; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 77 ASSERT_NOT_REACHED(); | 75 ASSERT_NOT_REACHED(); |
| 78 } | 76 } |
| 79 | 77 |
| 80 void getDirectoryCallback(Dart_NativeArguments args) | 78 void getDirectoryCallback(Dart_NativeArguments args) |
| 81 { | 79 { |
| 82 DartApiScope dartApiScope; | 80 DartApiScope dartApiScope; |
| 83 Dart_Handle exception = 0; | 81 Dart_Handle exception = 0; |
| 84 { | 82 { |
| 85 DirectoryEntrySync* receiver = DartDOMWrapper::receiver<DirectoryEntrySy
nc>(args); | 83 DirectoryEntrySync* receiver = DartDOMWrapper::receiver<DirectoryEntrySy
nc>(args); |
| 86 | 84 |
| 87 ParameterAdapter<String> path(Dart_GetNativeArgument(args, 1), DartUtili
ties::ConvertNullToDefaultValue); | 85 DartStringAdapter path = DartUtilities::dartToStringWithNullCheck(Dart_G
etNativeArgument(args, 1), exception); |
| 88 if (!path.conversionSuccessful()) { | 86 if (exception) |
| 89 exception = path.exception(); | |
| 90 goto fail; | 87 goto fail; |
| 91 } | |
| 92 | 88 |
| 93 RefPtr<WebKitFlags> flags = 0; | 89 RefPtr<WebKitFlags> flags = 0; |
| 94 Dart_Handle flagsHandle = Dart_GetNativeArgument(args, 2); | 90 Dart_Handle flagsHandle = Dart_GetNativeArgument(args, 2); |
| 95 if (!Dart_IsNull(flagsHandle)) { | 91 if (!Dart_IsNull(flagsHandle)) { |
| 96 flags = DartUtilities::toWebKitFlags(flagsHandle, exception); | 92 flags = DartUtilities::toWebKitFlags(flagsHandle, exception); |
| 97 if (exception) | 93 if (exception) |
| 98 goto fail; | 94 goto fail; |
| 99 } | 95 } |
| 100 | 96 |
| 101 ExceptionCode ec = 0; | 97 ExceptionCode ec = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 114 fail: | 110 fail: |
| 115 Dart_ThrowException(exception); | 111 Dart_ThrowException(exception); |
| 116 ASSERT_NOT_REACHED(); | 112 ASSERT_NOT_REACHED(); |
| 117 } | 113 } |
| 118 | 114 |
| 119 } | 115 } |
| 120 | 116 |
| 121 } | 117 } |
| 122 | 118 |
| 123 #endif // ENABLE(FILE_SYSTEM) | 119 #endif // ENABLE(FILE_SYSTEM) |
| OLD | NEW |