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

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

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/http_post.cc
diff --git a/components/copresence/rpc/http_post.cc b/components/copresence/rpc/http_post.cc
index 963f1921f7b66a84fac30c5e765285764906219d..02ccdd53deb32309b7e98c64b86b060923379acd 100644
--- a/components/copresence/rpc/http_post.cc
+++ b/components/copresence/rpc/http_post.cc
@@ -29,9 +29,7 @@ const char kApiKeyField[] = "key";
HttpPost::HttpPost(net::URLRequestContextGetter* url_context_getter,
const std::string& server_host,
const std::string& rpc_name,
- const google::protobuf::MessageLite& request_proto,
- const ResponseCallback& response_callback)
- : response_callback_(response_callback) {
+ const google::protobuf::MessageLite& request_proto) {
// Create the base URL to call.
GURL url(server_host + "/" + rpc_name);
@@ -65,6 +63,10 @@ HttpPost::HttpPost(net::URLRequestContextGetter* url_context_getter,
net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SEND_AUTH_DATA);
url_fetcher_->SetUploadData("application/x-protobuf", request_data);
+}
+
+void HttpPost::Start(const ResponseCallback& response_callback) {
+ response_callback_ = response_callback;
url_fetcher_->Start();
}
@@ -88,7 +90,7 @@ void HttpPost::OnURLFetchComplete(const net::URLFetcher* source) {
}
// Return the response.
- response_callback_.Run(response_code, response, this);
+ response_callback_.Run(response_code, response);
}
} // namespace copresence

Powered by Google App Engine
This is Rietveld 408576698