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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/packet.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 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_PACKET_H_
6 #define LIBRARIES_NACL_IO_PACKET_H_
7
8 #include <string.h>
9
10 #include <list>
11 #include <vector>
binji 2013/09/19 00:48:55 remove unneeded headers
noelallen1 2013/09/19 21:29:27 Done.
12
13 #include "nacl_io/fifo_interface.h"
14 #include "ppapi/c/pp_resource.h"
15
16 #include "sdk_util/macros.h"
17
18 namespace nacl_io {
19
20 class PepperInterface;
21
22 // NOTE: The Packet class always owns the buffer and address, either by 'Copy'
23 // or by 'Take' ownership.
24 class Packet {
25 public:
26 explicit Packet(PepperInterface* ppapi);
27 ~Packet();
28
29 // Copy the buffer, and address reference
30 void Copy(const void *buffer, size_t len, PP_Resource addr);
binji 2013/09/19 00:48:55 turn this into an alternate constructor?
noelallen1 2013/09/20 00:51:27 Going to circle back on this.
31
32 // Take ownership the buffer, and address reference
33 void Take(const void *buffer, size_t len, PP_Resource addr);
binji 2013/09/19 00:48:55 unused. Remove?
noelallen1 2013/09/19 21:29:27 I was using this... I'll dbl check and remote. Or
34
35 char* buffer() { return buffer_; }
36 PP_Resource addr() { return addr_; }
37 size_t len() { return len_; }
38
39 private:
40 PepperInterface* ppapi_;
41 PP_Resource addr_;
42 char* buffer_;
43 size_t len_;
44
45 DISALLOW_COPY_AND_ASSIGN(Packet);
46 };
47
48 } // namespace nacl_io
49
50 #endif // LIBRARIES_NACL_IO_PACKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698