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

Unified Diff: google_apis/gcm/engine/gcm_unregistration_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/gcm_unregistration_request_handler.cc
diff --git a/google_apis/gcm/engine/gcm_unregistration_request_handler.cc b/google_apis/gcm/engine/gcm_unregistration_request_handler.cc
index 2e1fde66bc67c5577de1d4794bb58ba86498f18d..d623bd19aa7c7fcd56e5ca659614f56ae36b1388 100644
--- a/google_apis/gcm/engine/gcm_unregistration_request_handler.cc
+++ b/google_apis/gcm/engine/gcm_unregistration_request_handler.cc
@@ -21,8 +21,6 @@ const char kUnregistrationCallerValue[] = "false";
// Response constants.
const char kDeletedPrefix[] = "deleted=";
-const char kErrorPrefix[] = "Error=";
-const char kInvalidParameters[] = "INVALID_PARAMETERS";
} // namespace
@@ -38,13 +36,7 @@ void GCMUnregistrationRequestHandler::BuildRequestBody(std::string* body){
}
UnregistrationRequest::Status GCMUnregistrationRequestHandler::ParseResponse(
- const net::URLFetcher* source) {
- std::string response;
- if (!source->GetResponseAsString(&response)) {
- DVLOG(1) << "Failed to get response body.";
- return UnregistrationRequest::NO_RESPONSE_BODY;
- }
-
+ const std::string& response) {
DVLOG(1) << "Parsing unregistration response.";
if (response.find(kDeletedPrefix) != std::string::npos) {
std::string deleted_app_id = response.substr(
@@ -54,14 +46,6 @@ UnregistrationRequest::Status GCMUnregistrationRequestHandler::ParseResponse(
UnregistrationRequest::INCORRECT_APP_ID;
}
- 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;
- }
-
DVLOG(1) << "Not able to parse a meaningful output from response body."
<< response;
return UnregistrationRequest::RESPONSE_PARSING_FAILED;

Powered by Google App Engine
This is Rietveld 408576698