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

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 // Copyright 2015 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 #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 uint32_t BytesInOutputFIFO();
28 uint32_t SpaceInInputFIFO();
29
30 virtual ScopedUnixEventEmitter GetPeerEmitter() = 0;
31
32 static ScopedUnixEventEmitter MakeUnixEventEmitter(size_t size);
33
34 protected:
35 UnixEventEmitter() {}
36
37 // Probably only need the master's lock.
38 virtual const sdk_util::SimpleLock& GetFifoLock() = 0;
39 virtual FIFOInterface* in_fifo() { return in_fifoc(); }
40 virtual FIFOInterface* out_fifo() { return out_fifoc(); }
41 virtual FIFOChar* in_fifoc() = 0;
42 virtual FIFOChar* out_fifoc() = 0;
43
44 private:
45 DISALLOW_COPY_AND_ASSIGN(UnixEventEmitter);
46 };
47
48 } // namespace nacl_io
49
50 #endif // LIBRARIES_NACL_IO_SOCKET_UNIX_EVENT_EMITTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698