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

Side by Side Diff: examples/terminal/terminal_file_impl.dart

Issue 1055403002: Add an Ioctl() message to the File interface. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 8 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 | « no previous file | mojo/services/files/public/interfaces/file.mojom » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:core'; 6 import 'dart:core';
7 import 'package:mojo/public/dart/core.dart'; 7 import 'package:mojo/public/dart/core.dart';
8 import 'package:mojo/services/files/public/interfaces/file.mojom.dart' as files; 8 import 'package:mojo/services/files/public/interfaces/file.mojom.dart' as files;
9 import 'package:mojo/services/files/public/interfaces/types.mojom.dart' as files ; 9 import 'package:mojo/services/files/public/interfaces/types.mojom.dart'
10 as files;
10 11
11 import 'terminal_display.dart'; 12 import 'terminal_display.dart';
12 13
13 // This implements a |mojo.files.File| that acts like a (pseudo)terminal. Bytes 14 // This implements a |mojo.files.File| that acts like a (pseudo)terminal. Bytes
14 // written to the |File| will be read by this implementation and passed on to 15 // written to the |File| will be read by this implementation and passed on to
15 // the (Dart) |TerminalDisplay| (using |putChar()|). A read from the |File| will 16 // the (Dart) |TerminalDisplay| (using |putChar()|). A read from the |File| will
16 // be completed if/when |TerminalDisplay| makes a byte available (via 17 // be completed if/when |TerminalDisplay| makes a byte available (via
17 // |getChar()|). 18 // |getChar()|).
18 // TODO(vtl): This implementation is very incomplete. 19 // TODO(vtl): This implementation is very incomplete.
19 class TerminalFileImpl implements files.File { 20 class TerminalFileImpl implements files.File {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Future reopen(Object file, int openFlags, Function responseFactory) async { 115 Future reopen(Object file, int openFlags, Function responseFactory) async {
115 // TODO(vtl) 116 // TODO(vtl)
116 return responseFactory(files.Error_UNIMPLEMENTED); 117 return responseFactory(files.Error_UNIMPLEMENTED);
117 } 118 }
118 119
119 @override 120 @override
120 Future asBuffer(Function responseFactory) async { 121 Future asBuffer(Function responseFactory) async {
121 // TODO(vtl) 122 // TODO(vtl)
122 return responseFactory(files.Error_UNIMPLEMENTED, null); 123 return responseFactory(files.Error_UNIMPLEMENTED, null);
123 } 124 }
125
126 @override
127 Future ioctl(
128 int request, List<int> in_values, Function responseFactory) async {
129 // TODO(vtl)
130 return responseFactory(files.Error_UNIMPLEMENTED, null);
131 }
124 } 132 }
OLDNEW
« no previous file with comments | « no previous file | mojo/services/files/public/interfaces/file.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698