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 #ifndef DISABLE_NACL | 7 #ifndef DISABLE_NACL |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
14 #include "components/nacl/common/nacl_host_messages.h" | 14 #include "components/nacl/common/nacl_host_messages.h" |
15 #include "components/nacl/common/nacl_messages.h" | 15 #include "components/nacl/common/nacl_messages.h" |
16 #include "components/nacl/common/nacl_switches.h" | 16 #include "components/nacl/common/nacl_switches.h" |
17 #include "components/nacl/common/nacl_types.h" | 17 #include "components/nacl/common/nacl_types.h" |
18 #include "components/nacl/renderer/pnacl_translation_resource_host.h" | 18 #include "components/nacl/renderer/pnacl_translation_resource_host.h" |
| 19 #include "components/nacl/renderer/sandbox_arch.h" |
19 #include "components/nacl/renderer/trusted_plugin_channel.h" | 20 #include "components/nacl/renderer/trusted_plugin_channel.h" |
20 #include "content/public/common/content_client.h" | 21 #include "content/public/common/content_client.h" |
21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
22 #include "content/public/common/sandbox_init.h" | 23 #include "content/public/common/sandbox_init.h" |
23 #include "content/public/renderer/pepper_plugin_instance.h" | 24 #include "content/public/renderer/pepper_plugin_instance.h" |
24 #include "content/public/renderer/render_thread.h" | 25 #include "content/public/renderer/render_thread.h" |
25 #include "content/public/renderer/render_view.h" | 26 #include "content/public/renderer/render_view.h" |
26 #include "content/public/renderer/renderer_ppapi_host.h" | 27 #include "content/public/renderer/renderer_ppapi_host.h" |
27 #include "ppapi/c/pp_bool.h" | 28 #include "ppapi/c/pp_bool.h" |
28 #include "ppapi/c/private/pp_file_handle.h" | 29 #include "ppapi/c/private/pp_file_handle.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 nacl::TrustedPluginChannel* instance_info = it->second; | 548 nacl::TrustedPluginChannel* instance_info = it->second; |
548 map.erase(it); | 549 map.erase(it); |
549 delete instance_info; | 550 delete instance_info; |
550 } | 551 } |
551 | 552 |
552 PP_Bool NaClDebugStubEnabled() { | 553 PP_Bool NaClDebugStubEnabled() { |
553 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( | 554 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( |
554 switches::kEnableNaClDebug)); | 555 switches::kEnableNaClDebug)); |
555 } | 556 } |
556 | 557 |
| 558 const char* GetSandboxArch() { |
| 559 return nacl::GetSandboxArch(); |
| 560 } |
| 561 |
557 const PPB_NaCl_Private nacl_interface = { | 562 const PPB_NaCl_Private nacl_interface = { |
558 &LaunchSelLdr, | 563 &LaunchSelLdr, |
559 &StartPpapiProxy, | 564 &StartPpapiProxy, |
560 &UrandomFD, | 565 &UrandomFD, |
561 &Are3DInterfacesDisabled, | 566 &Are3DInterfacesDisabled, |
562 &BrokerDuplicateHandle, | 567 &BrokerDuplicateHandle, |
563 &GetReadonlyPnaclFD, | 568 &GetReadonlyPnaclFD, |
564 &CreateTemporaryFile, | 569 &CreateTemporaryFile, |
565 &GetNumberOfProcessors, | 570 &GetNumberOfProcessors, |
566 &IsNonSFIModeEnabled, | 571 &IsNonSFIModeEnabled, |
567 &GetNexeFd, | 572 &GetNexeFd, |
568 &ReportTranslationFinished, | 573 &ReportTranslationFinished, |
569 &OpenNaClExecutable, | 574 &OpenNaClExecutable, |
570 &DispatchEvent, | 575 &DispatchEvent, |
571 &SetReadOnlyProperty, | 576 &SetReadOnlyProperty, |
572 &ReportLoadError, | 577 &ReportLoadError, |
573 &InstanceDestroyed, | 578 &InstanceDestroyed, |
574 &NaClDebugStubEnabled | 579 &NaClDebugStubEnabled, |
| 580 &GetSandboxArch |
575 }; | 581 }; |
576 | 582 |
577 } // namespace | 583 } // namespace |
578 | 584 |
579 namespace nacl { | 585 namespace nacl { |
580 | 586 |
581 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 587 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
582 return &nacl_interface; | 588 return &nacl_interface; |
583 } | 589 } |
584 | 590 |
585 } // namespace nacl | 591 } // namespace nacl |
586 | 592 |
587 #endif // DISABLE_NACL | 593 #endif // DISABLE_NACL |
OLD | NEW |