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

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

Issue 281223002: Removed LOG_GETLASTERROR and LOG_ERRNO macros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wed 05/14/2014 11:20:03.21 Created 6 years, 7 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/win/com_security.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 d826dc9e84a6bc8db91c481dbdcb95f0abc1327f..7da5ab8f295e181708bbeda41aeeb92f61f858b6 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -108,8 +108,7 @@ HRESULT ReadConfig(const base::FilePath& filename,
if (!file.IsValid()) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to open '" << filename.value() << "'";
+ PLOG(ERROR) << "Failed to open '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
}
@@ -117,8 +116,7 @@ HRESULT ReadConfig(const base::FilePath& filename,
DWORD size = kMaxConfigFileSize;
if (!::ReadFile(file, &buffer[0], size, &size, NULL)) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to read '" << filename.value() << "'";
+ PLOG(ERROR) << "Failed to read '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
}
@@ -151,8 +149,8 @@ HRESULT WriteConfigFileToTemp(const base::FilePath& filename,
ScopedSd sd = ConvertSddlToSd(security_descriptor);
if (!sd) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR) <<
- "Failed to create a security descriptor for the configuration file";
+ PLOG(ERROR)
+ << "Failed to create a security descriptor for the configuration file";
return HRESULT_FROM_WIN32(error);
}
@@ -174,16 +172,14 @@ HRESULT WriteConfigFileToTemp(const base::FilePath& filename,
if (!file.IsValid()) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to create '" << filename.value() << "'";
+ PLOG(ERROR) << "Failed to create '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
}
DWORD written;
if (!WriteFile(file, content, static_cast<DWORD>(length), &written, NULL)) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to write to '" << filename.value() << "'";
+ PLOG(ERROR) << "Failed to write to '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
}
@@ -199,9 +195,8 @@ HRESULT MoveConfigFileFromTemp(const base::FilePath& filename) {
filename.value().c_str(),
MOVEFILE_REPLACE_EXISTING)) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to rename '" << tempname.value() << "' to '"
- << filename.value() << "'";
+ PLOG(ERROR) << "Failed to rename '" << tempname.value() << "' to '"
+ << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
}
@@ -389,9 +384,8 @@ STDMETHODIMP ElevatedController::StartDaemon() {
NULL,
NULL)) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to change the '" << kWindowsServiceName
- << "'service start type to 'auto'";
+ PLOG(ERROR) << "Failed to change the '" << kWindowsServiceName
+ << "'service start type to 'auto'";
return HRESULT_FROM_WIN32(error);
}
@@ -399,8 +393,8 @@ STDMETHODIMP ElevatedController::StartDaemon() {
if (!StartService(service, 0, NULL)) {
DWORD error = GetLastError();
if (error != ERROR_SERVICE_ALREADY_RUNNING) {
- LOG_GETLASTERROR(ERROR)
- << "Failed to start the '" << kWindowsServiceName << "'service";
+ PLOG(ERROR) << "Failed to start the '" << kWindowsServiceName
+ << "'service";
return HRESULT_FROM_WIN32(error);
}
@@ -429,9 +423,8 @@ STDMETHODIMP ElevatedController::StopDaemon() {
NULL,
NULL)) {
DWORD error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to change the '" << kWindowsServiceName
- << "'service start type to 'manual'";
+ PLOG(ERROR) << "Failed to change the '" << kWindowsServiceName
+ << "'service start type to 'manual'";
return HRESULT_FROM_WIN32(error);
}
@@ -440,8 +433,8 @@ STDMETHODIMP ElevatedController::StopDaemon() {
if (!ControlService(service, SERVICE_CONTROL_STOP, &status)) {
DWORD error = GetLastError();
if (error != ERROR_SERVICE_NOT_ACTIVE) {
- LOG_GETLASTERROR(ERROR)
- << "Failed to stop the '" << kWindowsServiceName << "'service";
+ PLOG(ERROR) << "Failed to stop the '" << kWindowsServiceName
+ << "'service";
return HRESULT_FROM_WIN32(error);
}
}
@@ -512,8 +505,7 @@ HRESULT ElevatedController::OpenService(ScopedScHandle* service_out) {
SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE));
if (!scmanager.IsValid()) {
error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to connect to the service control manager";
+ PLOG(ERROR) << "Failed to connect to the service control manager";
return HRESULT_FROM_WIN32(error);
}
@@ -524,8 +516,8 @@ HRESULT ElevatedController::OpenService(ScopedScHandle* service_out) {
::OpenServiceW(scmanager, kWindowsServiceName, desired_access));
if (!service.IsValid()) {
error = GetLastError();
- LOG_GETLASTERROR(ERROR)
- << "Failed to open to the '" << kWindowsServiceName << "' service";
+ PLOG(ERROR) << "Failed to open to the '" << kWindowsServiceName
+ << "' service";
return HRESULT_FROM_WIN32(error);
}
« no previous file with comments | « remoting/host/win/com_security.cc ('k') | remoting/host/win/host_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698