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

Unified Diff: remoting/host/win/elevated_controller.cc

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/usage_stats_consent_mac.cc ('k') | remoting/host/win/host_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/elevated_controller.cc
diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc
index a43203d1c1f7fcbe1a01eed8accc1762e61b1592..024ca3444ea04ef36fa176d6ad66b489cce123bc 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -32,14 +32,14 @@ namespace {
const size_t kMaxConfigFileSize = 1024 * 1024;
// The host configuration file name.
-const FilePath::CharType kConfigFileName[] = FILE_PATH_LITERAL("host.json");
+const base::FilePath::CharType kConfigFileName[] = FILE_PATH_LITERAL("host.json");
// The unprivileged configuration file name.
-const FilePath::CharType kUnprivilegedConfigFileName[] =
+const base::FilePath::CharType kUnprivilegedConfigFileName[] =
FILE_PATH_LITERAL("host_unprivileged.json");
// The extension for the temporary file.
-const FilePath::CharType kTempFileExtension[] = FILE_PATH_LITERAL("json~");
+const base::FilePath::CharType kTempFileExtension[] = FILE_PATH_LITERAL("json~");
// The host configuration file security descriptor that enables full access to
// Local System and built-in administrators only.
@@ -92,7 +92,7 @@ bool IsClientAdmin() {
// Reads and parses the configuration file up to |kMaxConfigFileSize| in
// size.
-HRESULT ReadConfig(const FilePath& filename,
+HRESULT ReadConfig(const base::FilePath& filename,
scoped_ptr<base::DictionaryValue>* config_out) {
// Read raw data from the configuration file.
@@ -137,12 +137,12 @@ HRESULT ReadConfig(const FilePath& filename,
return S_OK;
}
-FilePath GetTempLocationFor(const FilePath& filename) {
+base::FilePath GetTempLocationFor(const base::FilePath& filename) {
return filename.ReplaceExtension(kTempFileExtension);
}
// Writes a config file to a temporary location.
-HRESULT WriteConfigFileToTemp(const FilePath& filename,
+HRESULT WriteConfigFileToTemp(const base::FilePath& filename,
const char* security_descriptor,
const char* content,
size_t length) {
@@ -161,7 +161,7 @@ HRESULT WriteConfigFileToTemp(const FilePath& filename,
security_attributes.bInheritHandle = FALSE;
// Create a temporary file and write configuration to it.
- FilePath tempname = GetTempLocationFor(filename);
+ base::FilePath tempname = GetTempLocationFor(filename);
base::win::ScopedHandle file(
CreateFileW(tempname.value().c_str(),
GENERIC_WRITE,
@@ -190,10 +190,10 @@ HRESULT WriteConfigFileToTemp(const FilePath& filename,
}
// Moves a config file from its temporary location to its permanent location.
-HRESULT MoveConfigFileFromTemp(const FilePath& filename) {
+HRESULT MoveConfigFileFromTemp(const base::FilePath& filename) {
// Now that the configuration is stored successfully replace the actual
// configuration file.
- FilePath tempname = GetTempLocationFor(filename);
+ base::FilePath tempname = GetTempLocationFor(filename);
if (!MoveFileExW(tempname.value().c_str(),
filename.value().c_str(),
MOVEFILE_REPLACE_EXISTING)) {
@@ -253,7 +253,7 @@ HRESULT WriteConfig(const char* content, size_t length, HWND owner_window) {
base::JSONWriter::Write(&unprivileged_config_dict, &unprivileged_config_str);
// Write the full configuration file to a temporary location.
- FilePath full_config_file_path =
+ base::FilePath full_config_file_path =
remoting::GetConfigDir().Append(kConfigFileName);
HRESULT hr = WriteConfigFileToTemp(full_config_file_path,
kConfigFileSecurityDescriptor,
@@ -264,7 +264,7 @@ HRESULT WriteConfig(const char* content, size_t length, HWND owner_window) {
}
// Write the unprivileged configuration file to a temporary location.
- FilePath unprivileged_config_file_path =
+ base::FilePath unprivileged_config_file_path =
remoting::GetConfigDir().Append(kUnprivilegedConfigFileName);
hr = WriteConfigFileToTemp(unprivileged_config_file_path,
kUnprivilegedConfigFileSecurityDescriptor,
@@ -302,7 +302,7 @@ void ElevatedController::FinalRelease() {
}
STDMETHODIMP ElevatedController::GetConfig(BSTR* config_out) {
- FilePath config_dir = remoting::GetConfigDir();
+ base::FilePath config_dir = remoting::GetConfigDir();
// Read the unprivileged part of host configuration.
scoped_ptr<base::DictionaryValue> config;
@@ -347,7 +347,7 @@ STDMETHODIMP ElevatedController::GetVersion(BSTR* version_out) {
STDMETHODIMP ElevatedController::SetConfig(BSTR config) {
// Determine the config directory path and create it if necessary.
- FilePath config_dir = remoting::GetConfigDir();
+ base::FilePath config_dir = remoting::GetConfigDir();
if (!file_util::CreateDirectory(config_dir)) {
return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED);
}
@@ -462,7 +462,7 @@ STDMETHODIMP ElevatedController::UpdateConfig(BSTR config) {
}
}
// Get the old config.
- FilePath config_dir = remoting::GetConfigDir();
+ base::FilePath config_dir = remoting::GetConfigDir();
scoped_ptr<base::DictionaryValue> config_old;
HRESULT hr = ReadConfig(config_dir.Append(kConfigFileName), &config_old);
if (FAILED(hr)) {
« no previous file with comments | « remoting/host/usage_stats_consent_mac.cc ('k') | remoting/host/win/host_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698