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

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

Issue 163903002: Prototype of I/O statistics for Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
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_EVENTHANDLER_LINUX_H_ 5 #ifndef BIN_EVENTHANDLER_LINUX_H_
6 #define BIN_EVENTHANDLER_LINUX_H_ 6 #define BIN_EVENTHANDLER_LINUX_H_
7 7
8 #if !defined(BIN_EVENTHANDLER_H_) 8 #if !defined(BIN_EVENTHANDLER_H_)
9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. 9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead.
10 #endif 10 #endif
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void ShutdownWrite() { 50 void ShutdownWrite() {
51 shutdown(fd_, SHUT_WR); 51 shutdown(fd_, SHUT_WR);
52 MarkClosedWrite(); 52 MarkClosedWrite();
53 } 53 }
54 54
55 void Close() { 55 void Close() {
56 port_ = 0; 56 port_ = 0;
57 mask_ = 0; 57 mask_ = 0;
58 flags_ = 0; 58 flags_ = 0;
59 close(fd_); 59 Socket::Close(fd_);
60 fd_ = -1; 60 fd_ = -1;
61 } 61 }
62 62
63 bool IsListeningSocket() { return (mask_ & (1 << kListeningSocket)) != 0; } 63 bool IsListeningSocket() { return (mask_ & (1 << kListeningSocket)) != 0; }
64 bool IsPipe() { return (mask_ & (1 << kPipe)) != 0; } 64 bool IsPipe() { return (mask_ & (1 << kPipe)) != 0; }
65 bool IsClosedRead() { return (flags_ & (1 << kClosedRead)) != 0; } 65 bool IsClosedRead() { return (flags_ & (1 << kClosedRead)) != 0; }
66 bool IsClosedWrite() { return (flags_ & (1 << kClosedWrite)) != 0; } 66 bool IsClosedWrite() { return (flags_ & (1 << kClosedWrite)) != 0; }
67 67
68 void MarkClosedRead() { flags_ |= (1 << kClosedRead); } 68 void MarkClosedRead() { flags_ |= (1 << kClosedRead); }
69 void MarkClosedWrite() { flags_ |= (1 << kClosedWrite); } 69 void MarkClosedWrite() { flags_ |= (1 << kClosedWrite); }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 bool shutdown_; 116 bool shutdown_;
117 int interrupt_fds_[2]; 117 int interrupt_fds_[2];
118 int epoll_fd_; 118 int epoll_fd_;
119 int timer_fd_; 119 int timer_fd_;
120 }; 120 };
121 121
122 } // namespace bin 122 } // namespace bin
123 } // namespace dart 123 } // namespace dart
124 124
125 #endif // BIN_EVENTHANDLER_LINUX_H_ 125 #endif // BIN_EVENTHANDLER_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698