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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/event_emitter_tty.cc

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 7 years, 3 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <poll.h>
6 #include <stdint.h>
7 #include <stdlib.h>
8
9 #include "nacl_io/event_emitter_tty.h"
10
11 namespace nacl_io {
12
13 EventEmitterTTY::EventEmitterTTY(size_t size)
14 : fifo_(std::max<size_t>(1, size)) {
15 UpdateStatus_Locked();
16 }
17
18 size_t EventEmitterPipe::Read_Locked(char* data, size_t len) {
19 size_t out_len = fifo_.Read(data, len);
20
21 UpdateStatus_Locked();
22 return out_len;
23 }
24
25 size_t EventEmitterPipe::Write_Locked(const char* data, size_t len) {
26 size_t out_len = fifo_.Write(data, len);
27
28 UpdateStatus_Locked();
29 return out_len;
30 }
31
32 } // namespace nacl_io
33
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698