Commit 93b0efce authored by Saman Sami's avatar Saman Sami Committed by Commit Bot

Don't instantiate video_consumer_ in PageHandler on Android WebView

Video capture doesn't work on Android WebView, so don't instantiate
video_consumer_ in PageHandler

Bug: 813929, 865430
Change-Id: I09ecce34f1f2a50d23fc12e0907a0d27bf3bc9d8
Reviewed-on: https://chromium-review.googlesource.com/1157206
Commit-Queue: Saman Sami <samans@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579798}
parent 7236fb72
......@@ -61,6 +61,10 @@
#include "ui/gfx/skbitmap_operations.h"
#include "ui/snapshot/snapshot.h"
#ifdef OS_ANDROID
#include "content/browser/renderer_host/compositor_impl_android.h"
#endif
namespace content {
namespace protocol {
......@@ -202,9 +206,16 @@ PageHandler::PageHandler(EmulationHandler* emulation_handler)
emulation_handler_(emulation_handler),
observer_(this),
weak_factory_(this) {
if (features::IsVizDisplayCompositorEnabled() ||
bool create_video_consumer =
features::IsVizDisplayCompositorEnabled() ||
base::FeatureList::IsEnabled(
features::kUseVideoCaptureApiForDevToolsSnapshots)) {
features::kUseVideoCaptureApiForDevToolsSnapshots);
#ifdef OS_ANDROID
// Video capture doesn't work on Android WebView. Use CopyFromSurface instead.
if (!CompositorImpl::IsInitialized())
create_video_consumer = false;
#endif
if (create_video_consumer) {
video_consumer_ = std::make_unique<DevToolsVideoConsumer>(
base::BindRepeating(&PageHandler::OnFrameFromVideoConsumer,
weak_factory_.GetWeakPtr()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment