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

Unified Diff: components/copresence/rpc/rpc_handler.cc

Issue 503253002: Fixing Windows build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | components/copresence/rpc/rpc_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/rpc/rpc_handler.cc
diff --git a/components/copresence/rpc/rpc_handler.cc b/components/copresence/rpc/rpc_handler.cc
index 481c202618ade67464d2960634ed8f970872f4d2..50cd3625d05b9b306f986e490721e2d220eca8e2 100644
--- a/components/copresence/rpc/rpc_handler.cc
+++ b/components/copresence/rpc/rpc_handler.cc
@@ -11,7 +11,15 @@
#include "base/guid.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
+
+// TODO(ckehoe): time.h includes windows.h, which #defines DeviceCapabilities
+// to DeviceCapabilitiesW. This breaks the pb.h headers below. For now,
+// we fix this with an #undef.
#include "base/time/time.h"
+#if defined(OS_WIN)
Charlie 2014/08/26 16:37:50 Maybe this should say #if defined(DeviceCapabiliti
rkc 2014/08/26 16:45:14 This seems more apt; self-documents to be a Window
+#undef DeviceCapabilities
+#endif
+
#include "components/copresence/copresence_switches.h"
#include "components/copresence/handlers/directive_handler.h"
#include "components/copresence/proto/codes.pb.h"
@@ -162,8 +170,6 @@ bool ExtractIsAudibleStrategy(const ReportRequest& request) {
scoped_ptr<DeviceState> GetDeviceCapabilities(const ReportRequest& request) {
scoped_ptr<DeviceState> state(new DeviceState);
-// TODO(ckehoe): Currently this code causes a linker error on Windows.
-#ifndef OS_WIN
TokenTechnology* token_technology =
state->mutable_capabilities()->add_token_technology();
token_technology->set_medium(AUDIO_ULTRASOUND_PASSBAND);
@@ -176,7 +182,6 @@ scoped_ptr<DeviceState> GetDeviceCapabilities(const ReportRequest& request) {
token_technology->add_instruction_type(TRANSMIT);
if (config == SCAN_ONLY || config == BROADCAST_AND_SCAN)
token_technology->add_instruction_type(RECEIVE);
-#endif
return state.Pass();
}
« no previous file with comments | « no previous file | components/copresence/rpc/rpc_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698