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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 callback_.Run(false, std::string(), base::TimeDelta()); | 75 callback_.Run(false, std::string(), base::TimeDelta()); |
76 return; | 76 return; |
77 } | 77 } |
78 DCHECK_EQ(message_loop_, MessageLoop::current()); | 78 DCHECK_EQ(message_loop_, MessageLoop::current()); |
79 request_.reset(); | 79 request_.reset(); |
80 } | 80 } |
81 | 81 |
82 // Ignore any notifications other than signalling | 82 // Ignore any notifications other than signalling |
83 // connected/disconnected events. | 83 // connected/disconnected events. |
84 void RegisterSupportHostRequest::OnAccessDenied() { } | 84 void RegisterSupportHostRequest::OnAccessDenied() { } |
85 void RegisterSupportHostRequest::OnAuthenticatedClientsChanged(int clients) { } | 85 void RegisterSupportHostRequest::OnClientAuthenticated( |
| 86 remoting::protocol::ConnectionToClient* client) { } |
| 87 void RegisterSupportHostRequest::OnClientDisconnected( |
| 88 remoting::protocol::ConnectionToClient* client) { } |
86 void RegisterSupportHostRequest::OnShutdown() { } | 89 void RegisterSupportHostRequest::OnShutdown() { } |
87 | 90 |
88 XmlElement* RegisterSupportHostRequest::CreateRegistrationRequest( | 91 XmlElement* RegisterSupportHostRequest::CreateRegistrationRequest( |
89 const std::string& jid) { | 92 const std::string& jid) { |
90 XmlElement* query = new XmlElement( | 93 XmlElement* query = new XmlElement( |
91 QName(kChromotingXmlNamespace, kRegisterQueryTag)); | 94 QName(kChromotingXmlNamespace, kRegisterQueryTag)); |
92 XmlElement* public_key = new XmlElement( | 95 XmlElement* public_key = new XmlElement( |
93 QName(kChromotingXmlNamespace, kPublicKeyTag)); | 96 QName(kChromotingXmlNamespace, kPublicKeyTag)); |
94 public_key->AddText(key_pair_.GetPublicKey()); | 97 public_key->AddText(key_pair_.GetPublicKey()); |
95 query->AddElement(public_key); | 98 query->AddElement(public_key); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 175 |
173 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) { | 176 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) { |
174 DCHECK_EQ(message_loop_, MessageLoop::current()); | 177 DCHECK_EQ(message_loop_, MessageLoop::current()); |
175 std::string support_id; | 178 std::string support_id; |
176 base::TimeDelta lifetime; | 179 base::TimeDelta lifetime; |
177 bool success = ParseResponse(response, &support_id, &lifetime); | 180 bool success = ParseResponse(response, &support_id, &lifetime); |
178 callback_.Run(success, support_id, lifetime); | 181 callback_.Run(success, support_id, lifetime); |
179 } | 182 } |
180 | 183 |
181 } // namespace remoting | 184 } // namespace remoting |
OLD | NEW |