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

Unified Diff: google_apis/gcm/engine/instance_id_get_token_request_handler.h

Issue 1137463003: Support getting and deleting token for Instance ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch to land Created 5 years, 7 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: google_apis/gcm/engine/instance_id_get_token_request_handler.h
diff --git a/google_apis/gcm/engine/instance_id_get_token_request_handler.h b/google_apis/gcm/engine/instance_id_get_token_request_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..c09b1ab7112fb9ef022e9c57ad55277d878128a7
--- /dev/null
+++ b/google_apis/gcm/engine/instance_id_get_token_request_handler.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_GET_TOKEN_REQUEST_HANDLER_H_
+#define GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_GET_TOKEN_REQUEST_HANDLER_H_
+
+#include <map>
+#include <string>
+
+#include "google_apis/gcm/engine/registration_request.h"
+
+namespace gcm {
+
+// Used to obtain a token based on Instance ID.
+class GCM_EXPORT InstanceIDGetTokenRequestHandler :
+ public RegistrationRequest::CustomRequestHandler {
+ public:
+ InstanceIDGetTokenRequestHandler(
+ const std::string& instance_id,
+ const std::string& authorized_entity,
+ const std::string& scope,
+ int gcm_version,
+ const std::map<std::string, std::string>& options);
+ ~InstanceIDGetTokenRequestHandler() override;
+
+ // RegistrationRequest overrides:
+ void BuildRequestBody(std::string* body) override;
+
+ private:
+ std::string instance_id_;
+ std::string authorized_entity_;
+ std::string scope_;
+ int gcm_version_;
+ std::map<std::string, std::string> options_;
+
+ DISALLOW_COPY_AND_ASSIGN(InstanceIDGetTokenRequestHandler);
+};
+
+} // namespace gcm
+
+#endif // GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_GET_TOKEN_REQUEST_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698