Chromium Code Reviews| 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); |