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

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

Issue 1352713002: Get logging to chrome_debug.log working again on Windows Vista+. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stray comments Created 5 years, 3 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 | « chrome/app/chrome_main_delegate.cc ('k') | 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"
11 #include "base/debug/profiler.h" 11 #include "base/debug/profiler.h"
12 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
13 #include "base/hash.h" 13 #include "base/hash.h"
14 #include "base/logging.h"
14 #include "base/memory/shared_memory.h" 15 #include "base/memory/shared_memory.h"
15 #include "base/metrics/sparse_histogram.h" 16 #include "base/metrics/sparse_histogram.h"
16 #include "base/path_service.h" 17 #include "base/path_service.h"
17 #include "base/process/launch.h" 18 #include "base/process/launch.h"
18 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "base/trace_event/trace_event.h" 22 #include "base/trace_event/trace_event.h"
22 #include "base/win/iat_patch_function.h" 23 #include "base/win/iat_patch_function.h"
23 #include "base/win/scoped_handle.h" 24 #include "base/win/scoped_handle.h"
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 exposed_files.value().c_str()); 735 exposed_files.value().c_str());
735 if (result != sandbox::SBOX_ALL_OK) 736 if (result != sandbox::SBOX_ALL_OK)
736 return base::Process(); 737 return base::Process();
737 } 738 }
738 739
739 if (!AddGenericPolicy(policy)) { 740 if (!AddGenericPolicy(policy)) {
740 NOTREACHED(); 741 NOTREACHED();
741 return base::Process(); 742 return base::Process();
742 } 743 }
743 744
745 // Allow the renderer and gpu processes to access the log file.
746 if (type_str == switches::kRendererProcess ||
747 type_str == switches::kGpuProcess) {
748 if (logging::IsLoggingToFileEnabled()) {
749 DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute());
750 policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
751 sandbox::TargetPolicy::FILES_ALLOW_ANY,
752 logging::GetLogFileFullPath().c_str());
753 }
754 }
755
744 #if !defined(OFFICIAL_BUILD) 756 #if !defined(OFFICIAL_BUILD)
745 // If stdout/stderr point to a Windows console, these calls will 757 // If stdout/stderr point to a Windows console, these calls will
746 // have no effect. 758 // have no effect.
747 policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE)); 759 policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
748 policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE)); 760 policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
749 #endif 761 #endif
750 762
751 if (delegate) { 763 if (delegate) {
752 bool success = true; 764 bool success = true;
753 delegate->PreSpawnTarget(policy, &success); 765 delegate->PreSpawnTarget(policy, &success);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 } 839 }
828 840
829 return false; 841 return false;
830 } 842 }
831 843
832 bool BrokerAddTargetPeer(HANDLE peer_process) { 844 bool BrokerAddTargetPeer(HANDLE peer_process) {
833 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 845 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
834 } 846 }
835 847
836 } // namespace content 848 } // namespace content
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698