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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_file_io_host.cc

Issue 725353003: Don't pass ProcessHandle through ChildProcessHostDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/renderer_host/pepper/pepper_file_io_host.h" 5 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/files/file_util_proxy.h" 10 #include "base/files/file_util_proxy.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 void PepperFileIOHost::SendOpenErrorReply( 471 void PepperFileIOHost::SendOpenErrorReply(
472 ppapi::host::ReplyMessageContext reply_context) { 472 ppapi::host::ReplyMessageContext reply_context) {
473 host()->SendReply(reply_context, PpapiPluginMsg_FileIO_OpenReply(0, 0)); 473 host()->SendReply(reply_context, PpapiPluginMsg_FileIO_OpenReply(0, 0));
474 } 474 }
475 475
476 bool PepperFileIOHost::AddFileToReplyContext( 476 bool PepperFileIOHost::AddFileToReplyContext(
477 int32_t open_flags, 477 int32_t open_flags,
478 ppapi::host::ReplyMessageContext* reply_context) const { 478 ppapi::host::ReplyMessageContext* reply_context) const {
479 base::ProcessId plugin_process_id = 479 base::ProcessId plugin_process_id =
480 base::GetProcId(browser_ppapi_host_->GetPluginProcessHandle()); 480 base::GetProcId(browser_ppapi_host_->GetPluginProcess().Handle());
481 if (plugin_process_id == base::kNullProcessId) 481 if (plugin_process_id == base::kNullProcessId)
482 plugin_process_id = resolved_render_process_id_; 482 plugin_process_id = resolved_render_process_id_;
483 483
484 IPC::PlatformFileForTransit transit_file = 484 IPC::PlatformFileForTransit transit_file =
485 BrokerGetFileHandleForProcess(file_.GetPlatformFile(), plugin_process_id, 485 BrokerGetFileHandleForProcess(file_.GetPlatformFile(), plugin_process_id,
486 false); 486 false);
487 if (transit_file == IPC::InvalidPlatformFileForTransit()) 487 if (transit_file == IPC::InvalidPlatformFileForTransit())
488 return false; 488 return false;
489 489
490 ppapi::proxy::SerializedHandle file_handle; 490 ppapi::proxy::SerializedHandle file_handle;
491 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. 491 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc.
492 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; 492 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0;
493 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); 493 file_handle.set_file_handle(transit_file, open_flags, quota_file_io);
494 reply_context->params.AppendHandle(file_handle); 494 reply_context->params.AppendHandle(file_handle);
495 return true; 495 return true;
496 } 496 }
497 497
498 } // namespace content 498 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698