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

Unified Diff: runtime/bin/platform.cc

Issue 10050011: Add member localHostname() to the Dart IO Platform class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Using static bool to control initialization. Created 8 years, 8 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/platform.h ('k') | runtime/bin/platform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform.cc
diff --git a/runtime/bin/platform.cc b/runtime/bin/platform.cc
index 97c1a6a91f40ca76caad58f8b95a211bb18971b3..f8398f415174719fb6ffcb594c9d64983281b8b0 100644
--- a/runtime/bin/platform.cc
+++ b/runtime/bin/platform.cc
@@ -26,3 +26,16 @@ void FUNCTION_NAME(Platform_PathSeparator)(Dart_NativeArguments args) {
Dart_SetReturnValue(args, Dart_NewString(File::PathSeparator()));
Dart_ExitScope();
}
+
+
+void FUNCTION_NAME(Platform_LocalHostname)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ const intptr_t HOSTNAME_LENGTH = 256;
+ char hostname[HOSTNAME_LENGTH];
+ if (Platform::LocalHostname(hostname, HOSTNAME_LENGTH)) {
+ Dart_SetReturnValue(args, Dart_NewString(hostname));
+ } else {
+ Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+ }
+ Dart_ExitScope();
+}
« no previous file with comments | « runtime/bin/platform.h ('k') | runtime/bin/platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698