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

Side by Side Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 1132773003: Revert of Plumb |use_secure_codecs| through to BrowserCdmFactoryAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/blink/webencryptedmediaclient_impl.h ('k') | media/cdm/default_cdm_factory.h » ('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 #include "webencryptedmediaclient_impl.h" 5 #include "webencryptedmediaclient_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 request.keySystem(), request.supportedConfigurations(), 98 request.keySystem(), request.supportedConfigurations(),
99 request.securityOrigin(), are_secure_codecs_supported_cb_.Run(), 99 request.securityOrigin(), are_secure_codecs_supported_cb_.Run(),
100 base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded, 100 base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded,
101 weak_factory_.GetWeakPtr(), request), 101 weak_factory_.GetWeakPtr(), request),
102 base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported, 102 base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported,
103 weak_factory_.GetWeakPtr(), request)); 103 weak_factory_.GetWeakPtr(), request));
104 } 104 }
105 105
106 void WebEncryptedMediaClientImpl::CreateCdm( 106 void WebEncryptedMediaClientImpl::CreateCdm(
107 const blink::WebString& key_system, 107 const blink::WebString& key_system,
108 bool allow_distinctive_identifier,
109 bool allow_persistent_state,
108 const blink::WebSecurityOrigin& security_origin, 110 const blink::WebSecurityOrigin& security_origin,
109 const CdmConfig& cdm_config,
110 blink::WebContentDecryptionModuleResult result) { 111 blink::WebContentDecryptionModuleResult result) {
111 WebContentDecryptionModuleImpl::Create( 112 WebContentDecryptionModuleImpl::Create(
112 cdm_factory_, key_system, security_origin, cdm_config, result); 113 cdm_factory_, key_system, allow_distinctive_identifier,
114 allow_persistent_state, security_origin, result);
113 } 115 }
114 116
115 void WebEncryptedMediaClientImpl::OnRequestSucceeded( 117 void WebEncryptedMediaClientImpl::OnRequestSucceeded(
116 blink::WebEncryptedMediaRequest request, 118 blink::WebEncryptedMediaRequest request,
117 const blink::WebMediaKeySystemConfiguration& accumulated_configuration, 119 const blink::WebMediaKeySystemConfiguration& accumulated_configuration,
118 const CdmConfig& cdm_config) { 120 bool are_secure_codecs_required) {
119 GetReporter(request.keySystem())->ReportSupported(); 121 GetReporter(request.keySystem())->ReportSupported();
120 // TODO(sandersd): Pass |are_secure_codecs_required| along and use it to 122 // TODO(sandersd): Pass |are_secure_codecs_required| along and use it to
121 // configure the CDM security level and use of secure surfaces on Android. 123 // configure the CDM security level and use of secure surfaces on Android.
122 request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create( 124 request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create(
123 request.keySystem(), request.securityOrigin(), accumulated_configuration, 125 request.keySystem(), accumulated_configuration, request.securityOrigin(),
124 cdm_config, weak_factory_.GetWeakPtr())); 126 weak_factory_.GetWeakPtr()));
125 } 127 }
126 128
127 void WebEncryptedMediaClientImpl::OnRequestNotSupported( 129 void WebEncryptedMediaClientImpl::OnRequestNotSupported(
128 blink::WebEncryptedMediaRequest request, 130 blink::WebEncryptedMediaRequest request,
129 const blink::WebString& error_message) { 131 const blink::WebString& error_message) {
130 request.requestNotSupported(error_message); 132 request.requestNotSupported(error_message);
131 } 133 }
132 134
133 WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter( 135 WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter(
134 const blink::WebString& key_system) { 136 const blink::WebString& key_system) {
135 // Assumes that empty will not be found by GetKeySystemNameForUMA(). 137 // Assumes that empty will not be found by GetKeySystemNameForUMA().
136 // TODO(sandersd): Avoid doing ASCII conversion more than once. 138 // TODO(sandersd): Avoid doing ASCII conversion more than once.
137 std::string key_system_ascii; 139 std::string key_system_ascii;
138 if (base::IsStringASCII(key_system)) 140 if (base::IsStringASCII(key_system))
139 key_system_ascii = base::UTF16ToASCII(key_system); 141 key_system_ascii = base::UTF16ToASCII(key_system);
140 142
141 // Return a per-frame singleton so that UMA reports will be once-per-frame. 143 // Return a per-frame singleton so that UMA reports will be once-per-frame.
142 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); 144 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii);
143 Reporter* reporter = reporters_.get(uma_name); 145 Reporter* reporter = reporters_.get(uma_name);
144 if (!reporter) { 146 if (!reporter) {
145 reporter = new Reporter(uma_name); 147 reporter = new Reporter(uma_name);
146 reporters_.add(uma_name, make_scoped_ptr(reporter)); 148 reporters_.add(uma_name, make_scoped_ptr(reporter));
147 } 149 }
148 return reporter; 150 return reporter;
149 } 151 }
150 152
151 } // namespace media 153 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.h ('k') | media/cdm/default_cdm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698