| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 namespace DartDirectoryEntryInternal { | 40 namespace DartDirectoryEntryInternal { |
| 41 | 41 |
| 42 void getFileCallback(Dart_NativeArguments args) | 42 void getFileCallback(Dart_NativeArguments args) |
| 43 { | 43 { |
| 44 DartApiScope dartApiScope; | 44 DartApiScope dartApiScope; |
| 45 Dart_Handle exception = 0; | 45 Dart_Handle exception = 0; |
| 46 { | 46 { |
| 47 DirectoryEntry* receiver = DartDOMWrapper::receiver<DirectoryEntry>(args
); | 47 DirectoryEntry* receiver = DartDOMWrapper::receiver<DirectoryEntry>(args
); |
| 48 | 48 |
| 49 ParameterAdapter<String> path(Dart_GetNativeArgument(args, 1), DartUtili
ties::ConvertNullToDefaultValue); | 49 DartStringAdapter path = DartUtilities::dartToStringWithNullCheck(Dart_G
etNativeArgument(args, 1), exception); |
| 50 if (!path.conversionSuccessful()) { | 50 if (exception) |
| 51 exception = path.exception(); | |
| 52 goto fail; | 51 goto fail; |
| 53 } | |
| 54 | 52 |
| 55 RefPtr<WebKitFlags> flags = 0; | 53 RefPtr<WebKitFlags> flags = 0; |
| 56 Dart_Handle flagsHandle = Dart_GetNativeArgument(args, 2); | 54 Dart_Handle flagsHandle = Dart_GetNativeArgument(args, 2); |
| 57 if (!Dart_IsNull(flagsHandle)) { | 55 if (!Dart_IsNull(flagsHandle)) { |
| 58 flags = DartUtilities::toWebKitFlags(flagsHandle, exception); | 56 flags = DartUtilities::toWebKitFlags(flagsHandle, exception); |
| 59 if (exception) | 57 if (exception) |
| 60 goto fail; | 58 goto fail; |
| 61 } | 59 } |
| 62 | 60 |
| 63 RefPtr<EntryCallback> successCallback = DartEntryCallback::create(Dart_G
etNativeArgument(args, 3), DartUtilities::ConvertNullToDefaultValue, exception); | 61 RefPtr<EntryCallback> successCallback = DartEntryCallback::create(Dart_G
etNativeArgument(args, 3), DartUtilities::ConvertNullToDefaultValue, exception); |
| (...skipping 13 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 DirectoryEntry* receiver = DartDOMWrapper::receiver<DirectoryEntry>(args
); | 83 DirectoryEntry* receiver = DartDOMWrapper::receiver<DirectoryEntry>(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 RefPtr<EntryCallback> successCallback = DartEntryCallback::create(Dart_G
etNativeArgument(args, 3), DartUtilities::ConvertNullToDefaultValue, exception); | 97 RefPtr<EntryCallback> successCallback = DartEntryCallback::create(Dart_G
etNativeArgument(args, 3), DartUtilities::ConvertNullToDefaultValue, exception); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 113 fail: | 109 fail: |
| 114 Dart_ThrowException(exception); | 110 Dart_ThrowException(exception); |
| 115 ASSERT_NOT_REACHED(); | 111 ASSERT_NOT_REACHED(); |
| 116 } | 112 } |
| 117 | 113 |
| 118 } | 114 } |
| 119 | 115 |
| 120 } | 116 } |
| 121 | 117 |
| 122 #endif // ENABLE(FILE_SYSTEM) | 118 #endif // ENABLE(FILE_SYSTEM) |
| OLD | NEW |