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

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 874603002: NaCl: Simplify the plumbing for PPAPI's DevInterfacesEnabled flag (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index c9eca51194dfeb75f623b6c14d11aa1e2a8379f2..3c84afe5d1ee4a16187fef0b715342f5b239acf4 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -358,7 +358,6 @@ void LaunchSelLdr(PP_Instance instance,
const char* alleged_url,
const PP_NaClFileInfo* nexe_file_info,
PP_Bool uses_nonsfi_mode,
- PP_Bool enable_ppapi_dev,
PP_NaClAppProcessType pp_process_type,
void* imc_handle,
PP_CompletionCallback callback) {
@@ -374,7 +373,9 @@ void LaunchSelLdr(PP_Instance instance,
IPC::Sender* sender = content::RenderThread::Get();
DCHECK(sender);
int routing_id = GetRoutingID(instance);
- if (!routing_id) {
+ NexeLoadManager* load_manager = GetNexeLoadManager(instance);
+ DCHECK(load_manager);
+ if (!routing_id || !load_manager) {
if (nexe_file_info->handle != PP_kInvalidFileHandle) {
base::File closer(nexe_file_info->handle);
}
@@ -391,7 +392,7 @@ void LaunchSelLdr(PP_Instance instance,
// Conditionally block 'Dev' interfaces. We do this for the NaCl process, so
// it's clearer to developers when they are using 'Dev' inappropriately. We
// must also check on the trusted side of the proxy.
- if (enable_ppapi_dev)
+ if (load_manager->DevInterfacesEnabled())
perm_bits |= ppapi::PERMISSION_DEV;
instance_info.permissions =
ppapi::PpapiPermissions::GetForCommandLine(perm_bits);
@@ -430,13 +431,6 @@ void LaunchSelLdr(PP_Instance instance,
return;
}
- NexeLoadManager* load_manager = GetNexeLoadManager(instance);
- DCHECK(load_manager);
- if (!load_manager) {
- PostPPCompletionCallback(callback, PP_ERROR_FAILED);
- base::SharedMemory::CloseHandle(launch_result.crash_info_shmem_handle);
- return;
- }
load_manager->set_nonsfi(PP_ToBool(uses_nonsfi_mode));
if (!error_message_string.empty()) {
@@ -903,13 +897,6 @@ void ProcessNaClManifest(PP_Instance instance, const char* program_url) {
load_manager->ProcessNaClManifest(program_url);
}
-PP_Bool DevInterfacesEnabled(PP_Instance instance) {
- nacl::NexeLoadManager* load_manager = GetNexeLoadManager(instance);
- if (load_manager)
- return PP_FromBool(load_manager->DevInterfacesEnabled());
- return PP_FALSE;
-}
-
void DownloadManifestToBufferCompletion(PP_Instance instance,
struct PP_CompletionCallback callback,
base::Time start_time,
@@ -1654,7 +1641,6 @@ const PPB_NaCl_Private nacl_interface = {
&RequestNaClManifest,
&GetManifestBaseURL,
&ProcessNaClManifest,
- &DevInterfacesEnabled,
&ManifestGetProgramURL,
&GetPNaClResourceInfo,
&GetCpuFeatureAttrs,
« no previous file with comments | « no previous file | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698