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

Side by Side Diff: ppapi/proxy/ppb_file_ref_proxy.cc

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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/proxy/ppb_file_ref_proxy.h" 5 #include "ppapi/proxy/ppb_file_ref_proxy.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFileRef_GetAbsolutePath, 210 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFileRef_GetAbsolutePath,
211 OnMsgGetAbsolutePath) 211 OnMsgGetAbsolutePath)
212 212
213 IPC_MESSAGE_HANDLER(PpapiMsg_PPBFileRef_CallbackComplete, 213 IPC_MESSAGE_HANDLER(PpapiMsg_PPBFileRef_CallbackComplete,
214 OnMsgCallbackComplete) 214 OnMsgCallbackComplete)
215 IPC_MESSAGE_UNHANDLED(handled = false) 215 IPC_MESSAGE_UNHANDLED(handled = false)
216 IPC_END_MESSAGE_MAP() 216 IPC_END_MESSAGE_MAP()
217 return handled; 217 return handled;
218 } 218 }
219 219
220 // static
220 void PPB_FileRef_Proxy::SerializeFileRef(PP_Resource file_ref, 221 void PPB_FileRef_Proxy::SerializeFileRef(PP_Resource file_ref,
221 PPB_FileRef_CreateInfo* result) { 222 PPB_FileRef_CreateInfo* result) {
222 EnterResourceNoLock<PPB_FileRef_API> enter(file_ref, false); 223 EnterResourceNoLock<PPB_FileRef_API> enter(file_ref, false);
223 if (enter.succeeded()) 224 if (enter.succeeded())
224 *result = enter.object()->GetCreateInfo(); 225 *result = enter.object()->GetCreateInfo();
225 } 226 }
226 227
227 // static 228 // static
228 PP_Resource PPB_FileRef_Proxy::DeserializeFileRef( 229 PP_Resource PPB_FileRef_Proxy::DeserializeFileRef(
229 const PPB_FileRef_CreateInfo& serialized) { 230 const PPB_FileRef_CreateInfo& serialized) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 int32_t result, 320 int32_t result,
320 const HostResource& host_resource, 321 const HostResource& host_resource,
321 int callback_id) { 322 int callback_id) {
322 // Execute OnMsgCallbackComplete in the plugin process. 323 // Execute OnMsgCallbackComplete in the plugin process.
323 Send(new PpapiMsg_PPBFileRef_CallbackComplete( 324 Send(new PpapiMsg_PPBFileRef_CallbackComplete(
324 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); 325 API_ID_PPB_FILE_REF, host_resource, callback_id, result));
325 } 326 }
326 327
327 } // namespace proxy 328 } // namespace proxy
328 } // namespace ppapi 329 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698