Commit 73254b14 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

DevTools: fix inspecting hosted frontend

When using hosted mode, --custom-devtools-frontend specifies the URL
rather than the path to the debug devtools bundle. This change fixes
the workflow of opening a bundled DevTools instance on a hosted
DevTools instance.

R=dgozman@chromium.org

Change-Id: I6fcc4641c8d1dff324fb9a1096d3b38e10c9344f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1751182Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686376}
parent 334c21c5
...@@ -81,6 +81,8 @@ std::string GetMimeTypeForPath(const std::string& path) { ...@@ -81,6 +81,8 @@ std::string GetMimeTypeForPath(const std::string& path) {
// An URLDataSource implementation that handles devtools://devtools/ // An URLDataSource implementation that handles devtools://devtools/
// requests. Three types of requests could be handled based on the URL path: // requests. Three types of requests could be handled based on the URL path:
// 1. /bundled/: bundled DevTools frontend is served. // 1. /bundled/: bundled DevTools frontend is served.
// when built with debug_devtools=true, the path can be provided via
// --custom-devtools-frontend.
// 2. /remote/: remote DevTools frontend is served from App Engine. // 2. /remote/: remote DevTools frontend is served from App Engine.
// 3. /custom/: custom DevTools frontend is served from the server as specified // 3. /custom/: custom DevTools frontend is served from the server as specified
// by the --custom-devtools-frontend flag. // by the --custom-devtools-frontend flag.
...@@ -373,8 +375,14 @@ void DevToolsDataSource::StartFileRequestForDebugDevtools( ...@@ -373,8 +375,14 @@ void DevToolsDataSource::StartFileRequestForDebugDevtools(
if (command_line->HasSwitch(switches::kCustomDevtoolsFrontend)) { if (command_line->HasSwitch(switches::kCustomDevtoolsFrontend)) {
inspector_debug_dir = inspector_debug_dir =
command_line->GetSwitchValuePath(switches::kCustomDevtoolsFrontend); command_line->GetSwitchValuePath(switches::kCustomDevtoolsFrontend);
} else if (!base::PathService::Get(chrome::DIR_INSPECTOR_DEBUG, // --custom-devtools-frontend may already be used to specify an URL.
&inspector_debug_dir)) { // In that case, fall back to the default debug-devtools bundle.
if (!base::PathExists(inspector_debug_dir))
inspector_debug_dir.clear();
}
if (inspector_debug_dir.empty() &&
!base::PathService::Get(chrome::DIR_INSPECTOR_DEBUG,
&inspector_debug_dir)) {
callback.Run(CreateNotFoundResponse()); callback.Run(CreateNotFoundResponse());
return; return;
} }
......
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