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

Side by Side Diff: chrome/browser/media/android/cdm/media_drm_credential_manager.h

Issue 1427183002: Move MediaDrmBridge provision communication to native side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AndroidCdmFactory use a fetcher factory instead of a fetcher; addressed more comments Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_CREDENTIAL_MANAGER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_CREDENTIAL_MANAGER_H_
6 #define CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_CREDENTIAL_MANAGER_H_ 6 #define CHROME_BROWSER_MEDIA_ANDROID_CDM_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/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "media/base/android/media_drm_bridge.h" 14 #include "media/base/android/media_drm_bridge.h"
15 #include "media/base/android/provision_fetcher.h"
15 16
16 // This class manages the media DRM credentials on Android. 17 // This class manages the media DRM credentials on Android.
17 class MediaDrmCredentialManager { 18 class MediaDrmCredentialManager {
18 public: 19 public:
19 static MediaDrmCredentialManager* GetInstance(); 20 static MediaDrmCredentialManager* GetInstance();
20 21
21 typedef base::Callback<void(bool)> ResetCredentialsCB; 22 typedef base::Callback<void(bool)> ResetCredentialsCB;
22 23
23 // Called to reset the DRM credentials. (for Java) 24 // Called to reset the DRM credentials. (for Java)
24 // Only clears credentials for Widevine. 25 // Only clears credentials for Widevine.
(...skipping 21 matching lines...) Expand all
46 47
47 // Resets DRM credentials for a particular |security_level|. Returns false if 48 // Resets DRM credentials for a particular |security_level|. Returns false if
48 // we fail to create the MediaDrmBridge at all, in which case we cannot reset 49 // we fail to create the MediaDrmBridge at all, in which case we cannot reset
49 // the credentials. Otherwise, the result is returned asynchronously in 50 // the credentials. Otherwise, the result is returned asynchronously in
50 // OnResetCredentialsCompleted() function. 51 // OnResetCredentialsCompleted() function.
51 bool ResetCredentialsInternal(SecurityLevel security_level); 52 bool ResetCredentialsInternal(SecurityLevel security_level);
52 53
53 // The MediaDrmBridge object used to perform the credential reset. 54 // The MediaDrmBridge object used to perform the credential reset.
54 scoped_refptr<media::MediaDrmBridge> media_drm_bridge_; 55 scoped_refptr<media::MediaDrmBridge> media_drm_bridge_;
55 56
57 // The factory that creates ProvisionFetcher object that are used in the
58 // process of device provisioning.
59 scoped_ptr<media::ProvisionFetcherFactory> provision_fetcher_factory_;
60
56 // The callback provided by the caller. 61 // The callback provided by the caller.
57 ResetCredentialsCB reset_credentials_cb_; 62 ResetCredentialsCB reset_credentials_cb_;
58 63
59 DISALLOW_COPY_AND_ASSIGN(MediaDrmCredentialManager); 64 DISALLOW_COPY_AND_ASSIGN(MediaDrmCredentialManager);
60 }; 65 };
61 66
62 #endif // CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_CREDENTIAL_MANAGER_H_ 67 #endif // CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_CREDENTIAL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698