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

Unified Diff: cloud_print/service/win/cloud_print_service.cc

Issue 731373002: Enable MSVC warning for unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: cloud_print/service/win/cloud_print_service.cc
diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc
index 55652692f3bd636d8fd5610cc4634ef2343aa4b8..182ff2dc1b42a27f15fb1bb8debaf5b0cf74974f 100644
--- a/cloud_print/service/win/cloud_print_service.cc
+++ b/cloud_print/service/win/cloud_print_service.cc
@@ -2,7 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Work around warning in atlbase.h
+// https://connect.microsoft.com/VisualStudio/feedback/details/1032199/atlbase-h-gives-warning-c4189-when-compiling-with-atl-no-com-support
+#pragma warning(push)
+#pragma warning(disable:4189)
#include <atlbase.h>
+#pragma warning(pop)
#include <security.h>
#include <iomanip>
@@ -334,9 +339,11 @@ class CloudPrintServiceModule
std::string contents;
ServiceState service_state;
+ if (!base::ReadFileToString(file, &contents) ||
+ !service_state.FromString(contents)) {
+ return ReportError(E_FAIL, IDS_ERROR_FAILED_CREATE_CONFIG);
Peter Kasting 2014/11/18 00:41:03 We never checked the value of |is_valid| before.
+ }
- bool is_valid = base::ReadFileToString(file, &contents) &&
- service_state.FromString(contents);
std::string proxy_id = service_state.proxy_id();
LOG(INFO) << file.value() << ": " << contents;

Powered by Google App Engine
This is Rietveld 408576698