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

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

Issue 1679643002: nacl_io: Add SOCK_DGRAM support to socketpair() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test failure Created 4 years, 10 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 #ifndef LIBRARIES_NACL_IO_FIFO_CHAR_H_ 5 #ifndef LIBRARIES_NACL_IO_FIFO_CHAR_H_
6 #define LIBRARIES_NACL_IO_FIFO_CHAR_H_ 6 #define LIBRARIES_NACL_IO_FIFO_CHAR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "nacl_io/fifo_interface.h" 10 #include "nacl_io/fifo_interface.h"
(...skipping 16 matching lines...) Expand all
27 27
28 virtual size_t ReadAvailable(); 28 virtual size_t ReadAvailable();
29 virtual size_t WriteAvailable(); 29 virtual size_t WriteAvailable();
30 30
31 // Reads out no more than the requested len without updating the tail. 31 // Reads out no more than the requested len without updating the tail.
32 // Returns actual amount read. 32 // Returns actual amount read.
33 size_t Peek(void* buf, size_t len); 33 size_t Peek(void* buf, size_t len);
34 34
35 // Reads out the data making room in the FIFO. Returns actual amount 35 // Reads out the data making room in the FIFO. Returns actual amount
36 // read. 36 // read.
37 size_t Read(void* buf, size_t len); 37 virtual size_t Read(void* buf, size_t len);
38 38
39 // Writes into the FIFO no more than len bytes, returns actual amount 39 // Writes into the FIFO no more than len bytes, returns actual amount
40 // written. 40 // written.
41 size_t Write(const void* buf, size_t len); 41 virtual size_t Write(const void* buf, size_t len);
42 42
43 private: 43 private:
44 char* buffer_; 44 char* buffer_;
45 size_t size_; // Size of the FIFO 45 size_t size_; // Size of the FIFO
46 size_t avail_; // How much data is currently available 46 size_t avail_; // How much data is currently available
47 size_t tail_; // Next read location 47 size_t tail_; // Next read location
48 48
49 DISALLOW_COPY_AND_ASSIGN(FIFOChar); 49 DISALLOW_COPY_AND_ASSIGN(FIFOChar);
50 }; 50 };
51 51
52 } // namespace nacl_io 52 } // namespace nacl_io
53 53
54 #endif // LIBRARIES_NACL_IO_FIFO_CHAR_H_ 54 #endif // LIBRARIES_NACL_IO_FIFO_CHAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698