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

Unified Diff: runtime/vm/flags.cc

Issue 8713012: Introduce Dart_SetVMFlags API function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Comments addressed. Created 9 years, 1 month 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/vm/flags.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flags.cc
diff --git a/runtime/vm/flags.cc b/runtime/vm/flags.cc
index 74cb5e7450bceb806688aee2d5355cf79ab67605..2d6121bd3dfb51a04af95a861c64516bd74b3ca8 100644
--- a/runtime/vm/flags.cc
+++ b/runtime/vm/flags.cc
@@ -16,6 +16,8 @@ DEFINE_FLAG(bool, ignore_unrecognized_flags, false,
// List of registered flags.
Flag* Flags::flags_ = NULL;
+bool Flags::initialized_ = false;
+
class Flag {
public:
enum Type {
@@ -225,8 +227,14 @@ static bool IsValidFlag(const char* name,
}
-void Flags::ProcessCommandLineFlags(int number_of_vm_flags,
+bool Flags::ProcessCommandLineFlags(int number_of_vm_flags,
const char** vm_flags) {
+ if (initialized_) {
+ return false;
+ }
+
+ initialized_ = true;
+
const char* kPrefix = "--";
const intptr_t kPrefixLen = strlen(kPrefix);
@@ -265,6 +273,8 @@ void Flags::ProcessCommandLineFlags(int number_of_vm_flags,
flag = flag->next_;
}
}
+
+ return true;
}
} // namespace dart
« no previous file with comments | « runtime/vm/flags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698