OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ |
6 #define CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 int cdm_id, | 107 int cdm_id, |
108 const std::string& key_system, | 108 const std::string& key_system, |
109 const GURL& security_origin); | 109 const GURL& security_origin); |
110 | 110 |
111 // Removes all CDMs associated with |render_frame_id|. | 111 // Removes all CDMs associated with |render_frame_id|. |
112 void RemoveAllCdmForFrame(int render_frame_id); | 112 void RemoveAllCdmForFrame(int render_frame_id); |
113 | 113 |
114 // Removes the CDM with the specified id. | 114 // Removes the CDM with the specified id. |
115 void RemoveCdm(uint64 id); | 115 void RemoveCdm(uint64 id); |
116 | 116 |
| 117 // Requests permission for the given protected-media session (infobar). |
| 118 void RequestSessionPermission(int render_frame_id, |
| 119 const GURL& security_origin, |
| 120 int cdm_id, |
| 121 uint32 session_id, |
| 122 const std::string& content_type, |
| 123 const std::vector<uint8>& init_data); |
| 124 |
117 // If |permitted| is false, it does nothing but send | 125 // If |permitted| is false, it does nothing but send |
118 // |CdmMsg_SessionError| IPC message. | 126 // |CdmMsg_SessionError| IPC message. |
119 // The primary use case is infobar permission callback, i.e., when infobar | 127 // The primary use case is infobar permission callback, i.e., when infobar |
120 // can decide user's intention either from interacting with the actual info | 128 // can decide user's intention either from interacting with the actual info |
121 // bar or from the saved preference. | 129 // bar or from the saved preference. |
122 void CreateSessionIfPermitted(int render_frame_id, | 130 void CreateSessionIfPermitted(int render_frame_id, |
123 int cdm_id, | 131 int cdm_id, |
124 uint32 session_id, | 132 uint32 session_id, |
125 const std::string& content_type, | 133 const std::string& content_type, |
126 const std::vector<uint8>& init_data, | 134 const std::vector<uint8>& init_data, |
(...skipping 17 matching lines...) Expand all Loading... |
144 | 152 |
145 // Map of callbacks to cancel the permission request. | 153 // Map of callbacks to cancel the permission request. |
146 std::map<uint64, base::Closure> cdm_cancel_permission_map_; | 154 std::map<uint64, base::Closure> cdm_cancel_permission_map_; |
147 | 155 |
148 DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager); | 156 DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager); |
149 }; | 157 }; |
150 | 158 |
151 } // namespace content | 159 } // namespace content |
152 | 160 |
153 #endif // CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ | 161 #endif // CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ |
OLD | NEW |