| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bin/directory.h" | 5 #include "bin/directory.h" |
| 6 | 6 |
| 7 #include "bin/dartutils.h" | 7 #include "bin/dartutils.h" |
| 8 #include "bin/thread.h" | 8 #include "bin/thread.h" |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 return CObject::IllegalArgumentError(); | 272 return CObject::IllegalArgumentError(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 | 275 |
| 276 static void DirectoryService(Dart_Port dest_port_id, | 276 static void DirectoryService(Dart_Port dest_port_id, |
| 277 Dart_Port reply_port_id, | 277 Dart_Port reply_port_id, |
| 278 Dart_CObject* message) { | 278 Dart_CObject* message) { |
| 279 CObject* response = CObject::IllegalArgumentError(); | 279 CObject* response = CObject::IllegalArgumentError(); |
| 280 CObjectArray request(message); | 280 CObjectArray request(message); |
| 281 if (message->type == Dart_CObject::kArray) { | 281 if (message->type == Dart_CObject_kArray) { |
| 282 if (request.Length() > 1 && request[0]->IsInt32()) { | 282 if (request.Length() > 1 && request[0]->IsInt32()) { |
| 283 CObjectInt32 requestType(request[0]); | 283 CObjectInt32 requestType(request[0]); |
| 284 switch (requestType.Value()) { | 284 switch (requestType.Value()) { |
| 285 case Directory::kCreateRequest: | 285 case Directory::kCreateRequest: |
| 286 response = DirectoryCreateRequest(request); | 286 response = DirectoryCreateRequest(request); |
| 287 break; | 287 break; |
| 288 case Directory::kDeleteRequest: | 288 case Directory::kDeleteRequest: |
| 289 response = DirectoryDeleteRequest(request); | 289 response = DirectoryDeleteRequest(request); |
| 290 break; | 290 break; |
| 291 case Directory::kExistsRequest: | 291 case Directory::kExistsRequest: |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 Dart_ThrowException(Dart_New( | 396 Dart_ThrowException(Dart_New( |
| 397 DartUtils::GetDartClass(DartUtils::kIOLibURL, "DirectoryIOException"), | 397 DartUtils::GetDartClass(DartUtils::kIOLibURL, "DirectoryIOException"), |
| 398 Dart_Null(), | 398 Dart_Null(), |
| 399 3, | 399 3, |
| 400 args)); | 400 args)); |
| 401 return true; | 401 return true; |
| 402 } | 402 } |
| 403 | 403 |
| 404 } // namespace bin | 404 } // namespace bin |
| 405 } // namespace dart | 405 } // namespace dart |
| OLD | NEW |