Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_BASE_PROVISION_FETCHER_H | |
| 6 #define MEDIA_BASE_PROVISION_FETCHER_H | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "media/base/media_export.h" | |
| 12 | |
| 13 namespace media { | |
| 14 | |
| 15 // The interface to retrieve provision information for MediaDrmBridge. | |
| 16 class MEDIA_EXPORT ProvisionFetcher { | |
| 17 public: | |
| 18 // After provision information is retrieved this callback will be called | |
| 19 // with the status flag (success/failure) and the provision response in | |
| 20 // case of success. | |
| 21 using ResponseCB = | |
| 22 base::Callback<void(bool success, const std::string& response)>; | |
| 23 | |
| 24 virtual ~ProvisionFetcher() {} | |
| 25 | |
| 26 // Requests the provision information with |default_url| and |request_data| | |
| 27 // and calls |response_cb| callback with the response. The input parameters | |
| 28 // |default_url| and |request_data| corresponds to Java class | |
| 29 // MediaDrm.ProvisionRequest. | |
| 30 // The implementation must call |response_cb| asynchronously on the same | |
| 31 // thread that this method is called. | |
| 32 virtual void Retrieve(const std::string& default_url, | |
| 33 const std::string& request_data, | |
| 34 const ResponseCB& response_cb) = 0; | |
| 35 }; | |
| 36 | |
| 37 // The factory class that creates ProvisionFetcher objects. | |
| 38 class ProvisionFetcherFactory { | |
| 39 public: | |
| 40 virtual ~ProvisionFetcherFactory() {} | |
| 41 | |
| 42 virtual scoped_ptr<ProvisionFetcher> CreateFetcher() const = 0; | |
| 43 }; | |
|
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.
| |
| 44 | |
| 45 } // namespace media | |
| 46 | |
| 47 #endif // MEDIA_BASE_PROVISION_FETCHER_H | |
| OLD | NEW |