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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 NexeLoadManager* load_manager = GetNexeLoadManager(instance); | 410 NexeLoadManager* load_manager = GetNexeLoadManager(instance); |
411 DCHECK(load_manager); | 411 DCHECK(load_manager); |
412 if (!load_manager) { | 412 if (!load_manager) { |
413 PostPPCompletionCallback(callback, PP_ERROR_FAILED); | 413 PostPPCompletionCallback(callback, PP_ERROR_FAILED); |
414 return; | 414 return; |
415 } | 415 } |
416 | 416 |
417 // Create the trusted plugin channel. | 417 // Create the trusted plugin channel. |
418 if (IsValidChannelHandle(launch_result.trusted_ipc_channel_handle)) { | 418 if (IsValidChannelHandle(launch_result.trusted_ipc_channel_handle)) { |
419 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel( | 419 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel( |
420 new TrustedPluginChannel( | 420 new TrustedPluginChannel(instance, |
421 launch_result.trusted_ipc_channel_handle)); | 421 launch_result.trusted_ipc_channel_handle)); |
422 load_manager->set_trusted_plugin_channel(trusted_plugin_channel.Pass()); | 422 load_manager->set_trusted_plugin_channel(trusted_plugin_channel.Pass()); |
423 } else { | 423 } else { |
424 PostPPCompletionCallback(callback, PP_ERROR_FAILED); | 424 PostPPCompletionCallback(callback, PP_ERROR_FAILED); |
425 return; | 425 return; |
426 } | 426 } |
427 | 427 |
428 // Create the manifest service handle as well. | 428 // Create the manifest service handle as well. |
429 // For security hardening, disable the IPCs for open_resource() when they | 429 // For security hardening, disable the IPCs for open_resource() when they |
430 // aren't needed. PNaCl doesn't expose open_resource(), and the new | 430 // aren't needed. PNaCl doesn't expose open_resource(), and the new |
431 // open_resource() IPCs are currently only used for Non-SFI NaCl so far, | 431 // open_resource() IPCs are currently only used for Non-SFI NaCl so far, |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 if (load_manager) | 748 if (load_manager) |
749 load_manager->ReportLoadError(error, error_message); | 749 load_manager->ReportLoadError(error, error_message); |
750 } | 750 } |
751 | 751 |
752 void ReportLoadAbort(PP_Instance instance) { | 752 void ReportLoadAbort(PP_Instance instance) { |
753 NexeLoadManager* load_manager = GetNexeLoadManager(instance); | 753 NexeLoadManager* load_manager = GetNexeLoadManager(instance); |
754 if (load_manager) | 754 if (load_manager) |
755 load_manager->ReportLoadAbort(); | 755 load_manager->ReportLoadAbort(); |
756 } | 756 } |
757 | 757 |
758 void NexeDidCrash(PP_Instance instance, const char* crash_log) { | 758 void NexeDidCrash(PP_Instance instance) { |
759 NexeLoadManager* load_manager = GetNexeLoadManager(instance); | 759 NexeLoadManager* load_manager = GetNexeLoadManager(instance); |
760 if (load_manager) | 760 if (load_manager) |
761 load_manager->NexeDidCrash(crash_log); | 761 load_manager->NexeDidCrash(); |
762 } | 762 } |
763 | 763 |
764 void InstanceCreated(PP_Instance instance) { | 764 void InstanceCreated(PP_Instance instance) { |
765 scoped_ptr<NexeLoadManager> new_load_manager(new NexeLoadManager(instance)); | 765 scoped_ptr<NexeLoadManager> new_load_manager(new NexeLoadManager(instance)); |
766 NexeLoadManagerMap& map = g_load_manager_map.Get(); | 766 NexeLoadManagerMap& map = g_load_manager_map.Get(); |
767 DLOG_IF(ERROR, map.count(instance) != 0) << "Instance count should be 0"; | 767 DLOG_IF(ERROR, map.count(instance) != 0) << "Instance count should be 0"; |
768 map.add(instance, new_load_manager.Pass()); | 768 map.add(instance, new_load_manager.Pass()); |
769 } | 769 } |
770 | 770 |
771 void InstanceDestroyed(PP_Instance instance) { | 771 void InstanceDestroyed(PP_Instance instance) { |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 &StreamPexe | 1732 &StreamPexe |
1733 }; | 1733 }; |
1734 | 1734 |
1735 } // namespace | 1735 } // namespace |
1736 | 1736 |
1737 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1737 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
1738 return &nacl_interface; | 1738 return &nacl_interface; |
1739 } | 1739 } |
1740 | 1740 |
1741 } // namespace nacl | 1741 } // namespace nacl |
OLD | NEW |