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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/mount_node_stream.h

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Fifo Tests 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 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_STREAM_H_
6 #define LIBRARIES_NACL_IO_MOUNT_NODE_STREAM_H_
7
8 #include <map>
9 #include <string>
10
11 #include "nacl_io/event_emitter_pipe.h"
12 #include "nacl_io/mount_node.h"
13 #include "sdk_util/atomicops.h"
14
15 namespace nacl_io {
16
17 class MountNodeStream;
18 class MountStream;
19
20 typedef sdk_util::ScopedRef<MountNodeStream> ScopedMountNodeStream;
21
22 enum StreamStateFlags {
23 SSF_CONNECTING = 0x0001,
24 SSF_SENDING = 0x0002,
25 SSF_RECVING = 0x0004,
26 SSF_NON_BLOCK = 0x1000,
27 SSF_CLOSING = 0x4000,
28 SSF_CLOSED = 0x8000
29 };
30
31
32 class MountNodeStream : public MountNode {
33 public:
34 explicit MountNodeStream(Mount* mnt);
35
36 virtual Error Init(int perm);
37
38 // Attempts to pump input and output
39 virtual void QueueInput();
40 virtual void QueueOutput();
41
42 void SetStreamFlags(uint32_t bits);
43 void ClearStreamFlags(uint32_t bits);
44 uint32_t GetStreamFlags();
45
46 MountStream* mount_stream();
47
48 protected:
49 int read_timeout_;
50 int write_timeout_;
51
52 private:
53 sdk_util::Atomic32 stream_state_flags_;
54 };
55
56 } // namespace nacl_io
57
58 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698