| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Adds a new CDM identified by |cdm_id| for the given |key_system| and | 104 // Adds a new CDM identified by |cdm_id| for the given |key_system| and |
| 105 // |security_origin|. | 105 // |security_origin|. |
| 106 void AddCdm(int render_frame_id, | 106 void AddCdm(int render_frame_id, |
| 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 the CDM with the specified id. | 111 // Removes the CDM with the specified id. |
| 112 void RemoveCdm(uint64 id); | 112 void RemoveCdm(uint64 id); |
| 113 | 113 |
| 114 // Requests permission for the given protected-media session (infobar). |
| 115 void RequestSessionPermission(int render_frame_id, |
| 116 const GURL& security_origin, |
| 117 int cdm_id, |
| 118 uint32 session_id, |
| 119 const std::string& content_type, |
| 120 const std::vector<uint8>& init_data); |
| 121 |
| 114 // If |permitted| is false, it does nothing but send | 122 // If |permitted| is false, it does nothing but send |
| 115 // |CdmMsg_SessionError| IPC message. | 123 // |CdmMsg_SessionError| IPC message. |
| 116 // The primary use case is infobar permission callback, i.e., when infobar | 124 // The primary use case is infobar permission callback, i.e., when infobar |
| 117 // can decide user's intention either from interacting with the actual info | 125 // can decide user's intention either from interacting with the actual info |
| 118 // bar or from the saved preference. | 126 // bar or from the saved preference. |
| 119 void CreateSessionIfPermitted(int render_frame_id, | 127 void CreateSessionIfPermitted(int render_frame_id, |
| 120 int cdm_id, | 128 int cdm_id, |
| 121 uint32 session_id, | 129 uint32 session_id, |
| 122 const std::string& content_type, | 130 const std::string& content_type, |
| 123 const std::vector<uint8>& init_data, | 131 const std::vector<uint8>& init_data, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 141 | 149 |
| 142 // Map of callbacks to cancel the permission request. | 150 // Map of callbacks to cancel the permission request. |
| 143 std::map<uint64, base::Closure> cdm_cancel_permission_map_; | 151 std::map<uint64, base::Closure> cdm_cancel_permission_map_; |
| 144 | 152 |
| 145 DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager); | 153 DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager); |
| 146 }; | 154 }; |
| 147 | 155 |
| 148 } // namespace content | 156 } // namespace content |
| 149 | 157 |
| 150 #endif // CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ | 158 #endif // CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ |
| OLD | NEW |