OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/register_support_host_request.h" | 5 #include "remoting/host/register_support_host_request.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 std::string* support_id, | 122 std::string* support_id, |
123 base::TimeDelta* lifetime) { | 123 base::TimeDelta* lifetime) { |
124 std::string type = response->Attr(buzz::QN_TYPE); | 124 std::string type = response->Attr(buzz::QN_TYPE); |
125 if (type == buzz::STR_ERROR) { | 125 if (type == buzz::STR_ERROR) { |
126 LOG(ERROR) << "Received error in response to heartbeat: " | 126 LOG(ERROR) << "Received error in response to heartbeat: " |
127 << response->Str(); | 127 << response->Str(); |
128 return false; | 128 return false; |
129 } | 129 } |
130 | 130 |
131 // This method must only be called for error or result stanzas. | 131 // This method must only be called for error or result stanzas. |
132 DCHECK_EQ(buzz::STR_RESULT, type); | 132 DCHECK_EQ(std::string(buzz::STR_RESULT), type); |
133 | 133 |
134 const XmlElement* result_element = response->FirstNamed(QName( | 134 const XmlElement* result_element = response->FirstNamed(QName( |
135 kChromotingXmlNamespace, kRegisterQueryResultTag)); | 135 kChromotingXmlNamespace, kRegisterQueryResultTag)); |
136 if (!result_element) { | 136 if (!result_element) { |
137 LOG(ERROR) << "<" << kRegisterQueryResultTag | 137 LOG(ERROR) << "<" << kRegisterQueryResultTag |
138 << "> is missing in the host registration response: " | 138 << "> is missing in the host registration response: " |
139 << response->Str(); | 139 << response->Str(); |
140 return false; | 140 return false; |
141 } | 141 } |
142 | 142 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) { | 177 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) { |
178 DCHECK_EQ(message_loop_, MessageLoop::current()); | 178 DCHECK_EQ(message_loop_, MessageLoop::current()); |
179 std::string support_id; | 179 std::string support_id; |
180 base::TimeDelta lifetime; | 180 base::TimeDelta lifetime; |
181 bool success = ParseResponse(response, &support_id, &lifetime); | 181 bool success = ParseResponse(response, &support_id, &lifetime); |
182 callback_.Run(success, support_id, lifetime); | 182 callback_.Run(success, support_id, lifetime); |
183 } | 183 } |
184 | 184 |
185 } // namespace remoting | 185 } // namespace remoting |
OLD | NEW |