| Index: media/base/android/media_drm_bridge.h
|
| diff --git a/media/base/android/media_drm_bridge.h b/media/base/android/media_drm_bridge.h
|
| index a525f83404325c9663b31d3af149d3bb1e8b8625..1cd67f40a9c7f27a3dddc57eb06aa2895f63f747 100644
|
| --- a/media/base/android/media_drm_bridge.h
|
| +++ b/media/base/android/media_drm_bridge.h
|
| @@ -24,6 +24,7 @@ class GURL;
|
| namespace media {
|
|
|
| class MediaDrmBridge;
|
| +class ProvisionFetcher;
|
|
|
| using ScopedMediaDrmBridgePtr = scoped_ptr<MediaDrmBridge, BrowserCdmDeleter>;
|
|
|
| @@ -77,6 +78,7 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
|
| // TODO(xhwang): Is it okay not to update session expiration info?
|
| static ScopedMediaDrmBridgePtr Create(
|
| const std::string& key_system,
|
| + scoped_ptr<ProvisionFetcher> provision_fetcher,
|
| const SessionMessageCB& session_message_cb,
|
| const SessionClosedCB& session_closed_cb,
|
| const LegacySessionErrorCB& legacy_session_error_cb,
|
| @@ -87,7 +89,8 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
|
| // otherwise. No session callbacks are provided. This is used when we need to
|
| // use MediaDrmBridge without creating any sessions.
|
| static ScopedMediaDrmBridgePtr CreateWithoutSessionSupport(
|
| - const std::string& key_system);
|
| + const std::string& key_system,
|
| + scoped_ptr<ProvisionFetcher> provision_fetcher);
|
|
|
| // Returns a WeakPtr to be used on the |task_runner_|.
|
| base::WeakPtr<MediaDrmBridge> WeakPtr();
|
| @@ -154,6 +157,12 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
|
| // Called by Java after a MediaCrypto object is created.
|
| void OnMediaCryptoReady(JNIEnv* env, jobject j_media_drm);
|
|
|
| + // Called by Java when we need to send a provisioning request,
|
| + void OnStartProvisioning(JNIEnv* env,
|
| + jobject j_media_drm,
|
| + jstring j_default_url,
|
| + jbyteArray j_request_data);
|
| +
|
| // Callbacks to resolve the promise for |promise_id|.
|
| void OnPromiseResolved(JNIEnv* env, jobject j_media_drm, jint j_promise_id);
|
| void OnPromiseResolvedWithSession(JNIEnv* env,
|
| @@ -213,6 +222,7 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
|
|
|
| private:
|
| MediaDrmBridge(const std::vector<uint8>& scheme_uuid,
|
| + scoped_ptr<ProvisionFetcher> provision_fetcher,
|
| const SessionMessageCB& session_message_cb,
|
| const SessionClosedCB& session_closed_cb,
|
| const LegacySessionErrorCB& legacy_session_error_cb,
|
| @@ -231,12 +241,22 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
|
| // run this callback.
|
| void NotifyMediaCryptoReady(const MediaCryptoReadyCB& cb);
|
|
|
| + // Sends HTTP provisioning request to a provisioning server.
|
| + void SendProvisioningRequest(const std::string& default_url,
|
| + const std::string& request_data);
|
| +
|
| + // Process the data received by provisioning server.
|
| + void ProcessProvisioningResult(const std::string& response, bool success);
|
| +
|
| // UUID of the key system.
|
| std::vector<uint8> scheme_uuid_;
|
|
|
| // Java MediaDrm instance.
|
| base::android::ScopedJavaGlobalRef<jobject> j_media_drm_;
|
|
|
| + // The object that requests and receives provisioning data.
|
| + scoped_ptr<ProvisionFetcher> provision_fetcher_;
|
| +
|
| // Callbacks for firing session events.
|
| SessionMessageCB session_message_cb_;
|
| SessionClosedCB session_closed_cb_;
|
|
|