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

Side by Side Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 264923011: Add a whitelist check for nacl-nonsfi mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 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 "components/nacl/renderer/ppb_nacl_private_impl.h" 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 int32_t num_processors; 494 int32_t num_processors;
495 IPC::Sender* sender = content::RenderThread::Get(); 495 IPC::Sender* sender = content::RenderThread::Get();
496 DCHECK(sender); 496 DCHECK(sender);
497 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { 497 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) {
498 return 1; 498 return 1;
499 } 499 }
500 return num_processors; 500 return num_processors;
501 } 501 }
502 502
503 PP_Bool IsNonSFIModeEnabled() { 503 PP_Bool IsNonSFIModeEnabled() {
504 #if defined(OS_LINUX) 504 // Note that this only indicates whether non-sfi mode *can* run for a given
505 // platform and if nonsfi manifest entries are preferred. There can be other
506 // restrictions which prevent a particular module from launching. See
507 // NaClProcessHost::Launch which makes the final determination.
508 #if defined(OS_CHROMEOS)
509 return PP_TRUE;
Mark Seaborn 2014/05/03 01:37:59 Hmm, really the browser should tell the renderer w
elijahtaylor1 2014/05/06 05:56:15 It's not incredibly difficult to plumb this IPC, b
Mark Seaborn 2014/05/08 01:06:02 OK. Can you comment this limitation somewhere app
510 #elif defined(OS_LINUX)
505 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( 511 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch(
506 switches::kEnableNaClNonSfiMode)); 512 switches::kEnableNaClNonSfiMode));
507 #else 513 #else
508 return PP_FALSE; 514 return PP_FALSE;
509 #endif 515 #endif
510 } 516 }
511 517
512 int32_t GetNexeFd(PP_Instance instance, 518 int32_t GetNexeFd(PP_Instance instance,
513 const char* pexe_url, 519 const char* pexe_url,
514 uint32_t abi_version, 520 uint32_t abi_version,
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 &DownloadManifestToBuffer 1039 &DownloadManifestToBuffer
1034 }; 1040 };
1035 1041
1036 } // namespace 1042 } // namespace
1037 1043
1038 const PPB_NaCl_Private* GetNaClPrivateInterface() { 1044 const PPB_NaCl_Private* GetNaClPrivateInterface() {
1039 return &nacl_interface; 1045 return &nacl_interface;
1040 } 1046 }
1041 1047
1042 } // namespace nacl 1048 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698