summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-05 20:18:15 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-05 20:18:15 +0000
commit864b73c7621db7180fc6a693cf353f8c49a7348e (patch)
treec49990d64c2c54425d3a42ebe37476eda8f351db /google_apis
parent208645b763a757549d71f61c1d10163ab728bd00 (diff)
downloadchromium_src-864b73c7621db7180fc6a693cf353f8c49a7348e.zip
chromium_src-864b73c7621db7180fc6a693cf353f8c49a7348e.tar.gz
chromium_src-864b73c7621db7180fc6a693cf353f8c49a7348e.tar.bz2
[GCM] Remove the requirement for manifest key
We also remove cert from the registration request. BUG=345413 TEST=tests updated R=fgorski@chromium.org, tim@chromium.org, zea@chromium.org Review URL: https://codereview.chromium.org/179043005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gcm/engine/registration_request.cc5
-rw-r--r--google_apis/gcm/engine/registration_request.h1
-rw-r--r--google_apis/gcm/engine/registration_request_unittest.cc3
-rw-r--r--google_apis/gcm/gcm_client.h4
-rw-r--r--google_apis/gcm/gcm_client_impl.cc2
-rw-r--r--google_apis/gcm/gcm_client_impl.h1
-rw-r--r--google_apis/gcm/gcm_client_impl_unittest.cc2
7 files changed, 1 insertions, 17 deletions
diff --git a/google_apis/gcm/engine/registration_request.cc b/google_apis/gcm/engine/registration_request.cc
index 3acd591..db6981d 100644
--- a/google_apis/gcm/engine/registration_request.cc
+++ b/google_apis/gcm/engine/registration_request.cc
@@ -28,7 +28,6 @@ const char kRegistrationRequestContentType[] =
// Request constants.
const char kAppIdKey[] = "app";
-const char kCertKey[] = "cert";
const char kDeviceIdKey[] = "device";
const char kLoginHeader[] = "AidLogin";
const char kSenderKey[] = "sender";
@@ -89,12 +88,10 @@ RegistrationRequest::RequestInfo::RequestInfo(
uint64 android_id,
uint64 security_token,
const std::string& app_id,
- const std::string& cert,
const std::vector<std::string>& sender_ids)
: android_id(android_id),
security_token(security_token),
app_id(app_id),
- cert(cert),
sender_ids(sender_ids) {
}
@@ -121,7 +118,6 @@ void RegistrationRequest::Start() {
DCHECK(!callback_.is_null());
DCHECK(request_info_.android_id != 0UL);
DCHECK(request_info_.security_token != 0UL);
- DCHECK(!request_info_.cert.empty());
DCHECK(0 < request_info_.sender_ids.size() &&
request_info_.sender_ids.size() <= kMaxSenders);
@@ -139,7 +135,6 @@ void RegistrationRequest::Start() {
std::string body;
BuildFormEncoding(kAppIdKey, request_info_.app_id, &body);
- BuildFormEncoding(kCertKey, request_info_.cert, &body);
BuildFormEncoding(kDeviceIdKey, android_id, &body);
std::string senders;
diff --git a/google_apis/gcm/engine/registration_request.h b/google_apis/gcm/engine/registration_request.h
index c5aff57..7b7acbb 100644
--- a/google_apis/gcm/engine/registration_request.h
+++ b/google_apis/gcm/engine/registration_request.h
@@ -62,7 +62,6 @@ class GCM_EXPORT RegistrationRequest : public net::URLFetcherDelegate {
RequestInfo(uint64 android_id,
uint64 security_token,
const std::string& app_id,
- const std::string& cert,
const std::vector<std::string>& sender_ids);
~RequestInfo();
diff --git a/google_apis/gcm/engine/registration_request_unittest.cc b/google_apis/gcm/engine/registration_request_unittest.cc
index f08c4f4..9efb4e1 100644
--- a/google_apis/gcm/engine/registration_request_unittest.cc
+++ b/google_apis/gcm/engine/registration_request_unittest.cc
@@ -19,7 +19,6 @@ namespace gcm {
namespace {
const uint64 kAndroidId = 42UL;
const char kAppId[] = "TestAppId";
-const char kCert[] = "0DEADBEEF420";
const char kDeveloperId[] = "Project1";
const char kLoginHeader[] = "AidLogin";
const uint64 kSecurityToken = 77UL;
@@ -110,7 +109,6 @@ void RegistrationRequestTest::CreateRequest(const std::string& sender_ids) {
RegistrationRequest::RequestInfo(kAndroidId,
kSecurityToken,
kAppId,
- kCert,
senders),
kDefaultBackoffPolicy,
base::Bind(&RegistrationRequestTest::RegistrationCallback,
@@ -175,7 +173,6 @@ TEST_F(RegistrationRequestTest, RequestDataPassedToFetcher) {
std::map<std::string, std::string> expected_pairs;
expected_pairs["app"] = kAppId;
expected_pairs["sender"] = kDeveloperId;
- expected_pairs["cert"] = kCert;
expected_pairs["device"] = base::Uint64ToString(kAndroidId);
// Verify data was formatted properly.
diff --git a/google_apis/gcm/gcm_client.h b/google_apis/gcm/gcm_client.h
index a25cb12..f0b1bac 100644
--- a/google_apis/gcm/gcm_client.h
+++ b/google_apis/gcm/gcm_client.h
@@ -40,8 +40,6 @@ class GCM_EXPORT GCMClient {
INVALID_PARAMETER,
// Profile not signed in.
NOT_SIGNED_IN,
- // Certificate was missing. Certain operation, like register, requires it.
- CERTIFICATE_MISSING,
// Previous asynchronous operation is still pending to finish. Certain
// operation, like register, is only allowed one at a time.
ASYNC_OPERATION_PENDING,
@@ -166,12 +164,10 @@ class GCM_EXPORT GCMClient {
// Registers the application for GCM. Delegate::OnRegisterFinished will be
// called asynchronously upon completion.
// |app_id|: application ID.
- // |cert|: SHA-1 of public key of the application, in base16 format.
// |sender_ids|: list of IDs of the servers that are allowed to send the
// messages to the application. These IDs are assigned by the
// Google API Console.
virtual void Register(const std::string& app_id,
- const std::string& cert,
const std::vector<std::string>& sender_ids) = 0;
// Unregisters the application from GCM when it is uninstalled.
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index aa12ee8..19b3d54 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -302,14 +302,12 @@ void GCMClientImpl::CheckOut() {
}
void GCMClientImpl::Register(const std::string& app_id,
- const std::string& cert,
const std::vector<std::string>& sender_ids) {
DCHECK_EQ(state_, READY);
RegistrationRequest::RequestInfo request_info(
device_checkin_info_.android_id,
device_checkin_info_.secret,
app_id,
- cert,
sender_ids);
DCHECK_EQ(0u, pending_registrations_.count(app_id));
diff --git a/google_apis/gcm/gcm_client_impl.h b/google_apis/gcm/gcm_client_impl.h
index 247360a..4050b36 100644
--- a/google_apis/gcm/gcm_client_impl.h
+++ b/google_apis/gcm/gcm_client_impl.h
@@ -59,7 +59,6 @@ class GCM_EXPORT GCMClientImpl : public GCMClient {
virtual void Stop() OVERRIDE;
virtual void CheckOut() OVERRIDE;
virtual void Register(const std::string& app_id,
- const std::string& cert,
const std::vector<std::string>& sender_ids) OVERRIDE;
virtual void Unregister(const std::string& app_id) OVERRIDE;
virtual void Send(const std::string& app_id,
diff --git a/google_apis/gcm/gcm_client_impl_unittest.cc b/google_apis/gcm/gcm_client_impl_unittest.cc
index d45a0fc..b6c401e 100644
--- a/google_apis/gcm/gcm_client_impl_unittest.cc
+++ b/google_apis/gcm/gcm_client_impl_unittest.cc
@@ -366,7 +366,7 @@ TEST_F(GCMClientImplTest, CheckOut) {
TEST_F(GCMClientImplTest, RegisterApp) {
std::vector<std::string> senders;
senders.push_back("sender");
- gcm_client()->Register("app_id", "cert", senders);
+ gcm_client()->Register("app_id", senders);
CompleteRegistration("reg_id");
EXPECT_EQ(REGISTRATION_COMPLETED, last_event());