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

Side by Side Diff: runtime/bin/platform.h

Issue 2941873002: [Fuchsia] Fix Platform.executable and Platform.resolvedExecutable (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_BIN_PLATFORM_H_ 5 #ifndef RUNTIME_BIN_PLATFORM_H_
6 #define RUNTIME_BIN_PLATFORM_H_ 6 #define RUNTIME_BIN_PLATFORM_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // strings is Dart_ScopeAllocated. The number of elements in the array is 58 // strings is Dart_ScopeAllocated. The number of elements in the array is
59 // returned in the count argument. 59 // returned in the count argument.
60 static char** Environment(intptr_t* count); 60 static char** Environment(intptr_t* count);
61 61
62 static const char* ResolveExecutablePath(); 62 static const char* ResolveExecutablePath();
63 63
64 // Stores the executable name. 64 // Stores the executable name.
65 static void SetExecutableName(const char* executable_name) { 65 static void SetExecutableName(const char* executable_name) {
66 executable_name_ = executable_name; 66 executable_name_ = executable_name;
67 } 67 }
68 static const char* GetExecutableName() { return executable_name_; } 68 static const char* GetExecutableName();
69 static const char* GetResolvedExecutableName() { 69 static const char* GetResolvedExecutableName() {
70 if (resolved_executable_name_ == NULL) { 70 if (resolved_executable_name_ == NULL) {
71 // Try to resolve the executable path using platform specific APIs. 71 // Try to resolve the executable path using platform specific APIs.
72 const char* resolved_name = Platform::ResolveExecutablePath(); 72 const char* resolved_name = Platform::ResolveExecutablePath();
73 if (resolved_name != NULL) { 73 if (resolved_name != NULL) {
74 resolved_executable_name_ = strdup(resolved_name); 74 resolved_executable_name_ = strdup(resolved_name);
75 } 75 }
76 } 76 }
77 return resolved_executable_name_; 77 return resolved_executable_name_;
78 } 78 }
(...skipping 18 matching lines...) Expand all
97 static char** argv_; // VM flags are argv_[1 ... script_index_ - 1] 97 static char** argv_; // VM flags are argv_[1 ... script_index_ - 1]
98 98
99 DISALLOW_ALLOCATION(); 99 DISALLOW_ALLOCATION();
100 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); 100 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform);
101 }; 101 };
102 102
103 } // namespace bin 103 } // namespace bin
104 } // namespace dart 104 } // namespace dart
105 105
106 #endif // RUNTIME_BIN_PLATFORM_H_ 106 #endif // RUNTIME_BIN_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698