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

Unified Diff: runtime/bin/platform.h

Issue 1180623006: Revert change to Platform.excutable and add Platform.resolvedExecutable (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated dart2js io_patch.dart Created 5 years, 6 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/io_natives.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 6b81539da10433bb69f943b98eb2756d019479ba..3d3c0f3135c842a1b793b5017a0c556c94d1d69d 100644
--- a/runtime/bin/platform.h
+++ b/runtime/bin/platform.h
@@ -46,15 +46,14 @@ class Platform {
executable_name_ = executable_name;
}
static const char* GetExecutableName() {
- if (!executable_name_resolved_) {
+ return executable_name_;
+ }
+ static const char* GetResolvedExecutableName() {
+ if (resolved_executable_name_ == NULL) {
// Try to resolve the executable path using platform specific APIs.
- char* path = Platform::ResolveExecutablePath();
- if (path != NULL) {
- executable_name_ = path;
- }
- executable_name_resolved_ = true;
+ resolved_executable_name_ = Platform::ResolveExecutablePath();
}
- return executable_name_;
+ return resolved_executable_name_;
}
// Stores and gets the package root.
@@ -80,8 +79,8 @@ class Platform {
private:
// The path to the executable.
static const char* executable_name_;
- // State to indicate whether the executable name has been resolved.
- static bool executable_name_resolved_;
+ // The path to the resolved executable.
+ static const char* resolved_executable_name_;
static const char* package_root_;
static int script_index_;
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698