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

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

Issue 2750843003: Rename TARGET_OS_* to HOST_OS_*. (Closed)
Patch Set: DEPS Created 3 years, 9 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_win.cc ('k') | runtime/bin/process_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 #ifndef RUNTIME_BIN_PROCESS_H_ 5 #ifndef RUNTIME_BIN_PROCESS_H_
6 #define RUNTIME_BIN_PROCESS_H_ 6 #define RUNTIME_BIN_PROCESS_H_
7 7
8 #include <errno.h> 8 #include <errno.h>
9 9
10 #include "bin/builtin.h" 10 #include "bin/builtin.h"
11 #include "bin/io_buffer.h" 11 #include "bin/io_buffer.h"
12 #include "bin/lockers.h" 12 #include "bin/lockers.h"
13 #include "bin/thread.h" 13 #include "bin/thread.h"
14 #include "platform/globals.h" 14 #include "platform/globals.h"
15 #if !defined(TARGET_OS_WINDOWS) 15 #if !defined(HOST_OS_WINDOWS)
16 #include "platform/signal_blocker.h" 16 #include "platform/signal_blocker.h"
17 #endif 17 #endif
18 #include "platform/utils.h" 18 #include "platform/utils.h"
19 19
20 namespace dart { 20 namespace dart {
21 namespace bin { 21 namespace bin {
22 22
23 class ProcessResult { 23 class ProcessResult {
24 public: 24 public:
25 ProcessResult() : exit_code_(0) {} 25 ProcessResult() : exit_code_(0) {}
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 // Number of bytes of data collected in the linked list. 316 // Number of bytes of data collected in the linked list.
317 intptr_t data_size_; 317 intptr_t data_size_;
318 318
319 // Number of free bytes in the last node in the list. 319 // Number of free bytes in the last node in the list.
320 intptr_t free_size_; 320 intptr_t free_size_;
321 321
322 DISALLOW_COPY_AND_ASSIGN(BufferListBase); 322 DISALLOW_COPY_AND_ASSIGN(BufferListBase);
323 }; 323 };
324 324
325 #if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_FUCHSIA) || \ 325 #if defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) || \
326 defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS) 326 defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS)
327 class BufferList : public BufferListBase { 327 class BufferList : public BufferListBase {
328 public: 328 public:
329 BufferList() {} 329 BufferList() {}
330 330
331 bool Read(int fd, intptr_t available) { 331 bool Read(int fd, intptr_t available) {
332 // Read all available bytes. 332 // Read all available bytes.
333 while (available > 0) { 333 while (available > 0) {
334 if (free_size() == 0) { 334 if (free_size() == 0) {
335 if (!Allocate()) { 335 if (!Allocate()) {
336 errno = ENOMEM; 336 errno = ENOMEM;
337 return false; 337 return false;
338 } 338 }
339 } 339 }
340 ASSERT(free_size() > 0); 340 ASSERT(free_size() > 0);
341 ASSERT(free_size() <= kBufferSize); 341 ASSERT(free_size() <= kBufferSize);
342 intptr_t block_size = dart::Utils::Minimum(free_size(), available); 342 intptr_t block_size = dart::Utils::Minimum(free_size(), available);
343 #if defined(TARGET_OS_FUCHSIA) 343 #if defined(HOST_OS_FUCHSIA)
344 intptr_t bytes = NO_RETRY_EXPECTED( 344 intptr_t bytes = NO_RETRY_EXPECTED(
345 read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size)); 345 read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
346 #else 346 #else
347 intptr_t bytes = TEMP_FAILURE_RETRY( 347 intptr_t bytes = TEMP_FAILURE_RETRY(
348 read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size)); 348 read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
349 #endif // defined(TARGET_OS_FUCHSIA) 349 #endif // defined(HOST_OS_FUCHSIA)
350 if (bytes < 0) { 350 if (bytes < 0) {
351 return false; 351 return false;
352 } 352 }
353 set_data_size(data_size() + bytes); 353 set_data_size(data_size() + bytes);
354 set_free_size(free_size() - bytes); 354 set_free_size(free_size() - bytes);
355 available -= bytes; 355 available -= bytes;
356 } 356 }
357 return true; 357 return true;
358 } 358 }
359 359
360 private: 360 private:
361 DISALLOW_COPY_AND_ASSIGN(BufferList); 361 DISALLOW_COPY_AND_ASSIGN(BufferList);
362 }; 362 };
363 #endif // defined(TARGET_OS_ANDROID) ... 363 #endif // defined(HOST_OS_ANDROID) ...
364 364
365 } // namespace bin 365 } // namespace bin
366 } // namespace dart 366 } // namespace dart
367 367
368 #endif // RUNTIME_BIN_PROCESS_H_ 368 #endif // RUNTIME_BIN_PROCESS_H_
OLDNEW
« no previous file with comments | « runtime/bin/platform_win.cc ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698