2014-10-07 21:33:08 +00:00
|
|
|
// Copyright 2014 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
#ifndef MEDIA_BASE_KEY_FETCHER_H_
|
|
|
|
#define MEDIA_BASE_KEY_FETCHER_H_
|
|
|
|
|
|
|
|
#include "base/macros.h"
|
2017-06-29 22:23:53 +00:00
|
|
|
#include "packager/status.h"
|
2014-10-07 21:33:08 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2014-10-07 21:33:08 +00:00
|
|
|
namespace media {
|
|
|
|
|
|
|
|
/// Base class for fetching keys from the license service.
|
|
|
|
class KeyFetcher {
|
|
|
|
public:
|
|
|
|
KeyFetcher();
|
|
|
|
virtual ~KeyFetcher();
|
|
|
|
|
|
|
|
/// Fetch Keys from license service.
|
|
|
|
/// |response| is owned by caller.
|
|
|
|
/// @param service_address license service address.
|
|
|
|
/// @param request JSON formatted request.
|
|
|
|
/// @param response JSON formatted response. Owned by caller.
|
|
|
|
/// @return OK on success.
|
|
|
|
virtual Status FetchKeys(const std::string& service_address,
|
|
|
|
const std::string& request,
|
|
|
|
std::string* response) = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(KeyFetcher);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace media
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2014-10-07 21:33:08 +00:00
|
|
|
|
|
|
|
#endif // MEDIA_BASE_KEY_FETCHER_H_
|
|
|
|
|