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

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

Issue 485793003: Removing OptInStateFilter settings, which are only for authenticated users. (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 1e1bd6ffcd5b6b35f40197c446aa92d01cb6730c..dc4942f73c04ce1cc91ffca712d166cfb027212f 100644
--- a/components/copresence/rpc/rpc_handler.cc
+++ b/components/copresence/rpc/rpc_handler.cc
@@ -206,40 +206,6 @@ void AddTokenToRequest(ReportRequest* request, const AudioToken& token) {
signals->set_observed_time_millis(base::Time::Now().ToJsTime());
}
-OptInStateFilter* CreateOptedInOrOutFilter() {
- OptInStateFilter* filter = new OptInStateFilter;
- filter->add_allowed_opt_in_state(copresence::OPTED_IN);
- filter->add_allowed_opt_in_state(copresence::OPTED_OUT);
- return filter;
-}
-
-void AllowOptedOutMessages(ReportRequest* request) {
- // TODO(ckehoe): Collapse this pattern into ProcessPublish()
- // and ProcessSubscribe() methods.
-
- 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) {
- PublishedMessage* message = messages->Mutable(i);
- if (!message->has_opt_in_state_filter())
- message->set_allocated_opt_in_state_filter(CreateOptedInOrOutFilter());
- }
- }
-
- if (request->has_manage_subscriptions_request()) {
- RepeatedPtrField<Subscription>* subscriptions =
- request->mutable_manage_subscriptions_request()->mutable_subscription();
- for (int i = 0; i < subscriptions->size(); ++i) {
- Subscription* subscription = subscriptions->Mutable(i);
- if (!subscription->has_opt_in_state_filter()) {
- subscription->set_allocated_opt_in_state_filter(
- CreateOptedInOrOutFilter());
- }
- }
- }
-}
-
} // namespace
// Public methods
@@ -306,7 +272,6 @@ void RpcHandler::SendReportRequest(scoped_ptr<ReportRequest> request,
AddPlayingTokens(request.get());
- AllowOptedOutMessages(request.get());
SendServerRequest(kReportRequestRpcName,
app_id,
request.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