| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/rand_util.h" | 15 #include "base/rand_util.h" |
| 16 #include "dart/runtime/include/dart_api.h" | |
| 17 #include "mojo/dart/embedder/builtin.h" | 16 #include "mojo/dart/embedder/builtin.h" |
| 18 #include "mojo/dart/embedder/mojo_natives.h" | 17 #include "mojo/dart/embedder/mojo_natives.h" |
| 18 #include "mojo/public/third_party/dart/runtime/include/dart_api.h" |
| 19 | 19 |
| 20 #if defined(OS_ANDROID) | 20 #if defined(OS_ANDROID) |
| 21 #include <android/log.h> | 21 #include <android/log.h> |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace mojo { | 24 namespace mojo { |
| 25 namespace dart { | 25 namespace dart { |
| 26 | 26 |
| 27 // Lists the native functions implementing basic functionality in | 27 // Lists the native functions implementing basic functionality in |
| 28 // the Mojo embedder dart, such as printing, and file I/O. | 28 // the Mojo embedder dart, such as printing, and file I/O. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 Dart_Handle error = Dart_NewStringFromCString( | 131 Dart_Handle error = Dart_NewStringFromCString( |
| 132 "Failed to allocate storage."); | 132 "Failed to allocate storage."); |
| 133 Dart_ThrowException(error); | 133 Dart_ThrowException(error); |
| 134 } | 134 } |
| 135 Dart_ListSetAsBytes(result, 0, buffer.get(), count); | 135 Dart_ListSetAsBytes(result, 0, buffer.get(), count); |
| 136 Dart_SetReturnValue(args, result); | 136 Dart_SetReturnValue(args, result); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace bin | 139 } // namespace bin |
| 140 } // namespace dart | 140 } // namespace dart |
| OLD | NEW |