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

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

Issue 764673003: Adding CopresenceState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « components/copresence/rpc/rpc_handler.h ('k') | 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 78bd95835f1989bb4b3c09dba344cbd407cbdb18..28276ea828b0e2e84314f1fffc08b14242405a28 100644
--- a/components/copresence/rpc/rpc_handler.cc
+++ b/components/copresence/rpc/rpc_handler.cc
@@ -19,6 +19,7 @@
#undef DeviceCapabilities
#endif
+#include "components/copresence/copresence_state_impl.h"
#include "components/copresence/copresence_switches.h"
#include "components/copresence/handlers/directive_handler.h"
#include "components/copresence/handlers/gcm_handler.h"
@@ -165,10 +166,12 @@ void AddTokenToRequest(const AudioToken& token, ReportRequest* request) {
// Public functions.
RpcHandler::RpcHandler(CopresenceDelegate* delegate,
+ CopresenceStateImpl* state,
DirectiveHandler* directive_handler,
GCMHandler* gcm_handler,
const PostCallback& server_post_callback)
: delegate_(delegate),
+ state_(state),
directive_handler_(directive_handler),
gcm_handler_(gcm_handler),
server_post_callback_(server_post_callback),
@@ -491,6 +494,7 @@ void RpcHandler::ReportResponseHandler(const StatusCallback& status_callback,
directive_handler_->AddDirective(directive);
for (const Token& token : update_response.token()) {
+ state_->UpdateTokenStatus(token.id(), token.status());
switch (token.status()) {
case VALID:
// TODO(rkc/ckehoe): Store the token in a |valid_token_cache_| with a
« no previous file with comments | « components/copresence/rpc/rpc_handler.h ('k') | components/copresence/rpc/rpc_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698