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

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

Issue 483323005: Workaround until the server fully supports BroadcastScanConfiguration (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 | no next file » | 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 dc4942f73c04ce1cc91ffca712d166cfb027212f..481c202618ade67464d2960634ed8f970872f4d2 100644
--- a/components/copresence/rpc/rpc_handler.cc
+++ b/components/copresence/rpc/rpc_handler.cc
@@ -272,6 +272,25 @@ void RpcHandler::SendReportRequest(scoped_ptr<ReportRequest> request,
AddPlayingTokens(request.get());
+ // TODO(ckehoe): Currently the server supports only BROADCAST_AND_SCAN.
+ // Remove this once b/16715253 is fixed.
+ if (request->has_manage_messages_request()) {
+ RepeatedPtrField<PublishedMessage>* messages = request
+ ->mutable_manage_messages_request()->mutable_message_to_publish();
+ for (int i = 0; i < messages->size(); ++i) {
+ messages->Mutable(i)->mutable_token_exchange_strategy()
+ ->set_broadcast_scan_configuration(BROADCAST_AND_SCAN);
+ }
+ }
+ if (request->has_manage_subscriptions_request()) {
+ RepeatedPtrField<Subscription>* subscriptions =
+ request->mutable_manage_subscriptions_request()->mutable_subscription();
+ for (int i = 0; i < subscriptions->size(); ++i) {
+ subscriptions->Mutable(i)->mutable_token_exchange_strategy()
+ ->set_broadcast_scan_configuration(BROADCAST_AND_SCAN);
+ }
+ }
+
SendServerRequest(kReportRequestRpcName,
app_id,
request.Pass(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698