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

Side by Side Diff: content/renderer/media/cdm/renderer_cdm_manager.cc

Issue 2228403003: content: 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
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 "content/renderer/media/cdm/renderer_cdm_manager.h" 5 #include "content/renderer/media/cdm/renderer_cdm_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 const std::string& error_message) { 226 const std::string& error_message) {
227 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id); 227 ProxyMediaKeys* media_keys = GetMediaKeys(cdm_id);
228 if (media_keys) 228 if (media_keys)
229 media_keys->OnPromiseRejected(promise_id, exception, system_code, 229 media_keys->OnPromiseRejected(promise_id, exception, system_code,
230 error_message); 230 error_message);
231 } 231 }
232 232
233 int RendererCdmManager::RegisterMediaKeys(ProxyMediaKeys* media_keys) { 233 int RendererCdmManager::RegisterMediaKeys(ProxyMediaKeys* media_keys) {
234 int cdm_id = next_cdm_id_++; 234 int cdm_id = next_cdm_id_++;
235 DCHECK_NE(cdm_id, media::CdmContext::kInvalidCdmId); 235 DCHECK_NE(cdm_id, media::CdmContext::kInvalidCdmId);
236 DCHECK(!ContainsKey(proxy_media_keys_map_, cdm_id)); 236 DCHECK(!base::ContainsKey(proxy_media_keys_map_, cdm_id));
237 proxy_media_keys_map_[cdm_id] = media_keys; 237 proxy_media_keys_map_[cdm_id] = media_keys;
238 return cdm_id; 238 return cdm_id;
239 } 239 }
240 240
241 void RendererCdmManager::UnregisterMediaKeys(int cdm_id) { 241 void RendererCdmManager::UnregisterMediaKeys(int cdm_id) {
242 DCHECK(ContainsKey(proxy_media_keys_map_, cdm_id)); 242 DCHECK(base::ContainsKey(proxy_media_keys_map_, cdm_id));
243 proxy_media_keys_map_.erase(cdm_id); 243 proxy_media_keys_map_.erase(cdm_id);
244 } 244 }
245 245
246 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { 246 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) {
247 std::map<int, ProxyMediaKeys*>::iterator iter = 247 std::map<int, ProxyMediaKeys*>::iterator iter =
248 proxy_media_keys_map_.find(cdm_id); 248 proxy_media_keys_map_.find(cdm_id);
249 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; 249 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL;
250 } 250 }
251 251
252 } // namespace content 252 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_track_recorder_unittest.cc ('k') | content/renderer/media/gpu/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698