| 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_;
|
|
|