| OLD | NEW |
| 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" |
| 11 #include "bin/thread.h" | 11 #include "bin/thread.h" |
| 12 #include "platform/globals.h" | 12 #include "platform/globals.h" |
| 13 #include "platform/utils.h" | 13 #include "platform/utils.h" |
| 14 | 14 |
| 15 | |
| 16 namespace dart { | 15 namespace dart { |
| 17 namespace bin { | 16 namespace bin { |
| 18 | 17 |
| 19 class ProcessResult { | 18 class ProcessResult { |
| 20 public: | 19 public: |
| 21 ProcessResult() : exit_code_(0) {} | 20 ProcessResult() : exit_code_(0) {} |
| 22 | 21 |
| 23 void set_stdout_data(Dart_Handle stdout_data) { | 22 void set_stdout_data(Dart_Handle stdout_data) { |
| 24 stdout_data_ = stdout_data; | 23 stdout_data_ = stdout_data; |
| 25 } | 24 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 Dart_Port port() const { return port_; } | 175 Dart_Port port() const { return port_; } |
| 177 SignalInfo* next() const { return next_; } | 176 SignalInfo* next() const { return next_; } |
| 178 | 177 |
| 179 private: | 178 private: |
| 180 intptr_t fd_; | 179 intptr_t fd_; |
| 181 intptr_t signal_; | 180 intptr_t signal_; |
| 182 // The port_ is used to identify what isolate the signal-info belongs to. | 181 // The port_ is used to identify what isolate the signal-info belongs to. |
| 183 Dart_Port port_; | 182 Dart_Port port_; |
| 184 SignalInfo* next_; | 183 SignalInfo* next_; |
| 185 SignalInfo* prev_; | 184 SignalInfo* prev_; |
| 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(SignalInfo); |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 | 189 |
| 189 // Utility class for collecting the output when running a process | 190 // Utility class for collecting the output when running a process |
| 190 // synchronously by using Process::Wait. This class is sub-classed in | 191 // synchronously by using Process::Wait. This class is sub-classed in |
| 191 // the platform specific files to implement reading into the buffers | 192 // the platform specific files to implement reading into the buffers |
| 192 // allocated. | 193 // allocated. |
| 193 class BufferListBase { | 194 class BufferListBase { |
| 194 protected: | 195 protected: |
| 195 static const intptr_t kBufferSize = 16 * 1024; | 196 static const intptr_t kBufferSize = 16 * 1024; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 279 |
| 279 // Linked list for data collected. | 280 // Linked list for data collected. |
| 280 BufferListNode* head_; | 281 BufferListNode* head_; |
| 281 BufferListNode* tail_; | 282 BufferListNode* tail_; |
| 282 | 283 |
| 283 // Number of bytes of data collected in the linked list. | 284 // Number of bytes of data collected in the linked list. |
| 284 intptr_t data_size_; | 285 intptr_t data_size_; |
| 285 | 286 |
| 286 // Number of free bytes in the last node in the list. | 287 // Number of free bytes in the last node in the list. |
| 287 intptr_t free_size_; | 288 intptr_t free_size_; |
| 289 |
| 290 private: |
| 291 DISALLOW_COPY_AND_ASSIGN(BufferListBase); |
| 288 }; | 292 }; |
| 289 | 293 |
| 290 } // namespace bin | 294 } // namespace bin |
| 291 } // namespace dart | 295 } // namespace dart |
| 292 | 296 |
| 293 #endif // BIN_PROCESS_H_ | 297 #endif // BIN_PROCESS_H_ |
| OLD | NEW |