| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |