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

Unified Diff: lib/io/system_linux.dart

Issue 1209033003: Work in progres, please take a look and give early feedback if this is the way we want to structure… (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: address comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/io/system.dart ('k') | lib/io/system_macos.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/io/system_linux.dart
diff --git a/lib/io/system_linux.dart b/lib/io/system_linux.dart
index 95cf24c837fbc6971f46f598b06ae74dc3ad9b27..2c5ddb2c20fbc31596d1dd66fe661582baa80840 100644
--- a/lib/io/system_linux.dart
+++ b/lib/io/system_linux.dart
@@ -19,9 +19,9 @@ class LinuxAddrInfo extends AddrInfo {
LinuxAddrInfo() : super._();
LinuxAddrInfo.fromAddress(int address) : super._fromAddress(address);
- Foreign get ai_addr {
+ ForeignMemory get ai_addr {
int offset = _addrlenOffset + wordSize;
- return new Foreign.fromAddress(getWord(offset), ai_addrlen);
+ return new ForeignMemory.fromAddress(getWord(offset), ai_addrlen);
}
get ai_canonname {
@@ -35,7 +35,7 @@ class LinuxAddrInfo extends AddrInfo {
}
}
-class EpollEvent extends Foreign {
+class EpollEvent extends ForeignMemory {
// epoll_event is packed on ia32/x64, but not on arm.
static int eventSize = Foreign.architecture == Foreign.ARM ? 8 : 4;
@@ -53,9 +53,12 @@ class EpollEvent extends Foreign {
}
class LinuxSystem extends PosixSystem {
- static final Foreign _epollCtl = Foreign.lookup("epoll_ctl");
- static final Foreign _lseekLinux = Foreign.lookup("lseek64");
- static final Foreign _openLinux = Foreign.lookup("open64");
+ static final ForeignFunction _epollCtl =
+ ForeignLibrary.main.lookup("epoll_ctl");
+ static final ForeignFunction _lseekLinux =
+ ForeignLibrary.main.lookup("lseek64");
+ static final ForeignFunction _openLinux =
+ ForeignLibrary.main.lookup("open64");
final EpollEvent _epollEvent = new EpollEvent();
@@ -65,8 +68,8 @@ class LinuxSystem extends PosixSystem {
int get SO_REUSEADDR => 2;
- Foreign get _lseek => _lseekLinux;
- Foreign get _open => _openLinux;
+ ForeignFunction get _lseek => _lseekLinux;
+ ForeignFunction get _open => _openLinux;
int addToEventHandler(int fd) {
_epollEvent.events = 0;
@@ -79,7 +82,8 @@ class LinuxSystem extends PosixSystem {
// TODO(ajohnsen): If we increased the refcount of the port before adding it
// to the epoll set and we remove it now, we can leak memory.
int eh = System.eventHandler;
- return _retry(() => _epollCtl.icall$4(eh, EPOLL_CTL_DEL, fd, Foreign.NULL));
+ return _retry(() => _epollCtl.icall$4(eh, EPOLL_CTL_DEL, fd,
+ ForeignPointer.NULL));
}
int setPortForNextEvent(int fd, Port port, int mask) {
« no previous file with comments | « lib/io/system.dart ('k') | lib/io/system_macos.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698