OLD | NEW |
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" |
11 #include "base/debug/dump_without_crashing.h" | |
12 #include "base/debug/profiler.h" | 11 #include "base/debug/profiler.h" |
13 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
14 #include "base/hash.h" | 13 #include "base/hash.h" |
15 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" |
16 #include "base/path_service.h" | 15 #include "base/path_service.h" |
17 #include "base/process/launch.h" | 16 #include "base/process/launch.h" |
18 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
19 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
20 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
21 #include "base/win/iat_patch_function.h" | 20 #include "base/win/iat_patch_function.h" |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 DPLOG(ERROR) << "Failed to launch process"; | 737 DPLOG(ERROR) << "Failed to launch process"; |
739 else if (result == sandbox::SBOX_ERROR_CREATE_PROCESS) { | 738 else if (result == sandbox::SBOX_ERROR_CREATE_PROCESS) { |
740 // TODO(shrikant): Remove this special case handling after determining | 739 // TODO(shrikant): Remove this special case handling after determining |
741 // cause for lowbox/createprocess errors. | 740 // cause for lowbox/createprocess errors. |
742 sandbox::PolicyBase* policy_base = | 741 sandbox::PolicyBase* policy_base = |
743 static_cast<sandbox::PolicyBase*>(policy); | 742 static_cast<sandbox::PolicyBase*>(policy); |
744 UMA_HISTOGRAM_SPARSE_SLOWLY(policy_base->GetLowBoxSid() ? | 743 UMA_HISTOGRAM_SPARSE_SLOWLY(policy_base->GetLowBoxSid() ? |
745 "Process.Sandbox.Lowbox.Launch.Error" : | 744 "Process.Sandbox.Lowbox.Launch.Error" : |
746 "Process.Sandbox.Launch.Error", | 745 "Process.Sandbox.Launch.Error", |
747 last_error); | 746 last_error); |
748 // Trigger a minidump without crashing the browser. | |
749 // Note that this function will only generate minidump if content host | |
750 // has already done pre-setup by calling | |
751 // base::debug::SetDumpWithoutCrashingFunction | |
752 base::debug::DumpWithoutCrashing(); | |
753 } else | 747 } else |
754 DLOG(ERROR) << "Failed to launch process. Error: " << result; | 748 DLOG(ERROR) << "Failed to launch process. Error: " << result; |
755 | 749 |
756 policy->Release(); | 750 policy->Release(); |
757 return base::Process(); | 751 return base::Process(); |
758 } | 752 } |
759 policy->Release(); | 753 policy->Release(); |
760 | 754 |
761 if (delegate) | 755 if (delegate) |
762 delegate->PostSpawnTarget(target.process_handle()); | 756 delegate->PostSpawnTarget(target.process_handle()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 } | 792 } |
799 | 793 |
800 return false; | 794 return false; |
801 } | 795 } |
802 | 796 |
803 bool BrokerAddTargetPeer(HANDLE peer_process) { | 797 bool BrokerAddTargetPeer(HANDLE peer_process) { |
804 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 798 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
805 } | 799 } |
806 | 800 |
807 } // namespace content | 801 } // namespace content |
OLD | NEW |