57 lines
2.0 KiB
C++
57 lines
2.0 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// Copyright 2016 Google Inc.
|
|
//
|
|
// This software is licensed under the terms defined in the Widevine Master
|
|
// License Agreement. For a copy of this agreement, please contact
|
|
// widevine-licensing@google.com.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|
|
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "provisioning_sdk/public/provisioning_status.h"
|
|
|
|
namespace widevine {
|
|
|
|
class ProvisionedDeviceInfo;
|
|
class ProvisioningSessionImpl;
|
|
|
|
// Class which is used to implement the provisioning session state machine.
|
|
class ProvisioningSession {
|
|
public:
|
|
~ProvisioningSession();
|
|
|
|
// Process a message from the client device.
|
|
// * |message| is the message received from the client device.
|
|
// * |response| will contain, upon successful return, a message to be sent
|
|
// back to the client device as a response to |message|.
|
|
// * |done| will indicate, upon successful return, whether the provisioning
|
|
// exchange is complete, and the ProvisioningSession can be deleted.
|
|
// Returns OK if successful, or an appropriate error status code otherwise.
|
|
ProvisioningStatus ProcessMessage(const std::string& message,
|
|
std::string* response,
|
|
bool* done);
|
|
|
|
// * Returns a ProvisioneddeviceInfo message containing information about the
|
|
// type of device being provisioned. May return nullptr.
|
|
const ProvisionedDeviceInfo* GetDeviceInfo() const;
|
|
|
|
private:
|
|
#ifndef SWIGPYTHON
|
|
friend class ProvisioningEngine;
|
|
|
|
ProvisioningSession(const ProvisioningSession&) = delete;
|
|
ProvisioningSession& operator=(const ProvisioningSession&) = delete;
|
|
#endif
|
|
explicit ProvisioningSession(std::unique_ptr<ProvisioningSessionImpl> impl);
|
|
|
|
std::unique_ptr<ProvisioningSessionImpl> impl_;
|
|
};
|
|
|
|
} // namespace widevine
|
|
|
|
#endif // PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|