Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: runtime/bin/directory.cc

Issue 15689013: - Modify dart_api.h to be a proper C API. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698