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

Unified Diff: runtime/bin/dartutils.cc

Issue 1411853003: Service isolate requests Observatory assets from embedder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 62285162604ff2075613f668c6e4d3f2f8907801..3c16a0ef7fc69b3844bf91f8f70b122062d01674 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -284,6 +284,27 @@ Dart_Handle DartUtils::ReadStringFromFile(const char* filename) {
}
+Dart_Handle DartUtils::MakeUint8Array(const uint8_t* buffer, intptr_t len) {
+ Dart_Handle array = Dart_NewTypedData(Dart_TypedData_kUint8, len);
+ RETURN_IF_ERROR(array);
+ {
+ Dart_TypedData_Type td_type;
+ void* td_data;
+ intptr_t td_len;
+ Dart_Handle result =
+ Dart_TypedDataAcquireData(array, &td_type, &td_data, &td_len);
+ RETURN_IF_ERROR(result);
+ ASSERT(td_type == Dart_TypedData_kUint8);
+ ASSERT(td_len == len);
+ ASSERT(td_data != NULL);
+ memmove(td_data, buffer, td_len);
+ result = Dart_TypedDataReleaseData(array);
+ RETURN_IF_ERROR(result);
+ }
+ return array;
+}
+
+
Dart_Handle DartUtils::SetWorkingDirectory(Dart_Handle builtin_lib) {
Dart_Handle directory = NewString(original_working_directory);
return SingleArgDart_Invoke(builtin_lib, "_setWorkingDirectory", directory);
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698