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

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 2600603002: Remove base::ScopedPtrHashMap from media/. (Closed)
Patch Set: rev Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.h ('k') | media/cdm/aes_decryptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webencryptedmediaclient_impl.cc
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc
index 3584f6ceb650a77aa5a963e99ecb2a65dfd98996..9dd3c26f6f299f028b25deb1968c9e2e13cc49ee 100644
--- a/media/blink/webencryptedmediaclient_impl.cc
+++ b/media/blink/webencryptedmediaclient_impl.cc
@@ -173,12 +173,10 @@ WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter(
// Return a per-frame singleton so that UMA reports will be once-per-frame.
std::string uma_name = GetKeySystemNameForUMA(key_system_ascii);
- Reporter* reporter = reporters_.get(uma_name);
- if (!reporter) {
- reporter = new Reporter(uma_name);
- reporters_.add(uma_name, base::WrapUnique(reporter));
- }
- return reporter;
+ std::unique_ptr<Reporter>& reporter = reporters_[uma_name];
+ if (!reporter)
+ reporter = base::MakeUnique<Reporter>(uma_name);
+ return reporter.get();
}
} // namespace media
« 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