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

Unified Diff: native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.h

Issue 1679643002: nacl_io: Add SOCK_DGRAM support to socketpair() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review feedback 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.h
diff --git a/native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.h b/native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.h
index e8ba0b3c38423237b694f48c92e6c489cd534d0b..30a25a90f058640194c805c6f35876fa5213e94a 100644
--- a/native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.h
+++ b/native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.h
@@ -5,6 +5,7 @@
#ifndef LIBRARIES_NACL_IO_FIFO_PACKET_H_
#define LIBRARIES_NACL_IO_FIFO_PACKET_H_
+#include <stdint.h>
#include <string.h>
#include <list>
@@ -45,6 +46,12 @@ class FIFOPacket : public FIFOInterface {
// Take ownership of packet and place it in the FIFO.
void WritePacket(Packet* packet);
+ // Read out the top packet into a byte buffer.
+ size_t Read(void* buf, size_t len);
+
+ // Enqueue a new packet from a byte buffer.
+ size_t Write(const void* buf, size_t len);
+
private:
std::list<Packet*> packets_;
uint32_t max_bytes_;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc ('k') | native_client_sdk/src/libraries/nacl_io/socket/fifo_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698