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

Unified Diff: content/browser/media/cdm/browser_cdm_manager.h

Issue 1013913002: media: Fix permission request/check for EME on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 9 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/browser/media/cdm/browser_cdm_manager.h
diff --git a/content/browser/media/cdm/browser_cdm_manager.h b/content/browser/media/cdm/browser_cdm_manager.h
index 12ee61702b435e4400ae9644690657aaf5dea2a2..35c5bd310fd502c8357e7db795beeda44410d4c5 100644
--- a/content/browser/media/cdm/browser_cdm_manager.h
+++ b/content/browser/media/cdm/browser_cdm_manager.h
@@ -144,27 +144,30 @@ class CONTENT_EXPORT BrowserCdmManager : public BrowserMessageFilter {
// Removes the CDM with the specified id.
void RemoveCdm(uint64 id);
- // Requests permission for the given protected-media session (infobar).
- void RequestSessionPermission(
+ using PermissionStatusCB = base::Callback<void(bool)>;
+
+ // Checks protected media identifier permission for the given
+ // |render_frame_id| and |cdm_id|.
+ void CheckPermissionStatus(int render_frame_id,
+ int cdm_id,
+ const PermissionStatusCB& permission_status_cb);
+
+ // Checks permission status on Browser UI thread. Runs |permission_status_cb|
+ // on the |task_runner_| with the permission status.
+ void CheckPermissionStatusOnUIThread(
int render_frame_id,
const GURL& security_origin,
- int cdm_id,
- media::EmeInitDataType init_data_type,
- const std::vector<uint8>& init_data,
- scoped_ptr<media::NewSessionCdmPromise> promise);
-
- // If |permitted| is false, it does nothing but send
- // |CdmMsg_LegacySessionError| IPC message.
- // The primary use case is infobar permission callback, i.e., when infobar
- // can decide user's intention either from interacting with the actual info
- // bar or from the saved preference.
- void GenerateRequestIfPermitted(
+ const PermissionStatusCB& permission_status_cb);
+
+ // Calls CreateSessionAndGenerateRequest() on the CDM if |permission_allowed|
+ // is true. Otherwise rejects the |promise|.
+ void CreateSessionAndGenerateRequestIfPermitted(
int render_frame_id,
int cdm_id,
- media::EmeInitDataType init_data_type,
+ media::EmeInitDataType eme_init_data_type,
ddorwin 2015/03/17 20:09:59 nit: "eme_" probably isn't necessary. Also, it's n
xhwang 2015/03/17 20:16:02 Done.
const std::vector<uint8>& init_data,
scoped_ptr<media::NewSessionCdmPromise> promise,
- PermissionStatus permission);
+ bool permission_allowed);
const int render_process_id_;
@@ -182,9 +185,6 @@ class CONTENT_EXPORT BrowserCdmManager : public BrowserMessageFilter {
// Map of CDM's security origin.
std::map<uint64, GURL> cdm_security_origin_map_;
- // Map of callbacks to cancel the permission request.
- std::map<uint64, base::Closure> cdm_cancel_permission_map_;
-
base::WeakPtrFactory<BrowserCdmManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager);
« no previous file with comments | « no previous file | content/browser/media/cdm/browser_cdm_manager.cc » ('j') | content/browser/media/cdm/browser_cdm_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698