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

Unified Diff: cloud_print/gcp20/prototype/cloud_print_response_parser.cc

Issue 20238002: GCP2.0 Device: XMPP (without pings). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DEPS-jingle
Patch Set: Created 7 years, 5 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: cloud_print/gcp20/prototype/cloud_print_response_parser.cc
diff --git a/cloud_print/gcp20/prototype/cloud_print_response_parser.cc b/cloud_print/gcp20/prototype/cloud_print_response_parser.cc
index d4da3c33ed79598fc3337248d95cf54a47ac1e14..367a994e24f5a96c0407d86daa934a00afb84143 100644
--- a/cloud_print/gcp20/prototype/cloud_print_response_parser.cc
+++ b/cloud_print/gcp20/prototype/cloud_print_response_parser.cc
@@ -116,7 +116,8 @@ bool ParseRegisterStartResponse(const std::string& response,
bool ParseRegisterCompleteResponse(const std::string& response,
std::string* error_description,
- std::string* authorization_code_result) {
+ std::string* authorization_code_result,
+ std::string* xmpp_jid_result) {
scoped_ptr<base::Value> json(base::JSONReader::Read(response));
base::DictionaryValue* response_dictionary = NULL;
if (!GetJsonDictinaryAndCheckSuccess(json.get(), error_description,
@@ -131,7 +132,14 @@ bool ParseRegisterCompleteResponse(const std::string& response,
return false;
}
+ std::string xmpp_jid;
+ if (!response_dictionary->GetString("xmpp_jid", &xmpp_jid)) {
+ *error_description = "Cannot parse xmpp jid.";
+ return false;
+ }
+
*authorization_code_result = authorization_code;
+ *xmpp_jid_result = xmpp_jid;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698