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

Side by Side Diff: content/common/sandbox_win.cc

Issue 690753003: Crash hard if starting a newly-spawned sub-process fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/sandbox_win.h" 5 #include "content/common/sandbox_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 if (result == sandbox::SBOX_ERROR_GENERIC) 715 if (result == sandbox::SBOX_ERROR_GENERIC)
716 DPLOG(ERROR) << "Failed to launch process"; 716 DPLOG(ERROR) << "Failed to launch process";
717 else 717 else
718 DLOG(ERROR) << "Failed to launch process. Error: " << result; 718 DLOG(ERROR) << "Failed to launch process. Error: " << result;
719 return 0; 719 return 0;
720 } 720 }
721 721
722 if (delegate) 722 if (delegate)
723 delegate->PostSpawnTarget(target.process_handle()); 723 delegate->PostSpawnTarget(target.process_handle());
724 724
725 ResumeThread(target.thread_handle()); 725 CHECK(ResumeThread(target.thread_handle()) != -1);
726 TRACE_EVENT_END_ETW("StartProcessWithAccess", 0, type_str); 726 TRACE_EVENT_END_ETW("StartProcessWithAccess", 0, type_str);
727 return target.TakeProcessHandle(); 727 return target.TakeProcessHandle();
728 } 728 }
729 729
730 bool BrokerDuplicateHandle(HANDLE source_handle, 730 bool BrokerDuplicateHandle(HANDLE source_handle,
731 DWORD target_process_id, 731 DWORD target_process_id,
732 HANDLE* target_handle, 732 HANDLE* target_handle,
733 DWORD desired_access, 733 DWORD desired_access,
734 DWORD options) { 734 DWORD options) {
735 // If our process is the target just duplicate the handle. 735 // If our process is the target just duplicate the handle.
(...skipping 23 matching lines...) Expand all
759 } 759 }
760 760
761 return false; 761 return false;
762 } 762 }
763 763
764 bool BrokerAddTargetPeer(HANDLE peer_process) { 764 bool BrokerAddTargetPeer(HANDLE peer_process) {
765 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 765 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
766 } 766 }
767 767
768 } // namespace content 768 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698