|
|
Chromium Code Reviews
DescriptionFixed not working inspector in case of Remote Target
devtools_frontend_url is not reachable when using TCPDeviceProvicer.
Fix devtools_frontend_url when it is not valid.
BUG=674394
Patch Set 1 #Patch Set 2 : Fixed not working inspector in case of Remote Target #Patch Set 3 : Fixed not working inspector in case of Remote Target #
Messages
Total messages: 22 (9 generated)
Description was changed from ========== Fixed not working inspector in case of Remote Target devtools_frontend_url is not reachable when using TCPDeviceProvicer. Fix devtools_frontend_url when it is not valid. BUG=674394 ========== to ========== Fixed not working inspector in case of Remote Target devtools_frontend_url is not reachable when using TCPDeviceProvicer. Fix devtools_frontend_url when it is not valid. BUG=674394 ==========
wanchang.ryu@lge.com changed reviewers: + dgozman@chromium.org
The CQ bit was checked by wanchang.ryu@lge.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full committers or once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer, _not_ a full super star committer. See http://www.chromium.org/getting-involved/become-a-committer Note that this has nothing to do with OWNERS files.
The CQ bit was unchecked by wanchang.ryu@lge.com
Dear all, I would like you to review the patch. Inspector is not opened on the chrome:inspect tab, when network target is used. Network target itself opens remote debugging port and provides invalid devtools_frontend_url. This patch fix the devtools_frontend_url when it is invalid. Any comment will be appreciated. Thanks. Wanchang.
Dear dgozman, Would you review this patch ? Thanks Wanchang.
wanchang.ryu@lge.com changed reviewers: + pfeldman@chromium.org
I'd have to look into it to say how it should be fixed, but we've lost the remote front-end url somewhere, so we open bundled front-end instead of the remote one.
On 2016/12/22 17:40:36, pfeldman wrote: > I'd have to look into it to say how it should be fixed, but we've lost the > remote front-end url somewhere, so we open bundled front-end instead of the > remote one. Dear pfeldman, Thanks for your comment. I'm happy to start discussing with you. I'd like share my debugging information regarding this patch. Could you take a look this ? The front-end url is fine when the remote target is android device. But The front-end url of others is broken. Front-end url is set in remote debugging server Android Browser https://cs.chromium.org/chromium/src/chrome/browser/android/devtools_server.c... const char kFrontEndURL[] = "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; DevToolsAgentHost::StartRemoteDebuggingServer( std::move(factory), base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), base::FilePath(), base::FilePath(), version_info::GetProductNameAndVersionForUserAgent(), ::GetUserAgent()); Android Webview https://cs.chromium.org/chromium/src/android_webview/native/aw_devtools_serve... const char kFrontEndURL[] = "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; DevToolsAgentHost::StartRemoteDebuggingServer( std::move(factory), base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), base::FilePath(), base::FilePath(), GetProduct(), GetUserAgent()); Chrome Browser https://cs.chromium.org/chromium/src/chrome/browser/devtools/remote_debugging... content::DevToolsAgentHost::StartRemoteDebuggingServer( base::MakeUnique<TCPServerSocketFactory>(ip, port), std::string(), output_dir, debug_frontend_dir, version_info::GetProductNameAndVersionForUserAgent(), ::GetUserAgent()); In Chrome Browser, It uses empty string for the front-end url then, it is set by "/devtools/inspector.html" in https://cs.chromium.org/chromium/src/content/browser/devtools/devtools_http_h... DevToolsHttpHandler::DevToolsHttpHandler( DevToolsManagerDelegate* delegate, std::unique_ptr<DevToolsSocketFactory> socket_factory, const std::string& frontend_url, const base::FilePath& output_directory, const base::FilePath& debug_frontend_dir, const std::string& product_name, const std::string& user_agent) : thread_(nullptr), frontend_url_(frontend_url), product_name_(product_name), user_agent_(user_agent), server_wrapper_(nullptr), delegate_(delegate), socket_factory_(nullptr), weak_factory_(this) { bool bundles_resources = frontend_url_.empty(); if (frontend_url_.empty()) frontend_url_ = "/devtools/inspector.html"; So, Front-end url is broken in remote target of chrome browser. As you said, when it is broken, the bundled front-end is used. I think it is only when DEBUG_DEVTOOLS is defined. https://cs.chromium.org/chromium/src/chrome/browser/ui/webui/devtools_ui.cc?r... #if BUILDFLAG(DEBUG_DEVTOOLS) // Local frontend url provided by InspectUI. const char kFallbackFrontendURL[] = "chrome-devtools://devtools/bundled/inspector.html"; #else // URL causing the DevTools window to display a plain text warning. const char kFallbackFrontendURL[] = "data:text/plain,Cannot load DevTools frontend from an untrusted origin"; #endif // BUILDFLAG(DEBUG_DEVTOOLS) In my patch, it uses webkit revision of remote target to make front end url when it is broken. I think it would be better it is possible to consider the revision of webkit of remote target instead just using bundle front-end url. Thanks
On 2016/12/23 00:41:59, wanchang wrote: > On 2016/12/22 17:40:36, pfeldman wrote: > > I'd have to look into it to say how it should be fixed, but we've lost the > > remote front-end url somewhere, so we open bundled front-end instead of the > > remote one. > > Dear pfeldman, > > Thanks for your comment. I'm happy to start discussing with you. > > I'd like share my debugging information regarding this patch. Could you take a > look this ? The front-end url is fine when the remote target is android device. > But The front-end url of others is broken. > > Front-end url is set in remote debugging server > > Android Browser > https://cs.chromium.org/chromium/src/chrome/browser/android/devtools_server.c... > const char kFrontEndURL[] = > "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; > DevToolsAgentHost::StartRemoteDebuggingServer( > std::move(factory), > base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), > base::FilePath(), base::FilePath(), > version_info::GetProductNameAndVersionForUserAgent(), ::GetUserAgent()); > > Android Webview > https://cs.chromium.org/chromium/src/android_webview/native/aw_devtools_serve... > const char kFrontEndURL[] = > "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; > DevToolsAgentHost::StartRemoteDebuggingServer( > std::move(factory), > base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), > base::FilePath(), base::FilePath(), > GetProduct(), GetUserAgent()); > > Chrome Browser > https://cs.chromium.org/chromium/src/chrome/browser/devtools/remote_debugging... > content::DevToolsAgentHost::StartRemoteDebuggingServer( > base::MakeUnique<TCPServerSocketFactory>(ip, port), > std::string(), > output_dir, > debug_frontend_dir, > version_info::GetProductNameAndVersionForUserAgent(), > ::GetUserAgent()); > > In Chrome Browser, It uses empty string for the front-end url then, it is set by > "/devtools/inspector.html" in > https://cs.chromium.org/chromium/src/content/browser/devtools/devtools_http_h... > > DevToolsHttpHandler::DevToolsHttpHandler( > DevToolsManagerDelegate* delegate, > std::unique_ptr<DevToolsSocketFactory> socket_factory, > const std::string& frontend_url, > const base::FilePath& output_directory, > const base::FilePath& debug_frontend_dir, > const std::string& product_name, > const std::string& user_agent) > : thread_(nullptr), > frontend_url_(frontend_url), > product_name_(product_name), > user_agent_(user_agent), > server_wrapper_(nullptr), > delegate_(delegate), > socket_factory_(nullptr), > weak_factory_(this) { > bool bundles_resources = frontend_url_.empty(); > if (frontend_url_.empty()) > frontend_url_ = "/devtools/inspector.html"; > > So, Front-end url is broken in remote target of chrome browser. As you said, > when it is broken, the bundled front-end is used. I think it is only when > DEBUG_DEVTOOLS is defined. > > https://cs.chromium.org/chromium/src/chrome/browser/ui/webui/devtools_ui.cc?r... > > #if BUILDFLAG(DEBUG_DEVTOOLS) > // Local frontend url provided by InspectUI. > const char kFallbackFrontendURL[] = > "chrome-devtools://devtools/bundled/inspector.html"; > #else > // URL causing the DevTools window to display a plain text warning. > const char kFallbackFrontendURL[] = > "data:text/plain,Cannot load DevTools frontend from an untrusted origin"; > #endif // BUILDFLAG(DEBUG_DEVTOOLS) > > In my patch, it uses webkit revision of remote target to make front end url when > it is broken. I think it would be better it is possible to consider the revision > of webkit of remote target instead just using bundle front-end url. > > Thanks Thanks for your analysis. Could it be that the issue is with DevToolsHttpHandler? Would it be possible to include the proper URL in the response?
On 2017/01/03 22:08:24, eostroukhov wrote: > On 2016/12/23 00:41:59, wanchang wrote: > > On 2016/12/22 17:40:36, pfeldman wrote: > > > I'd have to look into it to say how it should be fixed, but we've lost the > > > remote front-end url somewhere, so we open bundled front-end instead of the > > > remote one. > > > > Dear pfeldman, > > > > Thanks for your comment. I'm happy to start discussing with you. > > > > I'd like share my debugging information regarding this patch. Could you take a > > look this ? The front-end url is fine when the remote target is android > device. > > But The front-end url of others is broken. > > > > Front-end url is set in remote debugging server > > > > Android Browser > > > https://cs.chromium.org/chromium/src/chrome/browser/android/devtools_server.c... > > const char kFrontEndURL[] = > > "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; > > DevToolsAgentHost::StartRemoteDebuggingServer( > > std::move(factory), > > base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), > > base::FilePath(), base::FilePath(), > > version_info::GetProductNameAndVersionForUserAgent(), ::GetUserAgent()); > > > > Android Webview > > > https://cs.chromium.org/chromium/src/android_webview/native/aw_devtools_serve... > > const char kFrontEndURL[] = > > "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; > > DevToolsAgentHost::StartRemoteDebuggingServer( > > std::move(factory), > > base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), > > base::FilePath(), base::FilePath(), > > GetProduct(), GetUserAgent()); > > > > Chrome Browser > > > https://cs.chromium.org/chromium/src/chrome/browser/devtools/remote_debugging... > > content::DevToolsAgentHost::StartRemoteDebuggingServer( > > base::MakeUnique<TCPServerSocketFactory>(ip, port), > > std::string(), > > output_dir, > > debug_frontend_dir, > > version_info::GetProductNameAndVersionForUserAgent(), > > ::GetUserAgent()); > > > > In Chrome Browser, It uses empty string for the front-end url then, it is set > by > > "/devtools/inspector.html" in > > > https://cs.chromium.org/chromium/src/content/browser/devtools/devtools_http_h... > > > > DevToolsHttpHandler::DevToolsHttpHandler( > > DevToolsManagerDelegate* delegate, > > std::unique_ptr<DevToolsSocketFactory> socket_factory, > > const std::string& frontend_url, > > const base::FilePath& output_directory, > > const base::FilePath& debug_frontend_dir, > > const std::string& product_name, > > const std::string& user_agent) > > : thread_(nullptr), > > frontend_url_(frontend_url), > > product_name_(product_name), > > user_agent_(user_agent), > > server_wrapper_(nullptr), > > delegate_(delegate), > > socket_factory_(nullptr), > > weak_factory_(this) { > > bool bundles_resources = frontend_url_.empty(); > > if (frontend_url_.empty()) > > frontend_url_ = "/devtools/inspector.html"; > > > > So, Front-end url is broken in remote target of chrome browser. As you said, > > when it is broken, the bundled front-end is used. I think it is only when > > DEBUG_DEVTOOLS is defined. > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ui/webui/devtools_ui.cc?r... > > > > #if BUILDFLAG(DEBUG_DEVTOOLS) > > // Local frontend url provided by InspectUI. > > const char kFallbackFrontendURL[] = > > "chrome-devtools://devtools/bundled/inspector.html"; > > #else > > // URL causing the DevTools window to display a plain text warning. > > const char kFallbackFrontendURL[] = > > "data:text/plain,Cannot load DevTools frontend from an untrusted origin"; > > #endif // BUILDFLAG(DEBUG_DEVTOOLS) > > > > In my patch, it uses webkit revision of remote target to make front end url > when > > it is broken. I think it would be better it is possible to consider the > revision > > of webkit of remote target instead just using bundle front-end url. > > > > Thanks > > Thanks for your analysis. > > Could it be that the issue is with DevToolsHttpHandler? Would it be possible to > include the proper URL in the response? Thanks eostroukhov for your comment. As I understand, the frontendurl in the response of "/json/list" is used in two cases. One case is when connecting remote debugging port directly. https://cs.chromium.org/chromium/src/chrome/browser/devtools/frontend/devtool... In this case, the baseurl is used with frontendurl in the client browser side if it is a relative url. Th other case is from chrome:inspect url. https://cs.chromium.org/chromium/src/chrome/browser/devtools/device/devtools_... In this case, frontendurl is used as it is to open external inspector. https://cs.chromium.org/chromium/src/chrome/browser/devtools/devtools_window.... To make absolute url path of frontendurl in DevToolsHttpHandler, there were two possible. 1. local ip and port of remote debugging device 2. proxy frontendurl like starting with http://chrome-devtools-frontend.appspot.com/ It is not possible to connect remote debugging port with solution 1 if remote target is behind proxy or NAT. With solution 2, It could solve a problem of behind NAT but it is connecting the proxy frontendurl instead the remote debugging port (behavior will be changed from previous.) So I think, It is better just using the frontendurl as current and get it fixed in devtools_device_discovery side if the frontendurl is invalid. How do you think ? Thanks.
lukyanov811@gmail.com changed reviewers: + lukyanov811@gmail.com
lgtm djendrius@inbox.ru
lgtm
The CQ bit was checked by wanchang.ryu@lge.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full committers or once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer, _not_ a full super star committer. See http://www.chromium.org/getting-involved/become-a-committer Note that this has nothing to do with OWNERS files.
Could you take a look my investigation and review the patch ? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
