| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "media/base/android/media_drm_bridge.h" | 13 #include "media/base/android/media_drm_bridge.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // This class manages the media DRM credentials on Android. | 17 // This class manages the media DRM credentials on Android. |
| 18 class MediaDrmCredentialManager { | 18 class MediaDrmCredentialManager { |
| 19 public: | 19 public: |
| 20 static MediaDrmCredentialManager* GetInstance(); | 20 static MediaDrmCredentialManager* GetInstance(); |
| 21 | 21 |
| 22 typedef base::Callback<void(bool)> ResetCredentialsCB; | 22 typedef base::Callback<void(bool)> ResetCredentialsCB; |
| 23 | 23 |
| 24 // Called to reset the DRM credentials. (for Java) | 24 // Called to reset the DRM credentials. (for Java) |
| 25 // Only clears credentials for Widevine. |
| 26 // TODO(ddorwin): This should accept a key system parameter so that this is |
| 27 // clear to the caller, which can call it repeatedly as necessary. |
| 28 // http://crbug.com/459400 |
| 25 static void ResetCredentials(JNIEnv* env, jclass clazz, jobject callback); | 29 static void ResetCredentials(JNIEnv* env, jclass clazz, jobject callback); |
| 26 | 30 |
| 27 // Called to reset the DRM credentials. The result is returned in the | 31 // Called to reset the DRM credentials. The result is returned in the |
| 28 // |reset_credentials_cb|. | 32 // |reset_credentials_cb|. |
| 29 void ResetCredentials(const ResetCredentialsCB& reset_credentials_cb); | 33 void ResetCredentials(const ResetCredentialsCB& reset_credentials_cb); |
| 30 | 34 |
| 31 static bool RegisterMediaDrmCredentialManager(JNIEnv* env); | 35 static bool RegisterMediaDrmCredentialManager(JNIEnv* env); |
| 32 | 36 |
| 33 private: | 37 private: |
| 34 friend struct DefaultSingletonTraits<MediaDrmCredentialManager>; | 38 friend struct DefaultSingletonTraits<MediaDrmCredentialManager>; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 53 | 57 |
| 54 // The callback provided by the caller. | 58 // The callback provided by the caller. |
| 55 ResetCredentialsCB reset_credentials_cb_; | 59 ResetCredentialsCB reset_credentials_cb_; |
| 56 | 60 |
| 57 DISALLOW_COPY_AND_ASSIGN(MediaDrmCredentialManager); | 61 DISALLOW_COPY_AND_ASSIGN(MediaDrmCredentialManager); |
| 58 }; | 62 }; |
| 59 | 63 |
| 60 } // namespace content | 64 } // namespace content |
| 61 | 65 |
| 62 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_ | 66 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_ |
| OLD | NEW |