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

Unified Diff: native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h
diff --git a/native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h b/native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h
new file mode 100644
index 0000000000000000000000000000000000000000..02d64a4e90086625969cfc3c50216fe9d2ce258b
--- /dev/null
+++ b/native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef LIBRARIES_NACL_IO_EVENT_EMITTER_UDP_H_
+#define LIBRARIES_NACL_IO_EVENT_EMITTER_UDP_H_
+
+#include "nacl_io/event_emitter_stream.h"
+#include "nacl_io/fifo_packet.h"
+
+#include "sdk_util/macros.h"
+#include "sdk_util/scoped_ref.h"
+
+namespace nacl_io {
+
+class EventEmitterUDP;
+typedef sdk_util::ScopedRef<EventEmitterUDP> ScopedEventEmitterUDP;
+
+class EventEmitterUDP : public EventEmitterStream {
+ public:
+ EventEmitterUDP(size_t rsize, size_t wsize);
+
+ // Takes or gives away ownership of the packet.
+ Packet* ReadRXPacket_Locked();
+ void WriteRXPacket_Locked(Packet* packet);
+
+ Packet* ReadTXPacket_Locked();
+ void WriteTXPacket_Locked(Packet* packet);
+
+ virtual FIFOPacket* in_fifo() { return &in_fifo_; }
+ virtual FIFOPacket* out_fifo() { return &out_fifo_; }
+
+protected:
+ FIFOPacket in_fifo_;
+ FIFOPacket out_fifo_;
+ DISALLOW_COPY_AND_ASSIGN(EventEmitterUDP);
+};
+
+} // namespace nacl_io
+
+#endif // LIBRARIES_NACL_IO_EVENT_EMITTER_UDP_H_
+

Powered by Google App Engine
This is Rietveld 408576698