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

Side by Side Diff: tests/fake_browser_ppapi/fake_file_io.h

Issue 7292002: Remove plugin connection to PPAPI scriptable objects (var deprecated). Also (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 5 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 | « tests/fake_browser_ppapi/fake_core.cc ('k') | tests/fake_browser_ppapi/fake_file_io.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 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file.
5 */
6
7 #ifndef NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_FILE_IO_H_
8 #define NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_FILE_IO_H_
9
10 #include "native_client/src/include/nacl_macros.h"
11 #include "native_client/src/include/portability_io.h"
12 #include "native_client/tests/fake_browser_ppapi/fake_resource.h"
13 #include "ppapi/c/dev/ppb_file_io_dev.h"
14
15 namespace fake_browser_ppapi {
16
17 // Implements the PPB_FileIO_Dev interface.
18 class FileIO : public Resource {
19 public:
20 explicit FileIO(PP_Instance instance_id)
21 : instance_id_(instance_id), file_desc_(NACL_NO_FILE_DESC) {}
22 ~FileIO() {
23 // This crashes on a Mac with:
24 // Program received signal EXC_BAD_ACCESS, Could not access memory.
25 // Reason: KERN_INVALID_ADDRESS at address: 0x00235e0e
26 #if !defined(NACL_OSX)
27 CLOSE(file_desc_);
28 #endif
29 }
30
31 FileIO* AsFileIO() { return this; }
32
33 void set_file_desc(int32_t file_desc) { file_desc_ = file_desc; }
34 int32_t file_desc() const { return file_desc_; }
35
36 // Return an interface pointer usable by PPAPI.
37 static const PPB_FileIO_Dev* GetInterface();
38
39 private:
40 PP_Instance instance_id_;
41 int32_t file_desc_;
42
43 NACL_DISALLOW_COPY_AND_ASSIGN(FileIO);
44 };
45
46 } // namespace fake_browser_ppapi
47
48 #endif // NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_FILE_IO_H_
OLDNEW
« no previous file with comments | « tests/fake_browser_ppapi/fake_core.cc ('k') | tests/fake_browser_ppapi/fake_file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698