Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Google Chrome isolate tabs into separate processes while looking like a single application?

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, 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.

How does Chrome do that?

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.

like image 398
ablmf Avatar asked Jan 07 '10 10:01

ablmf


People also ask

Are Chrome tabs separate processes?

For every extra tab or extension you're using, Chrome creates a separate set of operating system processes, all running simultaneously. This multi-process architecture is a unique Google Chrome feature that allows your browser to not rely on the work of every single process to function.

Why does Chrome appear as multiple processes?

You may have noticed that Google Chrome will often have more than one process open, even if you only have one tab open. This occurs because Google Chrome deliberately separates the browser, the rendering engine, and the plugins from each other by running them in separate processes.

Can Chrome split two tabs?

First, open Chrome and pull up at least two tabs. Long-press the Android overview button to open the split-screen app selector. Then, open the Chrome overflow menu in the top half of the screen and tap "Move to other window." This moves your current Chrome tab into the bottom half of the screen.


1 Answers

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

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

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.

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.

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.

Source: Chromium Blog: Multi-process Architecture

like image 73
Daniel Vassallo Avatar answered Oct 10 '22 05:10

Daniel Vassallo