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

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

Issue 469883002: Using API key specified from js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing API build 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 | « components/copresence/public/copresence_client_delegate.h ('k') | components/copresence/rpc/http_post.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/rpc/http_post.h
diff --git a/components/copresence/rpc/http_post.h b/components/copresence/rpc/http_post.h
index c4c6e7f46943f137869f207f884c652daeabe26f..53a3d1c37f4a519d7fead60751742c8eeaff58e3 100644
--- a/components/copresence/rpc/http_post.h
+++ b/components/copresence/rpc/http_post.h
@@ -36,19 +36,14 @@ class HttpPost : public net::URLFetcherDelegate {
typedef base::Callback<void(int, const std::string&)>
ResponseCallback;
- // An id for testing url fetching.
- static const int kUrlFetcherId = 1;
-
- // The query parameter to send Apiary tracing tokens.
- static const char kTracingTokenField[];
-
- // Create a request to the Copresence server. |url_context_getter|
- // is owned by the caller, and the context it provides must be available
- // until the request completes.
+ // Create a request to the Copresence server.
+ // |url_context_getter| is owned by the caller,
+ // and the context it provides must be available until the request completes.
HttpPost(net::URLRequestContextGetter* url_context_getter,
const std::string& server_host,
const std::string& rpc_name,
const std::string& tracing_token,
+ std::string api_key, // If blank, we overwrite with a default.
const google::protobuf::MessageLite& request_proto);
// HTTP requests are cancelled on delete.
@@ -58,10 +53,17 @@ class HttpPost : public net::URLFetcherDelegate {
void Start(const ResponseCallback& response_callback);
private:
+ static const int kUrlFetcherId = 1;
+ static const char kApiKeyField[];
+ static const char kTracingTokenField[];
+
+ friend class HttpPostTest;
+
// Overridden from net::URLFetcherDelegate.
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
ResponseCallback response_callback_;
+
scoped_ptr<net::URLFetcher> url_fetcher_;
DISALLOW_COPY_AND_ASSIGN(HttpPost);
« no previous file with comments | « components/copresence/public/copresence_client_delegate.h ('k') | components/copresence/rpc/http_post.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698