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

Side by Side Diff: libraries/nacl-mounts/dev/RandomDevice.h

Issue 10377102: Added simplest device mount implementation (includes NullDevice and RandomDevice) (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « libraries/nacl-mounts/dev/NullDevice.cc ('k') | libraries/nacl-mounts/dev/RandomDevice.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_DEV_RANDOMDEVICE_H_
7 #define PACKAGES_LIBRARIES_NACL_MOUNTS_DEV_RANDOMDEVICE_H_
8
9 #include "../dev/Device.h"
10
11 // RandomDevice
12 class RandomDevice : public Device {
13 public:
14 RandomDevice(int (*get_random_bytes)(void *buf, size_t count, size_t *nread))
15 : get_random_bytes_(get_random_bytes) {}
16 virtual ~RandomDevice() {}
17 int Read(off_t offset, void *buf, size_t count);
18 int Write(off_t offset, const void *buf, size_t count);
19 private:
20 int (*get_random_bytes_)(void *buf, size_t count, size_t *nread);
21
22 DISALLOW_COPY_AND_ASSIGN(RandomDevice);
23 };
24
25 #endif
26
OLDNEW
« no previous file with comments | « libraries/nacl-mounts/dev/NullDevice.cc ('k') | libraries/nacl-mounts/dev/RandomDevice.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698