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

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

Issue 1601183003: SignalInfo must store fd_ as an intptr_t not an int. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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 #ifndef BIN_PROCESS_H_ 5 #ifndef BIN_PROCESS_H_
6 #define BIN_PROCESS_H_ 6 #define BIN_PROCESS_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/io_buffer.h" 9 #include "bin/io_buffer.h"
10 #include "bin/lockers.h" 10 #include "bin/lockers.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 static int global_exit_code_; 141 static int global_exit_code_;
142 static Mutex* global_exit_code_mutex_; 142 static Mutex* global_exit_code_mutex_;
143 143
144 DISALLOW_ALLOCATION(); 144 DISALLOW_ALLOCATION();
145 DISALLOW_IMPLICIT_CONSTRUCTORS(Process); 145 DISALLOW_IMPLICIT_CONSTRUCTORS(Process);
146 }; 146 };
147 147
148 148
149 class SignalInfo { 149 class SignalInfo {
150 public: 150 public:
151 SignalInfo(int fd, int signal, SignalInfo* next) 151 SignalInfo(intptr_t fd, intptr_t signal, SignalInfo* next)
152 : fd_(fd), 152 : fd_(fd),
153 signal_(signal), 153 signal_(signal),
154 // SignalInfo is expected to be created when in a isolate. 154 // SignalInfo is expected to be created when in a isolate.
155 port_(Dart_GetMainPortId()), 155 port_(Dart_GetMainPortId()),
156 next_(next), 156 next_(next),
157 prev_(NULL) { 157 prev_(NULL) {
158 if (next_ != NULL) { 158 if (next_ != NULL) {
159 next_->prev_ = this; 159 next_->prev_ = this;
160 } 160 }
161 } 161 }
162 162
163 ~SignalInfo(); 163 ~SignalInfo();
164 164
165 void Unlink() { 165 void Unlink() {
166 if (prev_ != NULL) { 166 if (prev_ != NULL) {
167 prev_->next_ = next_; 167 prev_->next_ = next_;
168 } 168 }
169 if (next_ != NULL) { 169 if (next_ != NULL) {
170 next_->prev_ = prev_; 170 next_->prev_ = prev_;
171 } 171 }
172 } 172 }
173 173
174 int fd() const { return fd_; } 174 intptr_t fd() const { return fd_; }
175 int signal() const { return signal_; } 175 intptr_t signal() const { return signal_; }
176 Dart_Port port() const { return port_; } 176 Dart_Port port() const { return port_; }
177 SignalInfo* next() const { return next_; } 177 SignalInfo* next() const { return next_; }
178 178
179 private: 179 private:
180 int fd_; 180 intptr_t fd_;
181 int signal_; 181 intptr_t signal_;
182 // The port_ is used to identify what isolate the signal-info belongs to. 182 // The port_ is used to identify what isolate the signal-info belongs to.
183 Dart_Port port_; 183 Dart_Port port_;
184 SignalInfo* next_; 184 SignalInfo* next_;
185 SignalInfo* prev_; 185 SignalInfo* prev_;
186 }; 186 };
187 187
188 188
189 // Utility class for collecting the output when running a process 189 // Utility class for collecting the output when running a process
190 // synchronously by using Process::Wait. This class is sub-classed in 190 // synchronously by using Process::Wait. This class is sub-classed in
191 // the platform specific files to implement reading into the buffers 191 // the platform specific files to implement reading into the buffers
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 intptr_t data_size_; 284 intptr_t data_size_;
285 285
286 // Number of free bytes in the last node in the list. 286 // Number of free bytes in the last node in the list.
287 intptr_t free_size_; 287 intptr_t free_size_;
288 }; 288 };
289 289
290 } // namespace bin 290 } // namespace bin
291 } // namespace dart 291 } // namespace dart
292 292
293 #endif // BIN_PROCESS_H_ 293 #endif // BIN_PROCESS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698