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

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

Issue 2480793002: clang-format runtime/bin (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/platform.h ('k') | runtime/bin/platform_android.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 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "bin/platform.h" 7 #include "bin/platform.h"
8 8
9 #include "bin/file.h" 9 #include "bin/file.h"
10 #include "bin/utils.h" 10 #include "bin/utils.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 } 88 }
89 Dart_SetReturnValue(args, result); 89 Dart_SetReturnValue(args, result);
90 } 90 }
91 91
92 92
93 void FUNCTION_NAME(Platform_Environment)(Dart_NativeArguments args) { 93 void FUNCTION_NAME(Platform_Environment)(Dart_NativeArguments args) {
94 intptr_t count = 0; 94 intptr_t count = 0;
95 char** env = Platform::Environment(&count); 95 char** env = Platform::Environment(&count);
96 if (env == NULL) { 96 if (env == NULL) {
97 OSError error(-1, 97 OSError error(-1, "Failed to retrieve environment variables.",
98 "Failed to retrieve environment variables.",
99 OSError::kUnknown); 98 OSError::kUnknown);
100 Dart_SetReturnValue(args, DartUtils::NewDartOSError(&error)); 99 Dart_SetReturnValue(args, DartUtils::NewDartOSError(&error));
101 } else { 100 } else {
102 Dart_Handle result = Dart_NewList(count); 101 Dart_Handle result = Dart_NewList(count);
103 if (Dart_IsError(result)) { 102 if (Dart_IsError(result)) {
104 Dart_PropagateError(result); 103 Dart_PropagateError(result);
105 } 104 }
106 intptr_t result_idx = 0; 105 intptr_t result_idx = 0;
107 for (intptr_t env_idx = 0; env_idx < count; env_idx++) { 106 for (intptr_t env_idx = 0; env_idx < count; env_idx++) {
108 Dart_Handle str = DartUtils::NewString(env[env_idx]); 107 Dart_Handle str = DartUtils::NewString(env[env_idx]);
(...skipping 14 matching lines...) Expand all
123 122
124 123
125 void FUNCTION_NAME(Platform_GetVersion)(Dart_NativeArguments args) { 124 void FUNCTION_NAME(Platform_GetVersion)(Dart_NativeArguments args) {
126 Dart_SetReturnValue(args, Dart_NewStringFromCString(Dart_VersionString())); 125 Dart_SetReturnValue(args, Dart_NewStringFromCString(Dart_VersionString()));
127 } 126 }
128 127
129 } // namespace bin 128 } // namespace bin
130 } // namespace dart 129 } // namespace dart
131 130
132 #endif // !defined(DART_IO_DISABLED) 131 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/platform.h ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698