chore: support --remote-debugging-pipe (#23433)

This commit is contained in:
Pavel Feldman 2020-05-07 21:27:55 -07:00 committed by GitHub
parent 06bf0d08dc
commit 93f6129c80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 79 additions and 2 deletions

View file

@ -439,10 +439,14 @@ void ElectronBrowserMainParts::PreMainMessageLoopRun() {
content::WebUIControllerFactory::RegisterFactory(
ElectronWebUIControllerFactory::GetInstance());
// --remote-debugging-port
auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kRemoteDebuggingPort))
if (command_line->HasSwitch(switches::kRemoteDebuggingPipe)) {
// --remote-debugging-pipe
content::DevToolsAgentHost::StartRemoteDebuggingPipeHandler();
} else if (command_line->HasSwitch(switches::kRemoteDebuggingPort)) {
// --remote-debugging-port
DevToolsManagerDelegate::StartHttpHandler();
}
#if !defined(OS_MACOSX)
// The corresponding call in macOS is in ElectronApplicationDelegate.
@ -511,6 +515,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
node_env_.reset();
fake_browser_process_->PostMainMessageLoopRun();
content::DevToolsAgentHost::StopRemoteDebuggingPipeHandler();
}
#if !defined(OS_MACOSX)