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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/socket/unix_event_emitter.h

Issue 1335783005: [NaCl SDK] nacl_io: Add support for basic socketpairs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
(Empty)
1
binji 2015/09/17 01:03:58 missing line?
avallee 2015/09/17 19:00:31 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef LIBRARIES_NACL_IO_SOCKET_UNIX_EVENT_EMITTER_H_
6 #define LIBRARIES_NACL_IO_SOCKET_UNIX_EVENT_EMITTER_H_
7
8 #include "nacl_io/fifo_char.h"
9 #include "nacl_io/stream/stream_event_emitter.h"
10
11 #include "sdk_util/macros.h"
12 #include "sdk_util/scoped_ref.h"
13 #include "sdk_util/simple_lock.h"
14
15 namespace nacl_io {
16
17 class UnixEventEmitter;
18 class Node;
19
20 typedef sdk_util::ScopedRef<UnixEventEmitter> ScopedUnixEventEmitter;
21
22 class UnixEventEmitter : public StreamEventEmitter {
23 public:
24 uint32_t ReadIn_Locked(char* buffer, uint32_t len);
25 uint32_t WriteOut_Locked(const char* buffer, uint32_t len);
26
27 // bool GetError_Locked();
binji 2015/09/17 01:03:58 remove
avallee 2015/09/17 19:00:31 Done.
28 // void SetError_Locked();
29 // void UpdateStatus_Locked();
30 // void SetRecvEndOfStream_Locked();
31
32 uint32_t BytesInOutputFIFO();
33 uint32_t SpaceInInputFIFO();
34
35 virtual ScopedUnixEventEmitter GetPeerEmitter() = 0;
36
37 static ScopedUnixEventEmitter MakeUnixEventEmitter(size_t size);
38
39 protected:
40 UnixEventEmitter() {}
41
42 // Probably only need the master's lock.
43 virtual const sdk_util::SimpleLock& GetFifoLock() = 0;
44 virtual FIFOInterface* in_fifo() { return in_fifoc(); }
45 virtual FIFOInterface* out_fifo() { return out_fifoc(); }
46 virtual FIFOChar* in_fifoc() = 0;
47 virtual FIFOChar* out_fifoc() = 0;
48
49 private:
50 DISALLOW_COPY_AND_ASSIGN(UnixEventEmitter);
51 };
52
53 } // namespace nacl_io
54
55 #endif // LIBRARIES_NACL_IO_SOCKET_UNIX_EVENT_EMITTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698