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

Side by Side Diff: content/browser/media/cdm/browser_cdm_manager.h

Issue 959503002: BrowserCdmManager: Do not pass MIME types as init_data_type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add USE_PROPRIETARY_CODECS guards to fix Android GN build (see crbug.com/461901). Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/media/cdm/browser_cdm_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/containers/scoped_ptr_hash_map.h" 14 #include "base/containers/scoped_ptr_hash_map.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "content/common/media/cdm_messages_enums.h" 18 #include "content/common/media/cdm_messages_enums.h"
19 #include "content/public/browser/browser_message_filter.h" 19 #include "content/public/browser/browser_message_filter.h"
20 #include "ipc/ipc_message.h" 20 #include "ipc/ipc_message.h"
21 #include "media/base/cdm_promise.h" 21 #include "media/base/cdm_promise.h"
22 #include "media/base/eme_constants.h"
22 #include "media/base/media_keys.h" 23 #include "media/base/media_keys.h"
23 #include "url/gurl.h" 24 #include "url/gurl.h"
24 25
25 namespace media { 26 namespace media {
26 class BrowserCdm; 27 class BrowserCdm;
27 } 28 }
28 29
29 namespace content { 30 namespace content {
30 31
31 // This class manages all CDM objects. It receives control operations from the 32 // This class manages all CDM objects. It receives control operations from the
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void RemoveAllCdmForFrame(int render_frame_id); 141 void RemoveAllCdmForFrame(int render_frame_id);
141 142
142 // Removes the CDM with the specified id. 143 // Removes the CDM with the specified id.
143 void RemoveCdm(uint64 id); 144 void RemoveCdm(uint64 id);
144 145
145 // Requests permission for the given protected-media session (infobar). 146 // Requests permission for the given protected-media session (infobar).
146 void RequestSessionPermission( 147 void RequestSessionPermission(
147 int render_frame_id, 148 int render_frame_id,
148 const GURL& security_origin, 149 const GURL& security_origin,
149 int cdm_id, 150 int cdm_id,
150 const std::string& init_data_type, 151 media::EmeInitDataType init_data_type,
151 const std::vector<uint8>& init_data, 152 const std::vector<uint8>& init_data,
152 scoped_ptr<media::NewSessionCdmPromise> promise); 153 scoped_ptr<media::NewSessionCdmPromise> promise);
153 154
154 // If |permitted| is false, it does nothing but send 155 // If |permitted| is false, it does nothing but send
155 // |CdmMsg_LegacySessionError| IPC message. 156 // |CdmMsg_LegacySessionError| IPC message.
156 // The primary use case is infobar permission callback, i.e., when infobar 157 // The primary use case is infobar permission callback, i.e., when infobar
157 // can decide user's intention either from interacting with the actual info 158 // can decide user's intention either from interacting with the actual info
158 // bar or from the saved preference. 159 // bar or from the saved preference.
159 void GenerateRequestIfPermitted( 160 void GenerateRequestIfPermitted(
160 int render_frame_id, 161 int render_frame_id,
161 int cdm_id, 162 int cdm_id,
162 const std::string& init_data_type, 163 media::EmeInitDataType init_data_type,
163 const std::vector<uint8>& init_data, 164 const std::vector<uint8>& init_data,
164 scoped_ptr<media::NewSessionCdmPromise> promise, 165 scoped_ptr<media::NewSessionCdmPromise> promise,
165 bool permitted); 166 bool permitted);
166 167
167 const int render_process_id_; 168 const int render_process_id_;
168 169
169 // TaskRunner to dispatch all CDM messages to. If it's NULL, all messages are 170 // TaskRunner to dispatch all CDM messages to. If it's NULL, all messages are
170 // dispatched to the browser UI thread. 171 // dispatched to the browser UI thread.
171 scoped_refptr<base::TaskRunner> task_runner_; 172 scoped_refptr<base::TaskRunner> task_runner_;
172 173
(...skipping 11 matching lines...) Expand all
184 std::map<uint64, base::Closure> cdm_cancel_permission_map_; 185 std::map<uint64, base::Closure> cdm_cancel_permission_map_;
185 186
186 base::WeakPtrFactory<BrowserCdmManager> weak_ptr_factory_; 187 base::WeakPtrFactory<BrowserCdmManager> weak_ptr_factory_;
187 188
188 DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager); 189 DISALLOW_COPY_AND_ASSIGN(BrowserCdmManager);
189 }; 190 };
190 191
191 } // namespace content 192 } // namespace content
192 193
193 #endif // CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_ 194 #endif // CONTENT_BROWSER_MEDIA_CDM_BROWSER_CDM_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/cdm/browser_cdm_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698