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

Unified Diff: runtime/bin/platform.h

Issue 22999033: Add Platform.packageRoot and Platform.executableArguments to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve doc comments. Created 7 years, 4 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/main.cc ('k') | runtime/bin/platform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform.h
diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h
index dd195c32924042268b5768efe2d10f3d7e486950..ca723ae34dc761232127845f0b98d24195b4d883 100644
--- a/runtime/bin/platform.h
+++ b/runtime/bin/platform.h
@@ -42,8 +42,31 @@ class Platform {
return executable_name_;
}
+ // Stores and gets the package root.
+ static void SetPackageRoot(const char* package_root) {
+ package_root_ = package_root;
+ }
+ static const char* GetPackageRoot() {
+ return package_root_;
+ }
+
+ // Stores and gets the flags passed to the executable.
+ static void SetExecutableArguments(int script_index, char** argv) {
+ script_index_ = script_index;
+ argv_ = argv;
+ }
+ static int GetScriptIndex() {
+ return script_index_;
+ }
+ static char** GetArgv() {
+ return argv_;
+ }
+
private:
static const char* executable_name_;
+ static const char* package_root_;
+ static int script_index_;
+ static char** argv_; // VM flags are argv_[1 ... script_index_ - 1]
DISALLOW_ALLOCATION();
DISALLOW_IMPLICIT_CONSTRUCTORS(Platform);
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698