Commit 43db4790 authored by Fabrice de Gans-Riberi's avatar Fabrice de Gans-Riberi Committed by Commit Bot

[fuchsia] Add build flag to enable remote debugging in WebRunner.

Bug: 1016036
Change-Id: I9c2125d7b2fe11c08f7fa7024155ae25f4a0360e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898713Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712396}
parent 12863bae
......@@ -14,11 +14,17 @@ declare_args() {
# TODO(crbug.com/1000858): Revisit this value once hardware playback is fixed
# (fxb/13659).
enable_software_video_decoders = true
# Set to a non-zero value to enable remote debugging on that port in WebRunner.
web_runner_remote_debugging_port = 0
}
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "ENABLE_SOFTWARE_VIDEO_DECODERS=$enable_software_video_decoders" ]
flags = [
"ENABLE_SOFTWARE_VIDEO_DECODERS=$enable_software_video_decoders",
"WEB_RUNNER_REMOTE_DEBUGGING_PORT=$web_runner_remote_debugging_port",
]
visibility = [ ":*" ]
}
......@@ -31,6 +37,7 @@ source_set("common") {
"common/web_content_runner.h",
]
deps = [
":buildflags",
"//base",
"//fuchsia/base",
"//fuchsia/base:modular",
......
......@@ -18,6 +18,7 @@
#include "base/fuchsia/scoped_service_binding.h"
#include "base/fuchsia/startup_context.h"
#include "base/logging.h"
#include "fuchsia/runners/buildflags.h"
#include "fuchsia/runners/common/web_component.h"
#include "url/gurl.h"
......@@ -54,10 +55,17 @@ fuchsia::web::ContextPtr WebContentRunner::CreateWebContext(
// static
fuchsia::web::ContextPtr WebContentRunner::CreateDefaultWebContext(
fuchsia::web::ContextFeatureFlags features) {
return CreateWebContext(BuildCreateContextParams(
OpenDirectoryOrFail(
base::FilePath(base::fuchsia::kPersistedDataDirectoryPath)),
features));
fuchsia::web::CreateContextParams create_context_params =
BuildCreateContextParams(OpenDirectoryOrFail(base::FilePath(
base::fuchsia::kPersistedDataDirectoryPath)),
features);
if (BUILDFLAG(WEB_RUNNER_REMOTE_DEBUGGING_PORT) != 0) {
create_context_params.set_remote_debugging_port(
BUILDFLAG(WEB_RUNNER_REMOTE_DEBUGGING_PORT));
}
return CreateWebContext(std::move(create_context_params));
}
// static
......@@ -114,6 +122,8 @@ void WebContentRunner::StartComponent(
this,
std::make_unique<base::fuchsia::StartupContext>(std::move(startup_info)),
std::move(controller_request));
if (BUILDFLAG(WEB_RUNNER_REMOTE_DEBUGGING_PORT) != 0)
component->EnableRemoteDebugging();
component->StartComponent();
component->LoadUrl(url, std::vector<fuchsia::net::http::Header>());
RegisterComponent(std::move(component));
......
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