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

Side by Side Diff: tests/fake_browser_ppapi/fake_file_ref.cc

Issue 6218004: Resource64->32, NaCl side. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: First Created 9 years, 11 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
1 /* 1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved. 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 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 #include "native_client/tests/fake_browser_ppapi/fake_file_ref.h" 7 #include "native_client/tests/fake_browser_ppapi/fake_file_ref.h"
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 10
11 #include "native_client/src/include/nacl_macros.h" 11 #include "native_client/src/include/nacl_macros.h"
12 #include "native_client/src/include/portability.h" 12 #include "native_client/src/include/portability.h"
13 13
14 #include "native_client/tests/fake_browser_ppapi/fake_resource.h" 14 #include "native_client/tests/fake_browser_ppapi/fake_resource.h"
15 #include "native_client/tests/fake_browser_ppapi/utility.h" 15 #include "native_client/tests/fake_browser_ppapi/utility.h"
16 16
17 #include "ppapi/c/pp_errors.h" 17 #include "ppapi/c/pp_errors.h"
18 #include "ppapi/c/pp_completion_callback.h" 18 #include "ppapi/c/pp_completion_callback.h"
19 #include "ppapi/c/pp_resource.h" 19 #include "ppapi/c/pp_resource.h"
20 20
21 using fake_browser_ppapi::DebugPrintf; 21 using fake_browser_ppapi::DebugPrintf;
22 22
23 namespace fake_browser_ppapi { 23 namespace fake_browser_ppapi {
24 24
25 namespace { 25 namespace {
26 26
27 PP_Resource Create(PP_Resource file_system_id, 27 PP_Resource Create(PP_Resource file_system_id,
28 const char* path) { 28 const char* path) {
29 DebugPrintf("FileRef::Create: file_system_id=%"NACL_PRId64" path=%s\n", 29 DebugPrintf("FileRef::Create: file_system_id=%"NACL_PRId32" path=%s\n",
30 file_system_id, path); 30 file_system_id, path);
31 NACL_UNIMPLEMENTED(); 31 NACL_UNIMPLEMENTED();
32 return Resource::Invalid()->resource_id(); 32 return Resource::Invalid()->resource_id();
33 } 33 }
34 34
35 PP_Bool IsFileRef(PP_Resource resource_id) { 35 PP_Bool IsFileRef(PP_Resource resource_id) {
36 DebugPrintf("FileRef::IsFileRef: resource_id=%"NACL_PRId64"\n", resource_id); 36 DebugPrintf("FileRef::IsFileRef: resource_id=%"NACL_PRId32"\n", resource_id);
37 NACL_UNIMPLEMENTED(); 37 NACL_UNIMPLEMENTED();
38 return PP_FALSE; 38 return PP_FALSE;
39 } 39 }
40 40
41 PP_FileSystemType_Dev GetFileSystemType(PP_Resource file_ref_id) { 41 PP_FileSystemType_Dev GetFileSystemType(PP_Resource file_ref_id) {
42 DebugPrintf("FileRef::GetFileSystemType: file_ref_id=%"NACL_PRId64"\n", 42 DebugPrintf("FileRef::GetFileSystemType: file_ref_id=%"NACL_PRId32"\n",
43 file_ref_id); 43 file_ref_id);
44 NACL_UNIMPLEMENTED(); 44 NACL_UNIMPLEMENTED();
45 return PP_FILESYSTEMTYPE_EXTERNAL; 45 return PP_FILESYSTEMTYPE_EXTERNAL;
46 } 46 }
47 47
48 PP_Var GetName(PP_Resource file_ref_id) { 48 PP_Var GetName(PP_Resource file_ref_id) {
49 DebugPrintf("FileRef::GetName: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 49 DebugPrintf("FileRef::GetName: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
50 NACL_UNIMPLEMENTED(); 50 NACL_UNIMPLEMENTED();
51 return PP_MakeUndefined(); 51 return PP_MakeUndefined();
52 } 52 }
53 53
54 PP_Var GetPath(PP_Resource file_ref_id) { 54 PP_Var GetPath(PP_Resource file_ref_id) {
55 DebugPrintf("FileRef::GetPath: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 55 DebugPrintf("FileRef::GetPath: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
56 NACL_UNIMPLEMENTED(); 56 NACL_UNIMPLEMENTED();
57 return PP_MakeUndefined(); 57 return PP_MakeUndefined();
58 } 58 }
59 59
60 PP_Resource GetParent(PP_Resource file_ref_id) { 60 PP_Resource GetParent(PP_Resource file_ref_id) {
61 DebugPrintf("FileRef::GetParent: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 61 DebugPrintf("FileRef::GetParent: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
62 NACL_UNIMPLEMENTED(); 62 NACL_UNIMPLEMENTED();
63 return Resource::Invalid()->resource_id(); 63 return Resource::Invalid()->resource_id();
64 } 64 }
65 65
66 int32_t MakeDirectory(PP_Resource directory_ref_id, 66 int32_t MakeDirectory(PP_Resource directory_ref_id,
67 PP_Bool make_ancestors, 67 PP_Bool make_ancestors,
68 struct PP_CompletionCallback callback) { 68 struct PP_CompletionCallback callback) {
69 DebugPrintf("FileRef::MakDirectory: directory_ref_id=%"NACL_PRId64"\n", 69 DebugPrintf("FileRef::MakDirectory: directory_ref_id=%"NACL_PRId32"\n",
70 directory_ref_id); 70 directory_ref_id);
71 UNREFERENCED_PARAMETER(make_ancestors); 71 UNREFERENCED_PARAMETER(make_ancestors);
72 UNREFERENCED_PARAMETER(callback); 72 UNREFERENCED_PARAMETER(callback);
73 NACL_UNIMPLEMENTED(); 73 NACL_UNIMPLEMENTED();
74 return PP_ERROR_BADRESOURCE; 74 return PP_ERROR_BADRESOURCE;
75 } 75 }
76 76
77 int32_t Query(PP_Resource file_ref_id, 77 int32_t Query(PP_Resource file_ref_id,
78 struct PP_FileInfo_Dev* info, 78 struct PP_FileInfo_Dev* info,
79 struct PP_CompletionCallback callback) { 79 struct PP_CompletionCallback callback) {
80 DebugPrintf("FileRef::Query: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 80 DebugPrintf("FileRef::Query: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
81 UNREFERENCED_PARAMETER(info); 81 UNREFERENCED_PARAMETER(info);
82 UNREFERENCED_PARAMETER(callback); 82 UNREFERENCED_PARAMETER(callback);
83 NACL_UNIMPLEMENTED(); 83 NACL_UNIMPLEMENTED();
84 return 0; 84 return 0;
85 } 85 }
86 86
87 int32_t Touch(PP_Resource file_ref_id, 87 int32_t Touch(PP_Resource file_ref_id,
88 PP_Time last_access_time, 88 PP_Time last_access_time,
89 PP_Time last_modified_time, 89 PP_Time last_modified_time,
90 struct PP_CompletionCallback callback) { 90 struct PP_CompletionCallback callback) {
91 DebugPrintf("FileRef::Touch: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 91 DebugPrintf("FileRef::Touch: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
92 UNREFERENCED_PARAMETER(last_access_time); 92 UNREFERENCED_PARAMETER(last_access_time);
93 UNREFERENCED_PARAMETER(last_modified_time); 93 UNREFERENCED_PARAMETER(last_modified_time);
94 UNREFERENCED_PARAMETER(callback); 94 UNREFERENCED_PARAMETER(callback);
95 NACL_UNIMPLEMENTED(); 95 NACL_UNIMPLEMENTED();
96 return PP_ERROR_BADRESOURCE; 96 return PP_ERROR_BADRESOURCE;
97 } 97 }
98 98
99 int32_t Delete(PP_Resource file_ref_id, 99 int32_t Delete(PP_Resource file_ref_id,
100 struct PP_CompletionCallback callback) { 100 struct PP_CompletionCallback callback) {
101 DebugPrintf("FileRef::Delete: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 101 DebugPrintf("FileRef::Delete: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
102 UNREFERENCED_PARAMETER(callback); 102 UNREFERENCED_PARAMETER(callback);
103 NACL_UNIMPLEMENTED(); 103 NACL_UNIMPLEMENTED();
104 return PP_ERROR_BADRESOURCE; 104 return PP_ERROR_BADRESOURCE;
105 } 105 }
106 106
107 int32_t Rename(PP_Resource file_ref_id, 107 int32_t Rename(PP_Resource file_ref_id,
108 PP_Resource new_file_ref, 108 PP_Resource new_file_ref,
109 struct PP_CompletionCallback callback) { 109 struct PP_CompletionCallback callback) {
110 DebugPrintf("FileRef::Rename: file_ref_id=%"NACL_PRId64"\n", file_ref_id); 110 DebugPrintf("FileRef::Rename: file_ref_id=%"NACL_PRId32"\n", file_ref_id);
111 UNREFERENCED_PARAMETER(new_file_ref); 111 UNREFERENCED_PARAMETER(new_file_ref);
112 UNREFERENCED_PARAMETER(callback); 112 UNREFERENCED_PARAMETER(callback);
113 NACL_UNIMPLEMENTED(); 113 NACL_UNIMPLEMENTED();
114 return PP_ERROR_BADRESOURCE; 114 return PP_ERROR_BADRESOURCE;
115 } 115 }
116 116
117 } // namespace 117 } // namespace
118 118
119 119
120 const PPB_FileRef_Dev* FileRef::GetInterface() { 120 const PPB_FileRef_Dev* FileRef::GetInterface() {
121 static const PPB_FileRef_Dev file_ref_interface = { 121 static const PPB_FileRef_Dev file_ref_interface = {
122 Create, 122 Create,
123 IsFileRef, 123 IsFileRef,
124 GetFileSystemType, 124 GetFileSystemType,
125 GetName, 125 GetName,
126 GetPath, 126 GetPath,
127 GetParent, 127 GetParent,
128 MakeDirectory, 128 MakeDirectory,
129 Query, 129 Query,
130 Touch, 130 Touch,
131 Delete, 131 Delete,
132 Rename 132 Rename
133 }; 133 };
134 return &file_ref_interface; 134 return &file_ref_interface;
135 } 135 }
136 136
137 } // namespace fake_browser_ppapi 137 } // namespace fake_browser_ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698