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

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

Issue 6628019: Ensure that PP_Instance values are unique within a plugin process in addition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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/proxy/ppapi_messages_internal.h ('k') | webkit/plugins/ppapi/plugin_module.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/c/dev/ppb_file_ref_dev.h" 7 #include "ppapi/c/dev/ppb_file_ref_dev.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_proxy_private.h" 9 #include "ppapi/c/private/ppb_proxy_private.h"
10 #include "ppapi/proxy/host_dispatcher.h" 10 #include "ppapi/proxy/host_dispatcher.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void PPB_FileRef_Proxy::SerializeFileRef(PP_Resource file_ref, 252 void PPB_FileRef_Proxy::SerializeFileRef(PP_Resource file_ref,
253 PPBFileRef_CreateInfo* result) { 253 PPBFileRef_CreateInfo* result) {
254 // We need the instance out of the resource for serializing back to the 254 // We need the instance out of the resource for serializing back to the
255 // plugin. This code can only run in the host. 255 // plugin. This code can only run in the host.
256 if (dispatcher()->IsPlugin()) { 256 if (dispatcher()->IsPlugin()) {
257 NOTREACHED(); 257 NOTREACHED();
258 return; 258 return;
259 } 259 }
260 HostDispatcher* host_dispatcher = static_cast<HostDispatcher*>(dispatcher()); 260 HostDispatcher* host_dispatcher = static_cast<HostDispatcher*>(dispatcher());
261 PP_Instance instance = 261 PP_Instance instance =
262 host_dispatcher->GetPPBProxy()->GetInstanceForResource(file_ref); 262 host_dispatcher->ppb_proxy()->GetInstanceForResource(file_ref);
263 263
264 result->resource.SetHostResource(instance, file_ref); 264 result->resource.SetHostResource(instance, file_ref);
265 result->file_system_type = 265 result->file_system_type =
266 static_cast<int>(ppb_file_ref_target()->GetFileSystemType(file_ref)); 266 static_cast<int>(ppb_file_ref_target()->GetFileSystemType(file_ref));
267 result->path = SerializedVarReturnValue::Convert( 267 result->path = SerializedVarReturnValue::Convert(
268 dispatcher(), 268 dispatcher(),
269 ppb_file_ref_target()->GetPath(file_ref)); 269 ppb_file_ref_target()->GetPath(file_ref));
270 result->name = SerializedVarReturnValue::Convert( 270 result->name = SerializedVarReturnValue::Convert(
271 dispatcher(), 271 dispatcher(),
272 ppb_file_ref_target()->GetName(file_ref)); 272 ppb_file_ref_target()->GetName(file_ref));
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 int32_t result = 339 int32_t result =
340 ppb_file_ref_target()->Rename(file_ref.host_resource(), 340 ppb_file_ref_target()->Rename(file_ref.host_resource(),
341 new_file_ref.host_resource(), 341 new_file_ref.host_resource(),
342 callback); 342 callback);
343 if (result != PP_ERROR_WOULDBLOCK) 343 if (result != PP_ERROR_WOULDBLOCK)
344 PP_RunCompletionCallback(&callback, result); 344 PP_RunCompletionCallback(&callback, result);
345 } 345 }
346 346
347 } // namespace proxy 347 } // namespace proxy
348 } // namespace pp 348 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_messages_internal.h ('k') | webkit/plugins/ppapi/plugin_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698