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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return; | 77 return; |
78 } | 78 } |
79 DCHECK_EQ(message_loop_, MessageLoop::current()); | 79 DCHECK_EQ(message_loop_, MessageLoop::current()); |
80 request_.reset(); | 80 request_.reset(); |
81 } | 81 } |
82 | 82 |
83 // Ignore any notifications other than signalling | 83 // Ignore any notifications other than signalling |
84 // connected/disconnected events. | 84 // connected/disconnected events. |
85 void RegisterSupportHostRequest::OnAccessDenied() { } | 85 void RegisterSupportHostRequest::OnAccessDenied() { } |
86 void RegisterSupportHostRequest::OnClientAuthenticated( | 86 void RegisterSupportHostRequest::OnClientAuthenticated( |
87 remoting::protocol::ConnectionToClient* client) { } | 87 const std::string& jid) { } |
88 void RegisterSupportHostRequest::OnClientDisconnected( | 88 void RegisterSupportHostRequest::OnClientDisconnected( |
89 remoting::protocol::ConnectionToClient* client) { } | 89 const std::string& jid) { } |
90 void RegisterSupportHostRequest::OnShutdown() { } | 90 void RegisterSupportHostRequest::OnShutdown() { } |
91 | 91 |
92 XmlElement* RegisterSupportHostRequest::CreateRegistrationRequest( | 92 XmlElement* RegisterSupportHostRequest::CreateRegistrationRequest( |
93 const std::string& jid) { | 93 const std::string& jid) { |
94 XmlElement* query = new XmlElement( | 94 XmlElement* query = new XmlElement( |
95 QName(kChromotingXmlNamespace, kRegisterQueryTag)); | 95 QName(kChromotingXmlNamespace, kRegisterQueryTag)); |
96 XmlElement* public_key = new XmlElement( | 96 XmlElement* public_key = new XmlElement( |
97 QName(kChromotingXmlNamespace, kPublicKeyTag)); | 97 QName(kChromotingXmlNamespace, kPublicKeyTag)); |
98 public_key->AddText(key_pair_.GetPublicKey()); | 98 public_key->AddText(key_pair_.GetPublicKey()); |
99 query->AddElement(public_key); | 99 query->AddElement(public_key); |
(...skipping 76 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 |