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

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

Issue 296403005: Show actualy FD for files in Observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add dart2js patch function. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('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 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include <fcntl.h> // NOLINT 10 #include <fcntl.h> // NOLINT
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } else { 52 } else {
53 int err = close(handle_->fd()); 53 int err = close(handle_->fd());
54 if (err != 0) { 54 if (err != 0) {
55 Log::PrintErr("%s\n", strerror(errno)); 55 Log::PrintErr("%s\n", strerror(errno));
56 } 56 }
57 } 57 }
58 handle_->set_fd(kClosedFd); 58 handle_->set_fd(kClosedFd);
59 } 59 }
60 60
61 61
62 intptr_t File::GetFD() {
63 return handle_->fd();
64 }
65
66
62 bool File::IsClosed() { 67 bool File::IsClosed() {
63 return handle_->fd() == kClosedFd; 68 return handle_->fd() == kClosedFd;
64 } 69 }
65 70
66 71
67 int64_t File::Read(void* buffer, int64_t num_bytes) { 72 int64_t File::Read(void* buffer, int64_t num_bytes) {
68 ASSERT(handle_->fd() >= 0); 73 ASSERT(handle_->fd() >= 0);
69 return read(handle_->fd(), buffer, num_bytes); 74 return read(handle_->fd(), buffer, num_bytes);
70 } 75 }
71 76
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 return kIdentical; 646 return kIdentical;
642 } else { 647 } else {
643 return kDifferent; 648 return kDifferent;
644 } 649 }
645 } 650 }
646 651
647 } // namespace bin 652 } // namespace bin
648 } // namespace dart 653 } // namespace dart
649 654
650 #endif // defined(TARGET_OS_WINDOWS) 655 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698