chromium 的render process创建堆栈

本文通过具体的调用堆栈示例介绍了Chromium浏览器中多线程异步操作及进程创建的过程,展示了从BrowserThread::PostTask到StartProcessWithAccess等关键函数的调用流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、通过BrowserThread::PostTask的调用堆栈:

content.dll!content::ChildProcessLauncher::ChildProcessLauncher(const FilePath & exposed_dir, CommandLine * cmd_line, int child_process_id, content::ChildProcessLauncher::Client * client)  行 401	C++
 	content.dll!content::RenderProcessHostImpl::Init()  行 471 + 0xb0 字节	C++
 	content.dll!content::RenderViewHostImpl::CreateRenderView(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & frame_name, int opener_route_id, int max_page_id)  行 235 + 0x4b 字节	C++
 	content.dll!content::WebContentsImpl::CreateRenderViewForRenderManager(content::RenderViewHost * render_view_host, int opener_route_id)  行 3323 + 0x36 字节	C++
 	content.dll!content::RenderViewHostManager::InitRenderView(content::RenderViewHost * render_view_host, int opener_route_id)  行 679 + 0x1e 字节	C++
 	content.dll!content::RenderViewHostManager::Navigate(const content::NavigationEntryImpl & entry)  行 122 + 0xe 字节	C++
 	content.dll!content::WebContentsImpl::NavigateToEntry(const content::NavigationEntryImpl & entry, content::NavigationController::ReloadType reload_type)  行 1583 + 0x12 字节	C++
 	content.dll!content::WebContentsImpl::NavigateToPendingEntry(content::NavigationController::ReloadType reload_type)  行 1566	C++
 	content.dll!content::NavigationControllerImpl::NavigateToPendingEntry(content::NavigationController::ReloadType reload_type)  行 1550 + 0xf 字节	C++
 	content.dll!content::NavigationControllerImpl::LoadEntry(content::NavigationEntryImpl * entry)  行 404	C++
 	content.dll!content::NavigationControllerImpl::LoadURLWithParams(const content::NavigationController::LoadURLParams & params)  行 747	C++
 	content.dll!content::NavigationControllerImpl::LoadURL(const GURL & url, const content::Referrer & referrer, content::PageTransition transition, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & extra_headers)  行 666 + 0x16 字节	C++
 	content_shell.exe!content::Shell::LoadURL(const GURL & url)  行 146 + 0xc1 字节	C++
 	content_shell.exe!content::Shell::CreateNewWindow(content::BrowserContext * browser_context, const GURL & url, content::SiteInstance * site_instance, int routing_id, content::WebContents * base_web_contents)  行 137	C++
 	content_shell.exe!content::ShellBrowserMainParts::PreMainMessageLoopRun()  行 137 + 0x46 字节	C++
 	content.dll!content::BrowserMainLoop::CreateThreads()  行 469 + 0x26 字节	C++
 	content.dll!content::BrowserMainRunnerImpl::Initialize(const content::MainFunctionParams & parameters)  行 106	C++
 	content_shell.exe!ShellBrowserMain(const content::MainFunctionParams & parameters)  行 111 + 0x2a 字节	C++
 	content_shell.exe!content::ShellMainDelegate::RunProcess(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & process_type, const content::MainFunctionParams & main_function_params)  行 134 + 0x9 字节	C++
 	content.dll!content::RunNamedProcessTypeMain(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & process_type, const content::MainFunctionParams & main_function_params, content::ContentMainDelegate * delegate)  行 438 + 0x17 字节	C++
 	content.dll!content::ContentMainRunnerImpl::Run()  行 754 + 0x14 字节	C++
 	content.dll!content::ContentMain(HINSTANCE__ * instance, sandbox::SandboxInterfaceInfo * sandbox_info, content::ContentMainDelegate * delegate)  行 35 + 0x1a 字节	C++
 	content_shell.exe!wWinMain(HINSTANCE__ * instance, HINSTANCE__ * __formal, HINSTANCE__ * __formal, HINSTANCE__ * __formal)  行 24 + 0x14 字节	C++
 	content_shell.exe!__tmainCRTStartup()  行 547 + 0x2c 字节	C
 	content_shell.exe!wWinMainCRTStartup()  行 371	C

2、通过message_pump_default获取任务创建进程的堆栈:

>	content_shell.exe!sandbox::BrokerServicesBase::SpawnTarget(const wchar_t * exe_path, const wchar_t * command_line, sandbox::TargetPolicy * policy, _PROCESS_INFORMATION * target_info)  行 404	C++
 	content.dll!content::StartProcessWithAccess(CommandLine * cmd_line, const FilePath & exposed_dir)  行 831 + 0xe1 字节	C++
 	content.dll!content::ChildProcessLauncher::Context::LaunchInternal(scoped_refptr<content::ChildProcessLauncher::Context> this_object, content::BrowserThread::ID client_thread_id, int child_process_id, const FilePath & exposed_dir, CommandLine * cmd_line)  行 168 + 0xd 字节	C++
 	content.dll!base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath const &,CommandLine *)>::Run(const scoped_refptr<content::ChildProcessLauncher::Context> & a1, const content::BrowserThread::ID & a2, const int & a3, const FilePath & a4, CommandLine * const & a5)  行 427 + 0x58 字节	C++
 	content.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath const &,CommandLine *)>,void __cdecl(content::ChildProcessLauncher::Context *,enum content::BrowserThread::ID const &,int const &,FilePath const &,CommandLine * const &)>::MakeItSo(base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath const &,CommandLine *)> runnable, content::ChildProcessLauncher::Context * a1, const content::BrowserThread::ID & a2, const int & a3, const FilePath & a4, CommandLine * const & a5)  行 994 + 0x5e 字节	C++
 	content.dll!base::internal::Invoker<5,base::internal::BindState<base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath const &,CommandLine *)>,void __cdecl(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath const &,CommandLine *),void __cdecl(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath,CommandLine *)>,void __cdecl(scoped_refptr<content::ChildProcessLauncher::Context>,enum content::BrowserThread::ID,int,FilePath const &,CommandLine *)>::Run(base::internal::BindStateBase * base)  行 1815 + 0x4f 字节	C++
 	base.dll!base::Callback<void __cdecl(void)>::Run()  行 396 + 0xe 字节	C++
 	base.dll!MessageLoop::RunTask(const base::PendingTask & pending_task)  行 475	C++
 	base.dll!MessageLoop::DeferOrRunPendingTask(const base::PendingTask & pending_task)  行 488	C++
 	base.dll!MessageLoop::DoWork()  行 668 + 0xc 字节	C++
 	base.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate)  行 29 + 0xf 字节	C++
 	base.dll!MessageLoop::RunInternal()  行 430 + 0x29 字节	C++
 	base.dll!MessageLoop::RunHandler()  行 404	C++
 	base.dll!base::RunLoop::Run()  行 46	C++
 	base.dll!MessageLoop::Run()  行 311	C++
 	base.dll!base::Thread::Run(MessageLoop * message_loop)  行 151	C++
 	content.dll!content::BrowserThreadImpl::ProcessLauncherThreadRun(MessageLoop * message_loop)  行 142 + 0xf 字节	C++
 	content.dll!content::BrowserThreadImpl::Run(MessageLoop * message_loop)  行 178 + 0xc 字节	C++
 	base.dll!base::Thread::ThreadMain()  行 195 + 0x16 字节	C++
 	base.dll!base::`anonymous namespace'::ThreadFunc(void * params)  行 59 + 0xe 字节	C++

这个案列对理解chromium的多线程异步和进程创建有一定的帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值