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

Unified Diff: runtime/bin/platform_impl.dart

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.dart ('k') | runtime/bin/platform_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_impl.dart
diff --git a/runtime/bin/platform_impl.dart b/runtime/bin/platform_impl.dart
index 0328e65dca6eee36f748af7597958aa8147edea1..f859854e89cdeca9e3b20a6841ce45b30197b8ad 100644
--- a/runtime/bin/platform_impl.dart
+++ b/runtime/bin/platform_impl.dart
@@ -8,6 +8,7 @@ class _Platform implements Platform {
static int _numberOfProcessors() native "Platform_NumberOfProcessors";
static String _pathSeparator() native "Platform_PathSeparator";
static String _operatingSystem() native "Platform_OperatingSystem";
+ static _localHostname() native "Platform_LocalHostname";
int numberOfProcessors() {
return _numberOfProcessors();
@@ -20,4 +21,13 @@ class _Platform implements Platform {
String operatingSystem() {
return _operatingSystem();
}
+
+ String localHostname() {
+ var result = _localHostname();
+ if (result is OSError) {
+ throw result;
+ } else {
+ return result;
+ }
+ }
}
« no previous file with comments | « runtime/bin/platform.dart ('k') | runtime/bin/platform_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698