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

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

Issue 469423002: NaCl: Send fatal log messages via shared memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove commented out line Created 6 years, 4 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
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.cc ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <numeric> 7 #include <numeric>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // Don't save instance_info if channel handle is invalid. 404 // Don't save instance_info if channel handle is invalid.
405 if (IsValidChannelHandle(instance_info.channel_handle)) 405 if (IsValidChannelHandle(instance_info.channel_handle))
406 g_instance_info.Get()[instance] = instance_info; 406 g_instance_info.Get()[instance] = instance_info;
407 407
408 *(static_cast<NaClHandle*>(imc_handle)) = ToNativeHandle(result_socket); 408 *(static_cast<NaClHandle*>(imc_handle)) = ToNativeHandle(result_socket);
409 409
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 base::SharedMemory::CloseHandle(launch_result.crash_info_shmem_handle);
414 return; 415 return;
415 } 416 }
416 417
418 // Store the crash information shared memory handle.
419 load_manager->set_crash_info_shmem_handle(
420 launch_result.crash_info_shmem_handle);
421
417 // Create the trusted plugin channel. 422 // Create the trusted plugin channel.
418 if (IsValidChannelHandle(launch_result.trusted_ipc_channel_handle)) { 423 if (IsValidChannelHandle(launch_result.trusted_ipc_channel_handle)) {
419 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel( 424 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel(
420 new TrustedPluginChannel( 425 new TrustedPluginChannel(
421 launch_result.trusted_ipc_channel_handle)); 426 launch_result.trusted_ipc_channel_handle));
422 load_manager->set_trusted_plugin_channel(trusted_plugin_channel.Pass()); 427 load_manager->set_trusted_plugin_channel(trusted_plugin_channel.Pass());
423 } else { 428 } else {
424 PostPPCompletionCallback(callback, PP_ERROR_FAILED); 429 PostPPCompletionCallback(callback, PP_ERROR_FAILED);
425 return; 430 return;
426 } 431 }
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 if (load_manager) 753 if (load_manager)
749 load_manager->ReportLoadError(error, error_message); 754 load_manager->ReportLoadError(error, error_message);
750 } 755 }
751 756
752 void ReportLoadAbort(PP_Instance instance) { 757 void ReportLoadAbort(PP_Instance instance) {
753 NexeLoadManager* load_manager = GetNexeLoadManager(instance); 758 NexeLoadManager* load_manager = GetNexeLoadManager(instance);
754 if (load_manager) 759 if (load_manager)
755 load_manager->ReportLoadAbort(); 760 load_manager->ReportLoadAbort();
756 } 761 }
757 762
758 void NexeDidCrash(PP_Instance instance, const char* crash_log) { 763 void NexeDidCrash(PP_Instance instance) {
759 NexeLoadManager* load_manager = GetNexeLoadManager(instance); 764 NexeLoadManager* load_manager = GetNexeLoadManager(instance);
760 if (load_manager) 765 if (load_manager)
761 load_manager->NexeDidCrash(crash_log); 766 load_manager->NexeDidCrash();
762 } 767 }
763 768
764 void InstanceCreated(PP_Instance instance) { 769 void InstanceCreated(PP_Instance instance) {
765 scoped_ptr<NexeLoadManager> new_load_manager(new NexeLoadManager(instance)); 770 scoped_ptr<NexeLoadManager> new_load_manager(new NexeLoadManager(instance));
766 NexeLoadManagerMap& map = g_load_manager_map.Get(); 771 NexeLoadManagerMap& map = g_load_manager_map.Get();
767 DLOG_IF(ERROR, map.count(instance) != 0) << "Instance count should be 0"; 772 DLOG_IF(ERROR, map.count(instance) != 0) << "Instance count should be 0";
768 map.add(instance, new_load_manager.Pass()); 773 map.add(instance, new_load_manager.Pass());
769 } 774 }
770 775
771 void InstanceDestroyed(PP_Instance instance) { 776 void InstanceDestroyed(PP_Instance instance) {
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 &StreamPexe 1750 &StreamPexe
1746 }; 1751 };
1747 1752
1748 } // namespace 1753 } // namespace
1749 1754
1750 const PPB_NaCl_Private* GetNaClPrivateInterface() { 1755 const PPB_NaCl_Private* GetNaClPrivateInterface() {
1751 return &nacl_interface; 1756 return &nacl_interface;
1752 } 1757 }
1753 1758
1754 } // namespace nacl 1759 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/renderer/nexe_load_manager.cc ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698