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

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

Issue 2234753002: media: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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/base/text_renderer.cc ('k') | media/cast/net/cast_transport_config.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/cdm_session_adapter.h" 5 #include "media/blink/cdm_session_adapter.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::CreateSession() { 72 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::CreateSession() {
73 return new WebContentDecryptionModuleSessionImpl(this); 73 return new WebContentDecryptionModuleSessionImpl(this);
74 } 74 }
75 75
76 bool CdmSessionAdapter::RegisterSession( 76 bool CdmSessionAdapter::RegisterSession(
77 const std::string& session_id, 77 const std::string& session_id,
78 base::WeakPtr<WebContentDecryptionModuleSessionImpl> session) { 78 base::WeakPtr<WebContentDecryptionModuleSessionImpl> session) {
79 // If this session ID is already registered, don't register it again. 79 // If this session ID is already registered, don't register it again.
80 if (ContainsKey(sessions_, session_id)) 80 if (base::ContainsKey(sessions_, session_id))
81 return false; 81 return false;
82 82
83 sessions_[session_id] = session; 83 sessions_[session_id] = session;
84 return true; 84 return true;
85 } 85 }
86 86
87 void CdmSessionAdapter::UnregisterSession(const std::string& session_id) { 87 void CdmSessionAdapter::UnregisterSession(const std::string& session_id) {
88 DCHECK(ContainsKey(sessions_, session_id)); 88 DCHECK(base::ContainsKey(sessions_, session_id));
89 sessions_.erase(session_id); 89 sessions_.erase(session_id);
90 } 90 }
91 91
92 void CdmSessionAdapter::InitializeNewSession( 92 void CdmSessionAdapter::InitializeNewSession(
93 EmeInitDataType init_data_type, 93 EmeInitDataType init_data_type,
94 const std::vector<uint8_t>& init_data, 94 const std::vector<uint8_t>& init_data,
95 MediaKeys::SessionType session_type, 95 MediaKeys::SessionType session_type,
96 std::unique_ptr<NewSessionCdmPromise> promise) { 96 std::unique_ptr<NewSessionCdmPromise> promise) {
97 cdm_->CreateSessionAndGenerateRequest(session_type, init_data_type, init_data, 97 cdm_->CreateSessionAndGenerateRequest(session_type, init_data_type, init_data,
98 std::move(promise)); 98 std::move(promise));
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // Note: This leaks memory, which is expected behavior. 234 // Note: This leaks memory, which is expected behavior.
235 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet( 235 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet(
236 GetKeySystemUMAPrefix() + kTimeToCreateCdmUMAName, 236 GetKeySystemUMAPrefix() + kTimeToCreateCdmUMAName,
237 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(10), 237 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(10),
238 50, base::HistogramBase::kUmaTargetedHistogramFlag); 238 50, base::HistogramBase::kUmaTargetedHistogramFlag);
239 239
240 histogram->AddTime(time); 240 histogram->AddTime(time);
241 } 241 }
242 242
243 } // namespace media 243 } // namespace media
OLDNEW
« no previous file with comments | « media/base/text_renderer.cc ('k') | media/cast/net/cast_transport_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698