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

Side by Side Diff: ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc

Issue 10534045: Add CreateTemporaryFile to PPB_Flash_File_ModuleLocal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 | « ppapi/thunk/ppb_flash_api.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/c/pp_errors.h" 5 #include "ppapi/c/pp_errors.h"
6 #include "ppapi/c/private/ppb_flash_file.h" 6 #include "ppapi/c/private/ppb_flash_file.h"
7 #include "ppapi/thunk/enter.h" 7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/ppb_flash_api.h" 8 #include "ppapi/thunk/ppb_flash_api.h"
9 #include "ppapi/thunk/ppb_instance_api.h" 9 #include "ppapi/thunk/ppb_instance_api.h"
10 #include "ppapi/thunk/thunk.h" 10 #include "ppapi/thunk/thunk.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 EnterInstance enter(instance); 80 EnterInstance enter(instance);
81 if (enter.failed()) 81 if (enter.failed())
82 return PP_ERROR_BADARGUMENT; 82 return PP_ERROR_BADARGUMENT;
83 return enter.functions()->GetFlashAPI()->GetDirContents(instance, path, 83 return enter.functions()->GetFlashAPI()->GetDirContents(instance, path,
84 contents); 84 contents);
85 } 85 }
86 86
87 void FreeDirContents(PP_Instance instance, 87 void FreeDirContents(PP_Instance instance,
88 PP_DirContents_Dev* contents) { 88 PP_DirContents_Dev* contents) {
89 EnterInstance enter(instance); 89 EnterInstance enter(instance);
90 if (enter.succeeded()) { 90 if (enter.succeeded())
91 return enter.functions()->GetFlashAPI()->FreeDirContents(instance, 91 enter.functions()->GetFlashAPI()->FreeDirContents(instance, contents);
92 contents);
93 }
94 } 92 }
95 93
96 const PPB_Flash_File_ModuleLocal g_ppb_flash_file_modulelocal_thunk = { 94 int32_t CreateTemporaryFile(PP_Instance instance, PP_FileHandle* file) {
95 EnterInstance enter(instance);
96 if (enter.failed())
97 return PP_ERROR_BADARGUMENT;
98
99 *file = PP_kInvalidFileHandle;
100 return enter.functions()->GetFlashAPI()->CreateTemporaryFile(instance, file);
101 }
102
103 const PPB_Flash_File_ModuleLocal_2_0 g_ppb_flash_file_modulelocal_thunk_2_0 = {
97 &CreateThreadAdapterForInstance, 104 &CreateThreadAdapterForInstance,
98 &ClearThreadAdapterForInstance, 105 &ClearThreadAdapterForInstance,
99 &OpenFile, 106 &OpenFile,
100 &RenameFile, 107 &RenameFile,
101 &DeleteFileOrDir, 108 &DeleteFileOrDir,
102 &CreateDir, 109 &CreateDir,
103 &QueryFile, 110 &QueryFile,
104 &GetDirContents, 111 &GetDirContents,
105 &FreeDirContents 112 &FreeDirContents
106 }; 113 };
107 114
115 const PPB_Flash_File_ModuleLocal_3_0 g_ppb_flash_file_modulelocal_thunk_3_0 = {
116 &CreateThreadAdapterForInstance,
117 &ClearThreadAdapterForInstance,
118 &OpenFile,
119 &RenameFile,
120 &DeleteFileOrDir,
121 &CreateDir,
122 &QueryFile,
123 &GetDirContents,
124 &FreeDirContents,
125 &CreateTemporaryFile
126 };
127
108 } // namespace 128 } // namespace
109 129
110 const PPB_Flash_File_ModuleLocal* GetPPB_Flash_File_ModuleLocal_Thunk() { 130 const PPB_Flash_File_ModuleLocal_2_0*
111 return &g_ppb_flash_file_modulelocal_thunk; 131 GetPPB_Flash_File_ModuleLocal_2_0_Thunk() {
132 return &g_ppb_flash_file_modulelocal_thunk_2_0;
133 }
134
135 const PPB_Flash_File_ModuleLocal_3_0*
136 GetPPB_Flash_File_ModuleLocal_3_0_Thunk() {
137 return &g_ppb_flash_file_modulelocal_thunk_3_0;
112 } 138 }
113 139
114 } // namespace thunk 140 } // namespace thunk
115 } // namespace ppapi 141 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_flash_api.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698