| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ | 5 #ifndef REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ |
| 6 #define REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ | 6 #define REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // connected. When a response is received from the bot, it calls the | 34 // connected. When a response is received from the bot, it calls the |
| 35 // callback specified in the Init() method. | 35 // callback specified in the Init() method. |
| 36 class RegisterSupportHostRequest : public SignalStrategy::Listener { | 36 class RegisterSupportHostRequest : public SignalStrategy::Listener { |
| 37 public: | 37 public: |
| 38 // First parameter is set to true on success. Second parameter is | 38 // First parameter is set to true on success. Second parameter is |
| 39 // the new SessionID received from the bot. Third parameter is the | 39 // the new SessionID received from the bot. Third parameter is the |
| 40 // amount of time until that id expires. | 40 // amount of time until that id expires. |
| 41 typedef base::Callback<void(bool, const std::string&, | 41 typedef base::Callback<void(bool, const std::string&, |
| 42 const base::TimeDelta&)> RegisterCallback; | 42 const base::TimeDelta&)> RegisterCallback; |
| 43 | 43 |
| 44 // Doesn't take ownership of |signal_strategy| or |key_pair|. Both | |
| 45 // |signal_strategy| and |key_pair| must outlive this | 44 // |signal_strategy| and |key_pair| must outlive this |
| 46 // object. |callback| is called when registration response is | 45 // object. |callback| is called when registration response is |
| 47 // received from the server. Callback is never called if the bot | 46 // received from the server. Callback is never called if the bot |
| 48 // malfunctions and doesn't respond to the request. | 47 // malfunctions and doesn't respond to the request. |
| 49 // | 48 // |
| 50 // TODO(sergeyu): This class should have timeout for the bot | 49 // TODO(sergeyu): This class should have timeout for the bot |
| 51 // response. | 50 // response. |
| 52 RegisterSupportHostRequest(SignalStrategy* signal_strategy, | 51 RegisterSupportHostRequest(SignalStrategy* signal_strategy, |
| 53 HostKeyPair* key_pair, | 52 HostKeyPair* key_pair, |
| 54 const RegisterCallback& callback); | 53 const RegisterCallback& callback); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 80 | 79 |
| 81 scoped_ptr<IqSender> iq_sender_; | 80 scoped_ptr<IqSender> iq_sender_; |
| 82 scoped_ptr<IqRequest> request_; | 81 scoped_ptr<IqRequest> request_; |
| 83 | 82 |
| 84 DISALLOW_COPY_AND_ASSIGN(RegisterSupportHostRequest); | 83 DISALLOW_COPY_AND_ASSIGN(RegisterSupportHostRequest); |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 } // namespace remoting | 86 } // namespace remoting |
| 88 | 87 |
| 89 #endif // REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ | 88 #endif // REMOTING_HOST_REGISTER_SUPPORT_HOST_REQUEST_H_ |
| OLD | NEW |