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

Side by Side Diff: runtime/bin/platform_macos.cc

Issue 3001963002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Fuchsia fix Created 3 years, 3 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
« no previous file with comments | « runtime/bin/platform_linux.cc ('k') | runtime/bin/platform_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(HOST_OS_MACOS) 6 #if defined(HOST_OS_MACOS)
7 7
8 #include "bin/platform.h" 8 #include "bin/platform.h"
9 9
10 #include <CoreFoundation/CoreFoundation.h> 10 #include <CoreFoundation/CoreFoundation.h>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 uint32_t path_size = 0; 194 uint32_t path_size = 0;
195 if (_NSGetExecutablePath(NULL, &path_size) == 0) { 195 if (_NSGetExecutablePath(NULL, &path_size) == 0) {
196 return NULL; 196 return NULL;
197 } 197 }
198 // Allocate buffer and get executable path. 198 // Allocate buffer and get executable path.
199 char* path = DartUtils::ScopedCString(path_size); 199 char* path = DartUtils::ScopedCString(path_size);
200 if (_NSGetExecutablePath(path, &path_size) != 0) { 200 if (_NSGetExecutablePath(path, &path_size) != 0) {
201 return NULL; 201 return NULL;
202 } 202 }
203 // Return the canonical path as the returned path might contain symlinks. 203 // Return the canonical path as the returned path might contain symlinks.
204 const char* canon_path = File::GetCanonicalPath(path); 204 const char* canon_path = File::GetCanonicalPath(NULL, path);
205 return canon_path; 205 return canon_path;
206 } 206 }
207 207
208 void Platform::Exit(int exit_code) { 208 void Platform::Exit(int exit_code) {
209 exit(exit_code); 209 exit(exit_code);
210 } 210 }
211 211
212 } // namespace bin 212 } // namespace bin
213 } // namespace dart 213 } // namespace dart
214 214
215 #endif // defined(HOST_OS_MACOS) 215 #endif // defined(HOST_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/platform_linux.cc ('k') | runtime/bin/platform_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698