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

Side by Side Diff: lib/io/system.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, 5 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 | « lib/ffi/ffi.dart ('k') | lib/io/system_linux.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) 2014, the Fletch project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Fletch 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library system; 5 library system;
6 6
7 import 'dart:ffi'; 7 import 'dart:ffi';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:typed_data'; 9 import 'dart:typed_data';
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 int setBlocking(int fd, bool blocking); 81 int setBlocking(int fd, bool blocking);
82 int setReuseaddr(int fd); 82 int setReuseaddr(int fd);
83 83
84 static int eventHandler = _getEventHandler(); 84 static int eventHandler = _getEventHandler();
85 @fletch.native external static int _getEventHandler(); 85 @fletch.native external static int _getEventHandler();
86 @fletch.native external static int _incrementPortRef(Port port); 86 @fletch.native external static int _incrementPortRef(Port port);
87 } 87 }
88 88
89 final int hostWordSize = Foreign.bitsPerMachineWord ~/ 8; 89 final int hostWordSize = Foreign.bitsPerMachineWord ~/ 8;
90 90
91 class Struct extends Foreign { 91 class Struct extends ForeignMemory {
92 final wordSize; 92 final wordSize;
93 93
94 Struct(int fields) 94 Struct(int fields)
95 : this.wordSize = hostWordSize, 95 : this.wordSize = hostWordSize,
96 super.allocated(fields * hostWordSize); 96 super.allocated(fields * hostWordSize);
97 97
98 Struct.finalize(int fields) 98 Struct.finalize(int fields)
99 : this.wordSize = hostWordSize, 99 : this.wordSize = hostWordSize,
100 super.allocatedFinalize(fields * hostWordSize); 100 super.allocatedFinalize(fields * hostWordSize);
101 101
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 class Struct64 extends Struct { 141 class Struct64 extends Struct {
142 Struct64(int fields) : super.withWordSize(fields, 8); 142 Struct64(int fields) : super.withWordSize(fields, 8);
143 Struct64.finalize(int fields) : super.withWordSizeFinalize(fields, 8); 143 Struct64.finalize(int fields) : super.withWordSizeFinalize(fields, 8);
144 } 144 }
145 145
146 class _InternetAddress extends InternetAddress { 146 class _InternetAddress extends InternetAddress {
147 final List<int> _bytes; 147 final List<int> _bytes;
148 _InternetAddress(this._bytes); 148 _InternetAddress(this._bytes);
149 } 149 }
OLDNEW
« no previous file with comments | « lib/ffi/ffi.dart ('k') | lib/io/system_linux.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698