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

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

Issue 453793002: Add audible support to the copresence API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
Index: components/copresence/rpc/rpc_handler.h
diff --git a/components/copresence/rpc/rpc_handler.h b/components/copresence/rpc/rpc_handler.h
index f5403f9684375bdd0a2839abed821944d6dbef44..e38fc1c543a7e444cc54b733f48c3101cdf12c09 100644
--- a/components/copresence/rpc/rpc_handler.h
+++ b/components/copresence/rpc/rpc_handler.h
@@ -31,6 +31,7 @@ class RpcHandler {
public:
// A callback to indicate whether handler initialization succeeded.
typedef base::Callback<void(bool)> SuccessCallback;
+ typedef base::Callback<void(HttpPost*, int, const std::string&)> PostCallback;
// Report rpc name to send to Apiary.
static const char kReportRequestRpcName[];
@@ -69,18 +70,18 @@ class RpcHandler {
typedef base::Callback<void(net::URLRequestContextGetter*,
const std::string&,
scoped_ptr<google::protobuf::MessageLite>,
- const HttpPost::ResponseCallback&)> PostCallback;
+ const PostCallback&)> SendPostCallback;
friend class RpcHandlerTest;
void RegisterResponseHandler(const SuccessCallback& init_done_callback,
+ HttpPost* completed_post,
int http_status_code,
- const std::string& response_data,
- HttpPost* completed_post);
+ const std::string& response_data);
void ReportResponseHandler(const StatusCallback& status_callback,
+ HttpPost* completed_post,
int http_status_code,
- const std::string& response_data,
- HttpPost* completed_post);
+ const std::string& response_data);
void DispatchMessages(
const google::protobuf::RepeatedPtrField<SubscribedMessage>&
@@ -92,24 +93,25 @@ class RpcHandler {
void SendServerRequest(const std::string& rpc_name,
const std::string& app_id,
scoped_ptr<T> request,
- const HttpPost::ResponseCallback& response_handler);
+ const PostCallback& response_handler);
// Wrapper for the http post constructor. This is the default way
// to contact the server, but it can be overridden for testing.
void SendHttpPost(net::URLRequestContextGetter* url_context_getter,
const std::string& rpc_name,
scoped_ptr<google::protobuf::MessageLite> request_proto,
- const HttpPost::ResponseCallback& callback);
+ const PostCallback& callback);
// This method receives the request to encode a token and forwards it to
// whispernet, setting the samples return callback to samples_callback.
void AudioDirectiveListToWhispernetConnector(
const std::string& token,
+ bool audible,
const WhispernetClient::SamplesCallback& samples_callback);
CopresenceClientDelegate* delegate_; // Belongs to the caller.
TimedMap<std::string, bool> invalid_audio_token_cache_;
- PostCallback server_post_callback_;
+ SendPostCallback server_post_callback_;
std::string device_id_;
scoped_ptr<DirectiveHandler> directive_handler_;

Powered by Google App Engine
This is Rietveld 408576698