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

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

Issue 1904253002: Convert //media/blink from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/blink/webmediaplayer_impl.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 "media/blink/webencryptedmediaclient_impl.h" 5 #include "media/blink/webencryptedmediaclient_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
11 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
13 #include "media/base/key_systems.h" 14 #include "media/base/key_systems.h"
14 #include "media/base/media_client.h" 15 #include "media/base/media_client.h"
15 #include "media/base/media_permission.h" 16 #include "media/base/media_permission.h"
16 #include "media/blink/webcontentdecryptionmodule_impl.h" 17 #include "media/blink/webcontentdecryptionmodule_impl.h"
17 #include "media/blink/webcontentdecryptionmoduleaccess_impl.h" 18 #include "media/blink/webcontentdecryptionmoduleaccess_impl.h"
18 #include "third_party/WebKit/public/platform/URLConversion.h" 19 #include "third_party/WebKit/public/platform/URLConversion.h"
19 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" 20 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded, 119 base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded,
119 weak_factory_.GetWeakPtr(), request), 120 weak_factory_.GetWeakPtr(), request),
120 base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported, 121 base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported,
121 weak_factory_.GetWeakPtr(), request)); 122 weak_factory_.GetWeakPtr(), request));
122 } 123 }
123 124
124 void WebEncryptedMediaClientImpl::CreateCdm( 125 void WebEncryptedMediaClientImpl::CreateCdm(
125 const blink::WebString& key_system, 126 const blink::WebString& key_system,
126 const blink::WebSecurityOrigin& security_origin, 127 const blink::WebSecurityOrigin& security_origin,
127 const CdmConfig& cdm_config, 128 const CdmConfig& cdm_config,
128 scoped_ptr<blink::WebContentDecryptionModuleResult> result) { 129 std::unique_ptr<blink::WebContentDecryptionModuleResult> result) {
129 WebContentDecryptionModuleImpl::Create( 130 WebContentDecryptionModuleImpl::Create(
130 cdm_factory_, key_system, security_origin, cdm_config, std::move(result)); 131 cdm_factory_, key_system, security_origin, cdm_config, std::move(result));
131 } 132 }
132 133
133 void WebEncryptedMediaClientImpl::OnRequestSucceeded( 134 void WebEncryptedMediaClientImpl::OnRequestSucceeded(
134 blink::WebEncryptedMediaRequest request, 135 blink::WebEncryptedMediaRequest request,
135 const blink::WebMediaKeySystemConfiguration& accumulated_configuration, 136 const blink::WebMediaKeySystemConfiguration& accumulated_configuration,
136 const CdmConfig& cdm_config) { 137 const CdmConfig& cdm_config) {
137 GetReporter(request.keySystem())->ReportSupported(); 138 GetReporter(request.keySystem())->ReportSupported();
138 // TODO(sandersd): Pass |are_secure_codecs_required| along and use it to 139 // TODO(sandersd): Pass |are_secure_codecs_required| along and use it to
(...skipping 15 matching lines...) Expand all
154 // TODO(sandersd): Avoid doing ASCII conversion more than once. 155 // TODO(sandersd): Avoid doing ASCII conversion more than once.
155 std::string key_system_ascii; 156 std::string key_system_ascii;
156 if (base::IsStringASCII(key_system)) 157 if (base::IsStringASCII(key_system))
157 key_system_ascii = base::UTF16ToASCII(base::StringPiece16(key_system)); 158 key_system_ascii = base::UTF16ToASCII(base::StringPiece16(key_system));
158 159
159 // Return a per-frame singleton so that UMA reports will be once-per-frame. 160 // Return a per-frame singleton so that UMA reports will be once-per-frame.
160 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); 161 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii);
161 Reporter* reporter = reporters_.get(uma_name); 162 Reporter* reporter = reporters_.get(uma_name);
162 if (!reporter) { 163 if (!reporter) {
163 reporter = new Reporter(uma_name); 164 reporter = new Reporter(uma_name);
164 reporters_.add(uma_name, make_scoped_ptr(reporter)); 165 reporters_.add(uma_name, base::WrapUnique(reporter));
165 } 166 }
166 return reporter; 167 return reporter;
167 } 168 }
168 169
169 } // namespace media 170 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698