谷歌浏览器如何在看起来像单个应用程序的情况下将标签隔离到单独的进程中? [英] How can Google Chrome isolate tabs into separate processes while looking like a single application?

查看:21
本文介绍了谷歌浏览器如何在看起来像单个应用程序的情况下将标签隔离到单独的进程中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们被告知 Google Chrome 在单独的进程中运行每个标签页.因此,一个选项卡中的崩溃不会导致其他选项卡出现问题.

We have been told that Google Chrome runs each tab in a separate process. Therefore a crash in one tab would not cause problems in the other tabs.

AFAIK,多进程主要用于没有 GUI 的程序中.我从未读过任何可以将多个 GUI 进程嵌入到单个进程中的技术.

AFAIK, multi-processes are mostly used in programs without a GUI. I have never read any technique that could embed multiple GUI processes into a single one.

Chrome 如何做到这一点?

How does Chrome do that?

我问这个问题是因为我正在设计 CCTV 软件,该软件将使用来自多个相机制造商的视频解码 SDK,其中一些还远非稳定.所以我更喜欢在不同的进程中运行这些 SDK,我认为这与 Chrome 类似.

I am asking this question because I am designing CCTV software which will use video decoding SDKs from multiple camera manufactures, some of which are far from stable. So I prefer to run these SDKs in different processes, which I thought is similar to Chrome.

推荐答案

基本上,他们使用另一个过程将它们全部粘合到 GUI 中.

Basically, they use another process that glues them all together into the GUI.

Google Chrome 创建了三种不同类型的进程:浏览器、渲染器和插件.

Google Chrome creates three different types of processes: browser, renderers, and plug-ins.

浏览器:只有一个浏览器进程,用于管理浏览器的选项卡、窗口和chrome".此过程还处理与磁盘、网络、用户输入和显示的所有交互,但不会尝试解析或呈现来自网络的任何内容.

Browser: There's only one browser process, which manages the tabs, windows, and "chrome" of the browser. This process also handles all interactions with the disk, network, user input, and display, but it makes no attempt to parse or render any content from the web.

渲染器:浏览器进程创建许多渲染器进程,每个进程负责渲染网页.渲染器进程包含用于处理 HTML、JavaScript、CSS、图像等的所有复杂逻辑.Chrome 使用开源 WebKit 渲染引擎实现了这一点,Apple 的 Safari 网络浏览器也使用了该引擎.每个渲染器进程都在沙箱中运行,这意味着它几乎无法直接访问磁盘、网络或显示器.与 Web 应用程序的所有交互,包括用户输入事件和屏幕绘制,都必须经过浏览器进程.这让浏览器进程可以监控渲染器是否存在可疑活动,如果怀疑发生了漏洞利用,则将其杀死.

Renderers: The browser process creates many renderer processes, each responsible for rendering web pages. The renderer processes contain all the complex logic for handling HTML, JavaScript, CSS, images, and so on. Chrome achieves this using the open source WebKit rendering engine, which is also used by Apple's Safari web browser. Each renderer process is run in a sandbox, which means it has almost no direct access to the disk, network, or display. All interactions with web apps, including user input events and screen painting, must go through the browser process. This lets the browser process monitor the renderers for suspicious activity, killing them if it suspects an exploit has occurred.

插件:浏览器进程还会为正在使用的每种类型的插件(例如 Flash、Quicktime 或 Adob​​e Reader)创建一个进程.这些进程只包含插件本身,以及一些让它们与浏览器和渲染器交互的胶水代码.

Plug-ins: The browser process also creates one process for each type of plug-in that is in use, such as Flash, Quicktime, or Adobe Reader. These processes just contain the plug-ins themselves, along with some glue code to let them interact with the browser and renderers.

来源:Chromium 博客:多进程架构

这篇关于谷歌浏览器如何在看起来像单个应用程序的情况下将标签隔离到单独的进程中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆