| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 401 } |
| 402 | 402 |
| 403 // Store the crash information shared memory handle. | 403 // Store the crash information shared memory handle. |
| 404 load_manager->set_crash_info_shmem_handle( | 404 load_manager->set_crash_info_shmem_handle( |
| 405 launch_result.crash_info_shmem_handle); | 405 launch_result.crash_info_shmem_handle); |
| 406 | 406 |
| 407 // Create the trusted plugin channel. | 407 // Create the trusted plugin channel. |
| 408 if (IsValidChannelHandle(launch_result.trusted_ipc_channel_handle)) { | 408 if (IsValidChannelHandle(launch_result.trusted_ipc_channel_handle)) { |
| 409 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel( | 409 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel( |
| 410 new TrustedPluginChannel( | 410 new TrustedPluginChannel( |
| 411 instance, |
| 411 launch_result.trusted_ipc_channel_handle, | 412 launch_result.trusted_ipc_channel_handle, |
| 412 content::RenderThread::Get()->GetShutdownEvent())); | 413 content::RenderThread::Get()->GetShutdownEvent())); |
| 413 load_manager->set_trusted_plugin_channel(trusted_plugin_channel.Pass()); | 414 load_manager->set_trusted_plugin_channel(trusted_plugin_channel.Pass()); |
| 414 } else { | 415 } else { |
| 415 PostPPCompletionCallback(callback, PP_ERROR_FAILED); | 416 PostPPCompletionCallback(callback, PP_ERROR_FAILED); |
| 416 return; | 417 return; |
| 417 } | 418 } |
| 418 | 419 |
| 419 // Create the manifest service handle as well. | 420 // Create the manifest service handle as well. |
| 420 // For security hardening, disable the IPCs for open_resource() when they | 421 // For security hardening, disable the IPCs for open_resource() when they |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 } | 782 } |
| 782 | 783 |
| 783 PP_NaClReadyState GetNaClReadyState(PP_Instance instance) { | 784 PP_NaClReadyState GetNaClReadyState(PP_Instance instance) { |
| 784 NexeLoadManager* load_manager = NexeLoadManager::Get(instance); | 785 NexeLoadManager* load_manager = NexeLoadManager::Get(instance); |
| 785 DCHECK(load_manager); | 786 DCHECK(load_manager); |
| 786 if (load_manager) | 787 if (load_manager) |
| 787 return load_manager->nacl_ready_state(); | 788 return load_manager->nacl_ready_state(); |
| 788 return PP_NACL_READY_STATE_UNSENT; | 789 return PP_NACL_READY_STATE_UNSENT; |
| 789 } | 790 } |
| 790 | 791 |
| 791 int32_t GetExitStatus(PP_Instance instance) { | |
| 792 NexeLoadManager* load_manager = NexeLoadManager::Get(instance); | |
| 793 DCHECK(load_manager); | |
| 794 if (load_manager) | |
| 795 return load_manager->exit_status(); | |
| 796 return -1; | |
| 797 } | |
| 798 | |
| 799 void SetExitStatus(PP_Instance instance, int32_t exit_status) { | |
| 800 NexeLoadManager* load_manager = NexeLoadManager::Get(instance); | |
| 801 DCHECK(load_manager); | |
| 802 if (load_manager) | |
| 803 return load_manager->set_exit_status(exit_status); | |
| 804 } | |
| 805 | |
| 806 void Vlog(const char* message) { | 792 void Vlog(const char* message) { |
| 807 VLOG(1) << message; | 793 VLOG(1) << message; |
| 808 } | 794 } |
| 809 | 795 |
| 810 void InitializePlugin(PP_Instance instance, | 796 void InitializePlugin(PP_Instance instance, |
| 811 uint32_t argc, | 797 uint32_t argc, |
| 812 const char* argn[], | 798 const char* argn[], |
| 813 const char* argv[]) { | 799 const char* argv[]) { |
| 814 NexeLoadManager* load_manager = NexeLoadManager::Get(instance); | 800 NexeLoadManager* load_manager = NexeLoadManager::Get(instance); |
| 815 DCHECK(load_manager); | 801 DCHECK(load_manager); |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1696 &ReportLoadSuccess, | 1682 &ReportLoadSuccess, |
| 1697 &ReportLoadError, | 1683 &ReportLoadError, |
| 1698 &ReportLoadAbort, | 1684 &ReportLoadAbort, |
| 1699 &NexeDidCrash, | 1685 &NexeDidCrash, |
| 1700 &InstanceCreated, | 1686 &InstanceCreated, |
| 1701 &InstanceDestroyed, | 1687 &InstanceDestroyed, |
| 1702 &NaClDebugEnabledForURL, | 1688 &NaClDebugEnabledForURL, |
| 1703 &GetSandboxArch, | 1689 &GetSandboxArch, |
| 1704 &LogToConsole, | 1690 &LogToConsole, |
| 1705 &GetNaClReadyState, | 1691 &GetNaClReadyState, |
| 1706 &GetExitStatus, | |
| 1707 &SetExitStatus, | |
| 1708 &Vlog, | 1692 &Vlog, |
| 1709 &InitializePlugin, | 1693 &InitializePlugin, |
| 1710 &GetNexeSize, | 1694 &GetNexeSize, |
| 1711 &RequestNaClManifest, | 1695 &RequestNaClManifest, |
| 1712 &GetManifestBaseURL, | 1696 &GetManifestBaseURL, |
| 1713 &ProcessNaClManifest, | 1697 &ProcessNaClManifest, |
| 1714 &DevInterfacesEnabled, | 1698 &DevInterfacesEnabled, |
| 1715 &ManifestGetProgramURL, | 1699 &ManifestGetProgramURL, |
| 1716 &GetPNaClResourceInfo, | 1700 &GetPNaClResourceInfo, |
| 1717 &GetCpuFeatureAttrs, | 1701 &GetCpuFeatureAttrs, |
| 1718 &PostMessageToJavaScript, | 1702 &PostMessageToJavaScript, |
| 1719 &DownloadNexe, | 1703 &DownloadNexe, |
| 1720 &ReportSelLdrStatus, | 1704 &ReportSelLdrStatus, |
| 1721 &LogTranslateTime, | 1705 &LogTranslateTime, |
| 1722 &OpenManifestEntry, | 1706 &OpenManifestEntry, |
| 1723 &SetPNaClStartTime, | 1707 &SetPNaClStartTime, |
| 1724 &StreamPexe | 1708 &StreamPexe |
| 1725 }; | 1709 }; |
| 1726 | 1710 |
| 1727 } // namespace | 1711 } // namespace |
| 1728 | 1712 |
| 1729 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1713 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
| 1730 return &nacl_interface; | 1714 return &nacl_interface; |
| 1731 } | 1715 } |
| 1732 | 1716 |
| 1733 } // namespace nacl | 1717 } // namespace nacl |
| OLD | NEW |