articles icon indicating copy to clipboard operation
articles copied to clipboard

chromium-dev groups话题收集

Open xinali opened this issue 2 years ago • 0 comments

订阅了chromium-dev groups频道,有时会看到比较有意思的话题,或者自己认识比较少的内容,就收集一下

1. How to find out when an IO thread is created in the Browser Process

原文

说的是如何在Browser进程里定位到IO线程是何时创建的

解决办法,在BrowserThreadImpl::BrowserThreadImpl设下断点

     chrome.dll!content::BrowserThreadImpl::BrowserThreadImpl(content::BrowserThread::ID identifier, scoped_refptr<base::SingleThreadTaskRunner> task_runner) Line 104    C++
     chrome.dll!content::BrowserProcessIOThread::RegisterAsBrowserThread() Line 51    C++
>    chrome.dll!content::BrowserMainLoop::CreateThreads() Line 909    C++
     chrome.dll!base::OnceCallback<int ()>::Run() Line 143    C++
     chrome.dll!content::StartupTaskRunner::RunAllTasksNow() Line 43    C++
     chrome.dll!content::BrowserMainLoop::CreateStartupTasks() Line 869    C++
     chrome.dll!content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams parameters) Line 137    C++
     chrome.dll!content::BrowserMain(content::MainFunctionParams parameters) Line 26    C++

然后就会发现,The first thread created here was the UI thread. The second one was the IO Thread.

还有一个方法,You actually want to look at BrowserTaskExecutor::CreateIOThread() (BrowserProcessIOThread::RegisterAsBrowserThread() is when we register the previously created IO thread as "BrowserThread::IO")

2. 如何开启和记录chromium commandline switch

command line switch,也可以通过这种方式自定义commandline

xinali avatar Jul 06 '22 14:07 xinali