blob: 42041805bdbca88010cf9c9dd19096fe0eddb61a [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include <string>
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/protocol/errors.h"
namespace remoting {
class SignalStrategy;
// RegisterSupportHostRequest sends a request to register the host for
// a SupportID. When a response is received, it calls the callback specified in
// the StartRequest() method.
class RegisterSupportHostRequest {
// First parameter is the new SessionID received from the bot. Second
// parameter is the amount of time until that id expires. Third parameter
// is an error message if the request failed, or null if it succeeded.
using RegisterCallback =
base::OnceCallback<void(const std::string&,
const base::TimeDelta&,
protocol::ErrorCode error_code)>;
RegisterSupportHostRequest() = default;
virtual ~RegisterSupportHostRequest() = default;
virtual void StartRequest(SignalStrategy* signal_strategy,
scoped_refptr<RsaKeyPair> key_pair,
RegisterCallback callback) = 0;
} // namespace remoting