Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java

Issue 24152015: [Android] JNI binding for MediaDrmCredentialManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java b/content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..80cf6fdb57ec0c42cd13d77fb851d21c3d466f08
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java
@@ -0,0 +1,62 @@
+// Copyright 2013 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.
+
+package org.chromium.content.browser;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+/**
+ * A wrapper of the android MediaDrmCredentailManager
+ */
+@JNINamespace("content")
+public class MediaDrmCredentialManager {
+ int mNativeMediaDrmCredentialManager;
+
+ /**
+ * Callback interface for getting notified from credential reset.
+ */
+ public interface MediaDrmCredentialManagerCallback {
+ /**
+ * This method will be called when credential reset attempt is done.
+ * @param succeeded Whether or not if it succeeded.
+ */
+ @CalledByNative("MediaDrmCredentialManagerCallback")
+ public void onCredentialResetFinished(boolean succeeded);
+ }
+
+ /**
+ * Allocates and initializes the C++ side of this class.
+ */
+ public MediaDrmCredentialManager() {
+ mNativeMediaDrmCredentialManager = nativeInit();
+ }
+
+ /**
+ * Clean up the C++ side of this class. After the call, this class instance shouldn't be used.
+ */
+ public void destroy() {
+ nativeDestroy(mNativeMediaDrmCredentialManager);
+ mNativeMediaDrmCredentialManager = 0;
+ }
+
+ @Override
+ protected void finalize() {
+ assert mNativeMediaDrmCredentialManager == 0;
+ }
+
+ /**
+ * Attempts to reset the DRM credentials.
+ * @param callback It notifies whether or not it succeeded.
+ */
+ public void ResetCredentials(MediaDrmCredentialManagerCallback callback) {
+ assert mNativeMediaDrmCredentialManager != 0;
+ nativeResetCredentials(mNativeMediaDrmCredentialManager, callback);
+ }
+
+ private static native int nativeInit();
+ private static native void nativeDestroy(int nativeMediaDrmCredentialManager);
+ private static native void nativeResetCredentials(int nativeMediaDrmCredentialManager,
+ MediaDrmCredentialManagerCallback callback);
+}
« content/browser/media/android/media_drm_credential_manager.cc ('K') | « content/content_jni.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698