OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 } | 1083 } |
1084 | 1084 |
1085 void WebMediaPlayerImpl::OnCdmAttached(bool success) { | 1085 void WebMediaPlayerImpl::OnCdmAttached(bool success) { |
1086 DVLOG(1) << __func__ << ": success = " << success; | 1086 DVLOG(1) << __func__ << ": success = " << success; |
1087 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1087 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
1088 DCHECK(pending_cdm_); | 1088 DCHECK(pending_cdm_); |
1089 | 1089 |
1090 // If the CDM is set from the constructor there is no promise | 1090 // If the CDM is set from the constructor there is no promise |
1091 // (|set_cdm_result_|) to fulfill. | 1091 // (|set_cdm_result_|) to fulfill. |
1092 if (success) { | 1092 if (success) { |
| 1093 media_log_->SetBooleanProperty("has_cdm", true); |
| 1094 |
1093 // This will release the previously attached CDM (if any). | 1095 // This will release the previously attached CDM (if any). |
1094 cdm_ = std::move(pending_cdm_); | 1096 cdm_ = std::move(pending_cdm_); |
1095 if (set_cdm_result_) { | 1097 if (set_cdm_result_) { |
1096 set_cdm_result_->Complete(); | 1098 set_cdm_result_->Complete(); |
1097 set_cdm_result_.reset(); | 1099 set_cdm_result_.reset(); |
1098 } | 1100 } |
1099 | 1101 |
1100 return; | 1102 return; |
1101 } | 1103 } |
1102 | 1104 |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 | 2344 |
2343 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2345 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2344 DCHECK(data_source_ || chunk_demuxer_); | 2346 DCHECK(data_source_ || chunk_demuxer_); |
2345 if (data_source_) | 2347 if (data_source_) |
2346 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2348 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2347 else | 2349 else |
2348 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2350 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2349 } | 2351 } |
2350 | 2352 |
2351 } // namespace media | 2353 } // namespace media |
OLD | NEW |