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

Side by Side Diff: media/cdm/proxy_decryptor.cc

Issue 985113003: Block platform verification and file IO in the CDM adapter if the CDM configuration disallows them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK types. 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 unified diff | Download patch
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.cc ('k') | ppapi/api/private/ppp_content_decryptor_private.idl » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "media/cdm/proxy_decryptor.h" 5 #include "media/cdm/proxy_decryptor.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 weak_ptr_factory_.GetWeakPtr(), session_id), 188 weak_ptr_factory_.GetWeakPtr(), session_id),
189 base::Bind(&ProxyDecryptor::OnSessionError, 189 base::Bind(&ProxyDecryptor::OnSessionError,
190 weak_ptr_factory_.GetWeakPtr(), session_id))); 190 weak_ptr_factory_.GetWeakPtr(), session_id)));
191 media_keys_->RemoveSession(session_id, promise.Pass()); 191 media_keys_->RemoveSession(session_id, promise.Pass());
192 } 192 }
193 193
194 scoped_ptr<MediaKeys> ProxyDecryptor::CreateMediaKeys( 194 scoped_ptr<MediaKeys> ProxyDecryptor::CreateMediaKeys(
195 CdmFactory* cdm_factory, 195 CdmFactory* cdm_factory,
196 const std::string& key_system, 196 const std::string& key_system,
197 const GURL& security_origin) { 197 const GURL& security_origin) {
198 // TODO(sandersd): Trigger permissions check here and use it to determine
199 // distinctive identifier support, instead of always requiring the
200 // permission. http://crbug.com/455271
201 bool allow_distinctive_identifier = true;
202 bool allow_persistent_state = true;
198 base::WeakPtr<ProxyDecryptor> weak_this = weak_ptr_factory_.GetWeakPtr(); 203 base::WeakPtr<ProxyDecryptor> weak_this = weak_ptr_factory_.GetWeakPtr();
199 return cdm_factory->Create( 204 return cdm_factory->Create(
200 key_system, 205 key_system,
206 allow_distinctive_identifier,
207 allow_persistent_state,
201 security_origin, 208 security_origin,
202 base::Bind(&ProxyDecryptor::OnSessionMessage, weak_this), 209 base::Bind(&ProxyDecryptor::OnSessionMessage, weak_this),
203 base::Bind(&ProxyDecryptor::OnSessionClosed, weak_this), 210 base::Bind(&ProxyDecryptor::OnSessionClosed, weak_this),
204 base::Bind(&ProxyDecryptor::OnSessionError, weak_this), 211 base::Bind(&ProxyDecryptor::OnSessionError, weak_this),
205 base::Bind(&ProxyDecryptor::OnSessionKeysChange, weak_this), 212 base::Bind(&ProxyDecryptor::OnSessionKeysChange, weak_this),
206 base::Bind(&ProxyDecryptor::OnSessionExpirationUpdate, weak_this)); 213 base::Bind(&ProxyDecryptor::OnSessionExpirationUpdate, weak_this));
207 } 214 }
208 215
209 void ProxyDecryptor::OnSessionMessage(const std::string& session_id, 216 void ProxyDecryptor::OnSessionMessage(const std::string& session_id,
210 MediaKeys::MessageType message_type, 217 MediaKeys::MessageType message_type,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 bool is_persistent = 303 bool is_persistent =
297 session_type == PersistentSession || session_type == LoadSession; 304 session_type == PersistentSession || session_type == LoadSession;
298 active_sessions_.insert(std::make_pair(session_id, is_persistent)); 305 active_sessions_.insert(std::make_pair(session_id, is_persistent));
299 306
300 // For LoadSession(), generate the KeyAdded event. 307 // For LoadSession(), generate the KeyAdded event.
301 if (session_type == LoadSession) 308 if (session_type == LoadSession)
302 GenerateKeyAdded(session_id); 309 GenerateKeyAdded(session_id);
303 } 310 }
304 311
305 } // namespace media 312 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.cc ('k') | ppapi/api/private/ppp_content_decryptor_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698