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

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

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return false; 359 return false;
360 #endif 360 #endif
361 361
362 #if defined(SANITIZER_COVERAGE) 362 #if defined(SANITIZER_COVERAGE)
363 DWORD coverage_dir_size = 363 DWORD coverage_dir_size =
364 ::GetEnvironmentVariable(L"SANITIZER_COVERAGE_DIR", NULL, 0); 364 ::GetEnvironmentVariable(L"SANITIZER_COVERAGE_DIR", NULL, 0);
365 if (coverage_dir_size == 0) { 365 if (coverage_dir_size == 0) {
366 LOG(WARNING) << "SANITIZER_COVERAGE_DIR was not set, coverage won't work."; 366 LOG(WARNING) << "SANITIZER_COVERAGE_DIR was not set, coverage won't work.";
367 } else { 367 } else {
368 std::wstring coverage_dir; 368 std::wstring coverage_dir;
369 wchar_t* coverage_dir_str = WriteInto(&coverage_dir, coverage_dir_size); 369 wchar_t* coverage_dir_str =
370 base::WriteInto(&coverage_dir, coverage_dir_size);
370 coverage_dir_size = ::GetEnvironmentVariable( 371 coverage_dir_size = ::GetEnvironmentVariable(
371 L"SANITIZER_COVERAGE_DIR", coverage_dir_str, coverage_dir_size); 372 L"SANITIZER_COVERAGE_DIR", coverage_dir_str, coverage_dir_size);
372 CHECK(coverage_dir.size() == coverage_dir_size); 373 CHECK(coverage_dir.size() == coverage_dir_size);
373 base::FilePath sancov_path = 374 base::FilePath sancov_path =
374 base::FilePath(coverage_dir).Append(L"*.sancov"); 375 base::FilePath(coverage_dir).Append(L"*.sancov");
375 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, 376 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
376 sandbox::TargetPolicy::FILES_ALLOW_ANY, 377 sandbox::TargetPolicy::FILES_ALLOW_ANY,
377 sancov_path.value().c_str()); 378 sancov_path.value().c_str());
378 if (result != sandbox::SBOX_ALL_OK) 379 if (result != sandbox::SBOX_ALL_OK)
379 return false; 380 return false;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 845 }
845 846
846 return false; 847 return false;
847 } 848 }
848 849
849 bool BrokerAddTargetPeer(HANDLE peer_process) { 850 bool BrokerAddTargetPeer(HANDLE peer_process) {
850 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 851 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
851 } 852 }
852 853
853 } // namespace content 854 } // namespace content
OLDNEW
« no previous file with comments | « components/wifi/wifi_service_win.cc ('k') | content/shell/browser/shell_javascript_dialog_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698