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

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

Issue 10408060: Fuzzing of dart:io Directory API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « no previous file | runtime/bin/directory_impl.dart » ('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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 CObjectArray* response = new CObjectArray(CObject::NewArray(2)); 180 CObjectArray* response = new CObjectArray(CObject::NewArray(2));
181 response->SetAt( 181 response->SetAt(
182 0, new CObjectInt32(CObject::NewInt32(DirectoryListing::kListDone))); 182 0, new CObjectInt32(CObject::NewInt32(DirectoryListing::kListDone)));
183 response->SetAt(1, CObject::Bool(completed)); 183 response->SetAt(1, CObject::Bool(completed));
184 return response; 184 return response;
185 } 185 }
186 // Respond with an illegal argument list error message. 186 // Respond with an illegal argument list error message.
187 CObjectArray* response = new CObjectArray(CObject::NewArray(3)); 187 CObjectArray* response = new CObjectArray(CObject::NewArray(3));
188 response->SetAt(0, new CObjectInt32( 188 response->SetAt(0, new CObjectInt32(
189 CObject::NewInt32(DirectoryListing::kListError))); 189 CObject::NewInt32(DirectoryListing::kListError)));
190 response->SetAt(1, request[1]); 190 response->SetAt(1, CObject::Null());
191 response->SetAt(2, CObject::IllegalArgumentError()); 191 response->SetAt(2, CObject::IllegalArgumentError());
192 Dart_PostCObject(response_port, response->AsApiCObject()); 192 Dart_PostCObject(response_port, response->AsApiCObject());
193 193
194 response = new CObjectArray(CObject::NewArray(2)); 194 response = new CObjectArray(CObject::NewArray(2));
195 response->SetAt( 195 response->SetAt(
196 0, new CObjectInt32(CObject::NewInt32(DirectoryListing::kListDone))); 196 0, new CObjectInt32(CObject::NewInt32(DirectoryListing::kListDone)));
197 response->SetAt(1, CObject::False()); 197 response->SetAt(1, CObject::False());
198 return response; 198 return response;
199 } 199 }
200 200
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 bool DirectoryListing::HandleError(const char* dir_name) { 316 bool DirectoryListing::HandleError(const char* dir_name) {
317 // TODO(sgjesse): Pass flags to indicate whether error 317 // TODO(sgjesse): Pass flags to indicate whether error
318 // responses are needed. 318 // responses are needed.
319 CObject* err = CObject::NewOSError(); 319 CObject* err = CObject::NewOSError();
320 CObjectArray* response = new CObjectArray(CObject::NewArray(3)); 320 CObjectArray* response = new CObjectArray(CObject::NewArray(3));
321 response->SetAt(0, new CObjectInt32(CObject::NewInt32(kListError))); 321 response->SetAt(0, new CObjectInt32(CObject::NewInt32(kListError)));
322 response->SetAt(1, new CObjectString(CObject::NewString(dir_name))); 322 response->SetAt(1, new CObjectString(CObject::NewString(dir_name)));
323 response->SetAt(2, err); 323 response->SetAt(2, err);
324 return Dart_PostCObject(response_port_, response->AsApiCObject()); 324 return Dart_PostCObject(response_port_, response->AsApiCObject());
325 } 325 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698