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

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

Issue 2600603002: Remove base::ScopedPtrHashMap from media/. (Closed)
Patch Set: rev Created 3 years, 12 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/aes_decryptor.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/memory/ptr_util.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter( 166 WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter(
167 const blink::WebString& key_system) { 167 const blink::WebString& key_system) {
168 // Assumes that empty will not be found by GetKeySystemNameForUMA(). 168 // Assumes that empty will not be found by GetKeySystemNameForUMA().
169 // TODO(sandersd): Avoid doing ASCII conversion more than once. 169 // TODO(sandersd): Avoid doing ASCII conversion more than once.
170 std::string key_system_ascii; 170 std::string key_system_ascii;
171 if (key_system.containsOnlyASCII()) 171 if (key_system.containsOnlyASCII())
172 key_system_ascii = key_system.ascii(); 172 key_system_ascii = key_system.ascii();
173 173
174 // Return a per-frame singleton so that UMA reports will be once-per-frame. 174 // Return a per-frame singleton so that UMA reports will be once-per-frame.
175 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); 175 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii);
176 Reporter* reporter = reporters_.get(uma_name); 176 std::unique_ptr<Reporter>& reporter = reporters_[uma_name];
177 if (!reporter) { 177 if (!reporter)
178 reporter = new Reporter(uma_name); 178 reporter = base::MakeUnique<Reporter>(uma_name);
179 reporters_.add(uma_name, base::WrapUnique(reporter)); 179 return reporter.get();
180 }
181 return reporter;
182 } 180 }
183 181
184 } // namespace media 182 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.h ('k') | media/cdm/aes_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698