OLD | NEW |
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 <numeric> | 7 #include <numeric> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 int32_t num_processors; | 515 int32_t num_processors; |
516 IPC::Sender* sender = content::RenderThread::Get(); | 516 IPC::Sender* sender = content::RenderThread::Get(); |
517 DCHECK(sender); | 517 DCHECK(sender); |
518 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { | 518 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { |
519 return 1; | 519 return 1; |
520 } | 520 } |
521 return num_processors; | 521 return num_processors; |
522 } | 522 } |
523 | 523 |
524 PP_Bool IsNonSFIModeEnabled() { | 524 PP_Bool IsNonSFIModeEnabled() { |
525 #if defined(OS_LINUX) | 525 // Note that this only indicates whether non-sfi mode *can* run for a given |
| 526 // platform and if nonsfi manifest entries are preferred. There can be other |
| 527 // restrictions which prevent a particular module from launching. See |
| 528 // NaClProcessHost::Launch which makes the final determination. |
| 529 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 530 return PP_TRUE; |
| 531 #elif defined(OS_LINUX) |
526 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( | 532 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( |
527 switches::kEnableNaClNonSfiMode)); | 533 switches::kEnableNaClNonSfiMode)); |
528 #else | 534 #else |
529 return PP_FALSE; | 535 return PP_FALSE; |
530 #endif | 536 #endif |
531 } | 537 } |
532 | 538 |
533 int32_t GetNexeFd(PP_Instance instance, | 539 int32_t GetNexeFd(PP_Instance instance, |
534 const char* pexe_url, | 540 const char* pexe_url, |
535 uint32_t abi_version, | 541 uint32_t abi_version, |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 &GetCpuFeatureAttrs | 1287 &GetCpuFeatureAttrs |
1282 }; | 1288 }; |
1283 | 1289 |
1284 } // namespace | 1290 } // namespace |
1285 | 1291 |
1286 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1292 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
1287 return &nacl_interface; | 1293 return &nacl_interface; |
1288 } | 1294 } |
1289 | 1295 |
1290 } // namespace nacl | 1296 } // namespace nacl |
OLD | NEW |