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

Side by Side Diff: runtime/bin/process_patch.dart

Issue 2822943002: [dart:io] Adds ProcessInfo.{max,current}Rss. Adds OS::MaxRSS on Fuchsia. (Closed)
Patch Set: Fix Fuchsia build Created 3 years, 8 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/process_macos.cc ('k') | runtime/bin/process_unsupported.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 @patch 5 @patch
6 class _WindowsCodePageDecoder { 6 class _WindowsCodePageDecoder {
7 @patch 7 @patch
8 static String _decodeBytes(List<int> bytes) native "SystemEncodingToString"; 8 static String _decodeBytes(List<int> bytes) native "SystemEncodingToString";
9 } 9 }
10 10
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 static Stream<ProcessSignal> _watchSignalInternal(ProcessSignal signal) { 160 static Stream<ProcessSignal> _watchSignalInternal(ProcessSignal signal) {
161 if (_signalControllers[signal._signalNumber] == null) { 161 if (_signalControllers[signal._signalNumber] == null) {
162 _signalControllers[signal._signalNumber] = new _SignalController(signal); 162 _signalControllers[signal._signalNumber] = new _SignalController(signal);
163 } 163 }
164 return _signalControllers[signal._signalNumber].stream; 164 return _signalControllers[signal._signalNumber].stream;
165 } 165 }
166 } 166 }
167 167
168 @patch
169 class ProcessInfo {
170 @patch
171 static int get maxRss {
172 var result = _maxRss();
Vyacheslav Egorov (Google) 2017/04/18 16:02:04 This code looks bizarre - why is _maxRss simply no
zra 2017/04/18 16:07:17 Two reasons: 1. Calling Dart_ThrowException and D
Vyacheslav Egorov (Google) 2017/04/18 16:21:17 longjmp and setjmp are dangerous indeed[*] - never
zra 2017/04/18 16:33:58 Slava, you make some valid points, but: 1. I don't
173 if (result is OSError) {
174 throw result;
175 }
176 return result;
177 }
178
179 @patch
180 static int get currentRss {
181 var result = _currentRss();
182 if (result is OSError) {
183 throw result;
184 }
185 return result;
186 }
187
188 static _maxRss() native "ProcessInfo_MaxRSS";
189 static _currentRss() native "ProcessInfo_CurrentRSS";
190 }
191
168 class _ProcessStartStatus { 192 class _ProcessStartStatus {
169 int _errorCode; // Set to OS error code if process start failed. 193 int _errorCode; // Set to OS error code if process start failed.
170 String _errorMessage; // Set to OS error message if process start failed. 194 String _errorMessage; // Set to OS error message if process start failed.
171 } 195 }
172 196
173 // The NativeFieldWrapperClass1 can not be used with a mixin, due to missing 197 // The NativeFieldWrapperClass1 can not be used with a mixin, due to missing
174 // implicit constructor. 198 // implicit constructor.
175 class _ProcessImplNativeWrapper extends NativeFieldWrapperClass1 {} 199 class _ProcessImplNativeWrapper extends NativeFieldWrapperClass1 {}
176 200
177 class _ProcessImpl extends _ProcessImplNativeWrapper implements Process { 201 class _ProcessImpl extends _ProcessImplNativeWrapper implements Process {
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 var process = new _ProcessImpl( 611 var process = new _ProcessImpl(
588 executable, 612 executable,
589 arguments, 613 arguments,
590 workingDirectory, 614 workingDirectory,
591 environment, 615 environment,
592 includeParentEnvironment, 616 includeParentEnvironment,
593 runInShell, 617 runInShell,
594 ProcessStartMode.NORMAL); 618 ProcessStartMode.NORMAL);
595 return process._runAndWait(stdoutEncoding, stderrEncoding); 619 return process._runAndWait(stdoutEncoding, stderrEncoding);
596 } 620 }
OLDNEW
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | runtime/bin/process_unsupported.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698