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

Unified Diff: google_apis/gcm/engine/instance_id_delete_token_request_handler.cc

Issue 2434243002: GCM Engine: Split up reg/unreg UNKNOWN_ERROR to improve metrics (Closed)
Patch Set: mid-cycle -> mid-beta Created 4 years, 1 month 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_delete_token_request_handler.cc
diff --git a/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc b/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc
index 7e5d232cee00c3602962e0141ad5cac7781cd383..b3ef7a8cbeabc58482c4d352b8ebf08e6889da50 100644
--- a/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc
+++ b/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc
@@ -24,8 +24,6 @@ const char kExtraScopeKey[] = "X-scope";
// Response constants.
const char kTokenPrefix[] = "token=";
-const char kErrorPrefix[] = "Error=";
-const char kInvalidParameters[] = "INVALID_PARAMETERS";
} // namespace
@@ -55,21 +53,7 @@ void InstanceIDDeleteTokenRequestHandler::BuildRequestBody(std::string* body){
UnregistrationRequest::Status
InstanceIDDeleteTokenRequestHandler::ParseResponse(
- const net::URLFetcher* source) {
- std::string response;
- if (!source->GetResponseAsString(&response)) {
- DVLOG(1) << "Failed to get response body.";
- return UnregistrationRequest::NO_RESPONSE_BODY;
- }
-
- if (response.find(kErrorPrefix) != std::string::npos) {
- std::string error = response.substr(
- response.find(kErrorPrefix) + arraysize(kErrorPrefix) - 1);
- return error == kInvalidParameters ?
- UnregistrationRequest::INVALID_PARAMETERS :
- UnregistrationRequest::UNKNOWN_ERROR;
- }
-
+ const std::string& response) {
if (response.find(kTokenPrefix) == std::string::npos)
return UnregistrationRequest::RESPONSE_PARSING_FAILED;
« no previous file with comments | « google_apis/gcm/engine/instance_id_delete_token_request_handler.h ('k') | google_apis/gcm/engine/registration_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698