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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1742933002: Remove EME and MSE from RuntimeEnabledFeatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 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 "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" 54 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
55 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" 55 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
56 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" 56 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h"
57 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 57 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
58 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h" 58 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h"
59 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 59 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
60 #include "third_party/WebKit/public/platform/WebString.h" 60 #include "third_party/WebKit/public/platform/WebString.h"
61 #include "third_party/WebKit/public/platform/WebURL.h" 61 #include "third_party/WebKit/public/platform/WebURL.h"
62 #include "third_party/WebKit/public/web/WebDocument.h" 62 #include "third_party/WebKit/public/web/WebDocument.h"
63 #include "third_party/WebKit/public/web/WebFrame.h" 63 #include "third_party/WebKit/public/web/WebFrame.h"
64 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
65 #include "third_party/WebKit/public/web/WebView.h" 64 #include "third_party/WebKit/public/web/WebView.h"
66 #include "third_party/skia/include/core/SkCanvas.h" 65 #include "third_party/skia/include/core/SkCanvas.h"
67 #include "third_party/skia/include/core/SkPaint.h" 66 #include "third_party/skia/include/core/SkPaint.h"
68 #include "third_party/skia/include/core/SkTypeface.h" 67 #include "third_party/skia/include/core/SkTypeface.h"
69 #include "third_party/skia/include/gpu/GrContext.h" 68 #include "third_party/skia/include/gpu/GrContext.h"
70 #include "third_party/skia/include/gpu/SkGrPixelRef.h" 69 #include "third_party/skia/include/gpu/SkGrPixelRef.h"
71 #include "ui/gfx/image/image.h" 70 #include "ui/gfx/image/image.h"
72 71
73 static const uint32_t kGLTextureExternalOES = 0x8D65; 72 static const uint32_t kGLTextureExternalOES = 0x8D65;
74 static const int kSDKVersionToSupportSecurityOriginCheck = 20; 73 static const int kSDKVersionToSupportSecurityOriginCheck = 20;
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 void WebMediaPlayerAndroid::OnMediaSourceOpened( 1474 void WebMediaPlayerAndroid::OnMediaSourceOpened(
1476 blink::WebMediaSource* web_media_source) { 1475 blink::WebMediaSource* web_media_source) {
1477 client_->mediaSourceOpened(web_media_source); 1476 client_->mediaSourceOpened(web_media_source);
1478 } 1477 }
1479 1478
1480 void WebMediaPlayerAndroid::OnEncryptedMediaInitData( 1479 void WebMediaPlayerAndroid::OnEncryptedMediaInitData(
1481 media::EmeInitDataType init_data_type, 1480 media::EmeInitDataType init_data_type,
1482 const std::vector<uint8_t>& init_data) { 1481 const std::vector<uint8_t>& init_data) {
1483 DCHECK(main_thread_checker_.CalledOnValidThread()); 1482 DCHECK(main_thread_checker_.CalledOnValidThread());
1484 1483
1485 // Do not fire the "encrypted" event if Encrypted Media is not enabled.
1486 // EME may not be enabled on Android Jelly Bean.
1487 if (!blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) {
1488 return;
1489 }
1490
1491 // TODO(xhwang): Update this UMA name. https://crbug.com/589251 1484 // TODO(xhwang): Update this UMA name. https://crbug.com/589251
1492 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1); 1485 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1);
1493 1486
1494 DCHECK(init_data_type != media::EmeInitDataType::UNKNOWN); 1487 DCHECK(init_data_type != media::EmeInitDataType::UNKNOWN);
1495 1488
1496 encrypted_client_->encrypted(ConvertToWebInitDataType(init_data_type), 1489 encrypted_client_->encrypted(ConvertToWebInitDataType(init_data_type),
1497 init_data.data(), init_data.size()); 1490 init_data.data(), init_data.size());
1498 } 1491 }
1499 1492
1500 void WebMediaPlayerAndroid::OnWaitingForDecryptionKey() { 1493 void WebMediaPlayerAndroid::OnWaitingForDecryptionKey() {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1649 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1657 } else if (is_hls_url == is_hls) { 1650 } else if (is_hls_url == is_hls) {
1658 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1651 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1659 } 1652 }
1660 UMA_HISTOGRAM_ENUMERATION( 1653 UMA_HISTOGRAM_ENUMERATION(
1661 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1654 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1662 result, PREDICTION_RESULT_MAX); 1655 result, PREDICTION_RESULT_MAX);
1663 } 1656 }
1664 1657
1665 } // namespace content 1658 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698