| OLD | NEW |
| 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/cdm/player_tracker_impl.h" | 5 #include "media/cdm/player_tracker_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 | 10 |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 PlayerTrackerImpl::PlayerCallbacks::PlayerCallbacks( | 13 PlayerTrackerImpl::PlayerCallbacks::PlayerCallbacks( |
| 14 const base::Closure& new_key_cb, | 14 const base::Closure& new_key_cb, |
| 15 const base::Closure& cdm_unset_cb) | 15 const base::Closure& cdm_unset_cb) |
| 16 : new_key_cb(new_key_cb), cdm_unset_cb(cdm_unset_cb) {} | 16 : new_key_cb(new_key_cb), cdm_unset_cb(cdm_unset_cb) {} |
| 17 | 17 |
| 18 PlayerTrackerImpl::PlayerCallbacks::PlayerCallbacks( |
| 19 const PlayerCallbacks& other) = default; |
| 20 |
| 18 PlayerTrackerImpl::PlayerCallbacks::~PlayerCallbacks() { | 21 PlayerTrackerImpl::PlayerCallbacks::~PlayerCallbacks() { |
| 19 } | 22 } |
| 20 | 23 |
| 21 PlayerTrackerImpl::PlayerTrackerImpl() : next_registration_id_(1) { | 24 PlayerTrackerImpl::PlayerTrackerImpl() : next_registration_id_(1) { |
| 22 } | 25 } |
| 23 | 26 |
| 24 PlayerTrackerImpl::~PlayerTrackerImpl() {} | 27 PlayerTrackerImpl::~PlayerTrackerImpl() {} |
| 25 | 28 |
| 26 int PlayerTrackerImpl::RegisterPlayer(const base::Closure& new_key_cb, | 29 int PlayerTrackerImpl::RegisterPlayer(const base::Closure& new_key_cb, |
| 27 const base::Closure& cdm_unset_cb) { | 30 const base::Closure& cdm_unset_cb) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 base::AutoLock lock(lock_); | 63 base::AutoLock lock(lock_); |
| 61 for (const auto& entry : player_callbacks_map_) | 64 for (const auto& entry : player_callbacks_map_) |
| 62 cdm_unset_callbacks.push_back(entry.second.cdm_unset_cb); | 65 cdm_unset_callbacks.push_back(entry.second.cdm_unset_cb); |
| 63 } | 66 } |
| 64 | 67 |
| 65 for (const auto& cb : cdm_unset_callbacks) | 68 for (const auto& cb : cdm_unset_callbacks) |
| 66 cb.Run(); | 69 cb.Run(); |
| 67 } | 70 } |
| 68 | 71 |
| 69 } // namespace media | 72 } // namespace media |
| OLD | NEW |