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

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: 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..96155632c0a36abb1d2d1b9b42c5fd8a406517c3 100644
--- a/content/browser/media/cdm/browser_cdm_manager.h
+++ b/content/browser/media/cdm/browser_cdm_manager.h
@@ -144,27 +144,26 @@ 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(
- 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(
+ // Checks protected media identifier permission for the given
+ // |render_frame_id|, |security_origin| and |cdm_id|.
+ // |promise| will always be resolved or rejected on the |task_runner_|.
+ void CheckPermissionStatus(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_status| is not "granted", |promise| will be rejected.
+ // Otherwise, call CreateSessionAndGenerateRequest() on the CDM.
+ // |promise| will always be resolved or rejected on the |task_runner_|.
+ void CreateSessionAndGenerateRequest(
int render_frame_id,
int cdm_id,
media::EmeInitDataType init_data_type,
const std::vector<uint8>& init_data,
scoped_ptr<media::NewSessionCdmPromise> promise,
- PermissionStatus permission);
+ PermissionStatus permission_status);
const int render_process_id_;
@@ -182,9 +181,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