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

Side by Side Diff: apps/moterm/moterm_driver.h

Issue 1363183004: Files services library: Add an "output stream" file impl helper class. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: files_impl Created 5 years, 2 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 | apps/moterm/moterm_driver.cc » ('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 // |MotermDriver| is a class providing a |mojo.files.File| interface, 5 // |MotermDriver| is a class providing a |mojo.files.File| interface,
6 // implementing termios-type features (e.g., line editing; TODO(vtl): lots to do 6 // implementing termios-type features (e.g., line editing; TODO(vtl): lots to do
7 // here), and appropriately processing bytes to/from the terminal (which gets 7 // here), and appropriately processing bytes to/from the terminal (which gets
8 // and sends "raw" data). In essence, this class includes what would 8 // and sends "raw" data). In essence, this class includes what would
9 // traditionally be called the terminal driver in a Unix kernel. 9 // traditionally be called the terminal driver in a Unix kernel.
10 10
(...skipping 21 matching lines...) Expand all
32 // closed or otherwise "broken"). 32 // closed or otherwise "broken").
33 class Client { 33 class Client {
34 public: 34 public:
35 // Called when we receive data (for the client to "display"). 35 // Called when we receive data (for the client to "display").
36 // TODO(vtl): Maybe add a way to throttle (e.g., for the client to not 36 // TODO(vtl): Maybe add a way to throttle (e.g., for the client to not
37 // accept all the data). 37 // accept all the data).
38 // TODO(vtl): It's "probably OK" to call |Detach()| from inside this method, 38 // TODO(vtl): It's "probably OK" to call |Detach()| from inside this method,
39 // but not verified. 39 // but not verified.
40 virtual void OnDataReceived(const void* bytes, size_t num_bytes) = 0; 40 virtual void OnDataReceived(const void* bytes, size_t num_bytes) = 0;
41 41
42 // Called when the terminal "file" is closed (via |Close()|. (The client may 42 // Called when the terminal "file" is closed (via |Close()|). (The client
43 // optionally call |Detach()| in response.) 43 // may optionally call |Detach()| in response.)
44 virtual void OnClosed() = 0; 44 virtual void OnClosed() = 0;
45 45
46 // Called when this object is destroyed (which will happen if the other end 46 // Called when this object is destroyed (which will happen if the other end
47 // of the message pipe is closed). The client must not call |Detach()| in 47 // of the message pipe is closed). The client must not call |Detach()| in
48 // response. (Obviously, this will only be called if the client has not 48 // response. (Obviously, this will only be called if the client has not
49 // called |Detach()|.) 49 // called |Detach()|.)
50 virtual void OnDestroyed() = 0; 50 virtual void OnDestroyed() = 0;
51 }; 51 };
52 52
53 // Static factory method. |client| must either outlive us, or if not call 53 // Static factory method. |client| must either outlive us, or if not call
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // Output settings: 168 // Output settings:
169 // If true, will convert output CRs to CR-NL pairs. 169 // If true, will convert output CRs to CR-NL pairs.
170 bool onlcr_; 170 bool onlcr_;
171 171
172 base::WeakPtrFactory<MotermDriver> weak_factory_; 172 base::WeakPtrFactory<MotermDriver> weak_factory_;
173 173
174 DISALLOW_COPY_AND_ASSIGN(MotermDriver); 174 DISALLOW_COPY_AND_ASSIGN(MotermDriver);
175 }; 175 };
176 176
177 #endif // APPS_MOTERM_MOTERM_DRIVER_H_ 177 #endif // APPS_MOTERM_MOTERM_DRIVER_H_
OLDNEW
« no previous file with comments | « no previous file | apps/moterm/moterm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698