Chromium Code Reviews| Index: media/base/android/provision_fetcher.h |
| diff --git a/media/base/android/provision_fetcher.h b/media/base/android/provision_fetcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ff0731acbb71f47aa5593ccd3b3ba1a2e67408c5 |
| --- /dev/null |
| +++ b/media/base/android/provision_fetcher.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2015 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. |
| + |
| +#ifndef MEDIA_BASE_PROVISION_FETCHER_H |
| +#define MEDIA_BASE_PROVISION_FETCHER_H |
| + |
| +#include <string> |
| + |
| +#include "base/callback.h" |
| +#include "media/base/media_export.h" |
| + |
| +namespace media { |
| + |
| +// The interface to retrieve provision information for MediaDrmBridge. |
| +class MEDIA_EXPORT ProvisionFetcher { |
| + public: |
| + // After provision information is retrieved this callback will be called |
| + // with the status flag (success/failure) and the provision response in |
| + // case of success. |
| + using ResponseCB = |
| + base::Callback<void(bool success, const std::string& response)>; |
| + |
| + virtual ~ProvisionFetcher() {} |
| + |
| + // Requests the provision information with |default_url| and |request_data| |
| + // and calls |response_cb| callback with the response. The input parameters |
| + // |default_url| and |request_data| corresponds to Java class |
| + // MediaDrm.ProvisionRequest. |
| + // The implementation must call |response_cb| asynchronously on the same |
| + // thread that this method is called. |
| + virtual void Retrieve(const std::string& default_url, |
| + const std::string& request_data, |
| + const ResponseCB& response_cb) = 0; |
| +}; |
| + |
| +// The factory class that creates ProvisionFetcher objects. |
| +class ProvisionFetcherFactory { |
| + public: |
| + virtual ~ProvisionFetcherFactory() {} |
| + |
| + virtual scoped_ptr<ProvisionFetcher> CreateFetcher() const = 0; |
| +}; |
|
xhwang
2015/11/12 22:27:03
I can see this is following the model of CdmFactor
Tima Vaisburd
2015/11/13 03:13:10
Done.
|
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_PROVISION_FETCHER_H |