Commit c5c57b1d authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Do not use remote modules with --custom-devtools-frontend

This reverts part of 5abacc3b and restores the query param
'debugFrontend', which makes the frontend load resources
locally rather from remote URL.

R=caseq@chromium.org, paulirish@chromium.org, tvanderlippe@chromium.org

Fixed: chromium:1098505
Change-Id: I61330d4f679fb280245e98122ac23d0031e89e11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2263733
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: default avatarPaul Irish <paulirish@chromium.org>
Reviewed-by: default avatarTim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782139}
parent a8772166
...@@ -330,7 +330,7 @@ std::string SanitizeFrontendQueryParam( ...@@ -330,7 +330,7 @@ std::string SanitizeFrontendQueryParam(
const std::string& key, const std::string& key,
const std::string& value) { const std::string& value) {
// Convert boolean flags to true. // Convert boolean flags to true.
if (key == "can_dock" || key == "isSharedWorker" || if (key == "can_dock" || key == "debugFrontend" || key == "isSharedWorker" ||
key == "v8only" || key == "remoteFrontend" || key == "nodeFrontend" || key == "v8only" || key == "remoteFrontend" || key == "nodeFrontend" ||
key == "hasOtherClients" || key == "uiDevTools") key == "hasOtherClients" || key == "uiDevTools")
return "true"; return "true";
......
...@@ -19,12 +19,15 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) { ...@@ -19,12 +19,15 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) {
"devtools://devtools/bundled/devtools.html#hash"}, "devtools://devtools/bundled/devtools.html#hash"},
{"devtools://devtools/some/random/path", {"devtools://devtools/some/random/path",
"devtools://devtools/some/random/path"}, "devtools://devtools/some/random/path"},
{"devtools://devtools/bundled/devtools.html?debugFrontend=true",
"devtools://devtools/bundled/devtools.html?debugFrontend=true"},
{"devtools://devtools/bundled/devtools.html" {"devtools://devtools/bundled/devtools.html"
"?some-flag=flag&v8only=true" "?some-flag=flag&v8only=true&debugFrontend=a"
"&another-flag=another-flag&can_dock=false&isSharedWorker=notreally" "&another-flag=another-flag&can_dock=false&isSharedWorker=notreally"
"&remoteFrontend=sure", "&remoteFrontend=sure",
"devtools://devtools/bundled/devtools.html" "devtools://devtools/bundled/devtools.html"
"?v8only=true&can_dock=true&isSharedWorker=true&remoteFrontend=true"}, "?v8only=true&debugFrontend=true"
"&can_dock=true&isSharedWorker=true&remoteFrontend=true"},
{"devtools://devtools/?ws=any-value-is-fine", {"devtools://devtools/?ws=any-value-is-fine",
"devtools://devtools/?ws=any-value-is-fine"}, "devtools://devtools/?ws=any-value-is-fine"},
{"devtools://devtools/" {"devtools://devtools/"
...@@ -51,7 +54,7 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) { ...@@ -51,7 +54,7 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) {
"https://chrome-devtools-frontend.appspot.com/serve_file/path/"}, "https://chrome-devtools-frontend.appspot.com/serve_file/path/"},
{"devtools://devtools/?remoteBase=" {"devtools://devtools/?remoteBase="
"https://chrome-devtools-frontend.appspot.com/serve_file/" "https://chrome-devtools-frontend.appspot.com/serve_file/"
"@123719741873/inspector.html", "@123719741873/inspector.html%3FdebugFrontend%3Dfalse",
"devtools://devtools/?remoteBase=" "devtools://devtools/?remoteBase="
"https://chrome-devtools-frontend.appspot.com/serve_file/" "https://chrome-devtools-frontend.appspot.com/serve_file/"
"@123719741873/"}, "@123719741873/"},
...@@ -63,10 +66,10 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) { ...@@ -63,10 +66,10 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) {
"@b4907cc5d602ff470740b2eb6344b517edecb7b9/&can_dock=true"}, "@b4907cc5d602ff470740b2eb6344b517edecb7b9/&can_dock=true"},
{"devtools://devtools/?remoteFrontendUrl=" {"devtools://devtools/?remoteFrontendUrl="
"https://chrome-devtools-frontend.appspot.com/serve_rev/" "https://chrome-devtools-frontend.appspot.com/serve_rev/"
"@12345/inspector.html", "@12345/inspector.html%3FdebugFrontend%3Dfalse",
"devtools://devtools/?remoteFrontendUrl=" "devtools://devtools/?remoteFrontendUrl="
"https%3A%2F%2Fchrome-devtools-frontend.appspot.com%2Fserve_rev" "https%3A%2F%2Fchrome-devtools-frontend.appspot.com%2Fserve_rev"
"%2F%4012345%2Finspector.html"}, "%2F%4012345%2Finspector.html%3FdebugFrontend%3Dtrue"},
{"devtools://devtools/?remoteFrontendUrl=" {"devtools://devtools/?remoteFrontendUrl="
"https://chrome-devtools-frontend.appspot.com/serve_rev/" "https://chrome-devtools-frontend.appspot.com/serve_rev/"
"@12345/inspector.html%22></iframe>something", "@12345/inspector.html%22></iframe>something",
...@@ -81,10 +84,11 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) { ...@@ -81,10 +84,11 @@ TEST_F(DevToolsUIBindingsTest, SanitizeFrontendURL) {
{"devtools://devtools/?remoteFrontendUrl=" {"devtools://devtools/?remoteFrontendUrl="
"https://chrome-devtools-frontend.appspot.com/serve_rev/" "https://chrome-devtools-frontend.appspot.com/serve_rev/"
"@12345/devtools.html%3Fws%3Danyvalue" "@12345/devtools.html%3Fws%3Danyvalue"
"&unencoded=value", "&unencoded=value&debugFrontend=true",
"devtools://devtools/?remoteFrontendUrl=" "devtools://devtools/?remoteFrontendUrl="
"https%3A%2F%2Fchrome-devtools-frontend.appspot.com%2Fserve_rev" "https%3A%2F%2Fchrome-devtools-frontend.appspot.com%2Fserve_rev"
"%2F%4012345%2Fdevtools.html%3Fws%3Danyvalue"}, "%2F%4012345%2Fdevtools.html%3Fws%3Danyvalue"
"&debugFrontend=true"},
{"devtools://devtools/?remoteFrontendUrl=" {"devtools://devtools/?remoteFrontendUrl="
"https://chrome-devtools-frontend.appspot.com/serve_rev/" "https://chrome-devtools-frontend.appspot.com/serve_rev/"
"@12345/inspector.html%23%27", "@12345/inspector.html%23%27",
......
...@@ -226,6 +226,10 @@ GURL DecorateFrontendURL(const GURL& base_url) { ...@@ -226,6 +226,10 @@ GURL DecorateFrontendURL(const GURL& base_url) {
switches::kDevToolsFlags); switches::kDevToolsFlags);
} }
if (command_line->HasSwitch(switches::kCustomDevtoolsFrontend)) {
url_string += "&debugFrontend=true";
}
return GURL(url_string); return GURL(url_string);
} }
......
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