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

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

Issue 1040223002: Added metrics to track sandboxed process launch errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('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 (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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 TRACE_EVENT_END_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); 734 TRACE_EVENT_END_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0);
735 735
736 if (sandbox::SBOX_ALL_OK != result) { 736 if (sandbox::SBOX_ALL_OK != result) {
737 if (result == sandbox::SBOX_ERROR_GENERIC) 737 if (result == sandbox::SBOX_ERROR_GENERIC)
738 DPLOG(ERROR) << "Failed to launch process"; 738 DPLOG(ERROR) << "Failed to launch process";
739 else if (result == sandbox::SBOX_ERROR_CREATE_PROCESS) { 739 else if (result == sandbox::SBOX_ERROR_CREATE_PROCESS) {
740 // TODO(shrikant): Remove this special case handling after determining 740 // TODO(shrikant): Remove this special case handling after determining
741 // cause for lowbox/createprocess errors. 741 // cause for lowbox/createprocess errors.
742 sandbox::PolicyBase* policy_base = 742 sandbox::PolicyBase* policy_base =
743 static_cast<sandbox::PolicyBase*>(policy); 743 static_cast<sandbox::PolicyBase*>(policy);
744 if (policy_base->GetLowBoxSid()) { 744 UMA_HISTOGRAM_SPARSE_SLOWLY(policy_base->GetLowBoxSid() ?
745 UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Lowbox.Launch.Error", 745 "Process.Sandbox.Lowbox.Launch.Error" :
746 last_error); 746 "Process.Sandbox.Launch.Error",
747 } 747 last_error);
748 } else 748 } else
749 DLOG(ERROR) << "Failed to launch process. Error: " << result; 749 DLOG(ERROR) << "Failed to launch process. Error: " << result;
750 return base::Process(); 750 return base::Process();
751 } 751 }
752 752
753 if (delegate) 753 if (delegate)
754 delegate->PostSpawnTarget(target.process_handle()); 754 delegate->PostSpawnTarget(target.process_handle());
755 755
756 CHECK(ResumeThread(target.thread_handle()) != -1); 756 CHECK(ResumeThread(target.thread_handle()) != -1);
757 TRACE_EVENT_END_ETW("StartProcessWithAccess", 0, type_str); 757 TRACE_EVENT_END_ETW("StartProcessWithAccess", 0, type_str);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 } 790 }
791 791
792 return false; 792 return false;
793 } 793 }
794 794
795 bool BrokerAddTargetPeer(HANDLE peer_process) { 795 bool BrokerAddTargetPeer(HANDLE peer_process) {
796 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 796 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
797 } 797 }
798 798
799 } // namespace content 799 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698