Talking about the mobile web and the single/multi-process __web of the browser

Source: Internet
Author: User

The recent Firefox OS (the original boot to Gecko) pushes the mobile web further forward, not only through the web-run environment, but the entire application architecture and running environment, all of which are web-based and system-level. Although to launch the commercial machine next year, in the industry is also throwing stones to stir ripples. After cloud computing, WEB/HTML5 is now hype hot words, before we talk about the impact of HTML5 on the ecosystem from the industrial ecological chain from the perspective of the analysis, this time from the application point of view to do some thinking.

user oriented: Pseudo proposition of web or native

Developers to develop an application, for the user, the platform is based on, consider the existing platform technology, that is, in the possible Ui/ux, can provide users with what content or services. The starting point for development applications is the user, the choice of the Web or native is based on the characteristics of the application, the specific port on which the original platform, the target users and developers of the feasible cost budget.

It all goes back to simple economics: what users to apply to, what values to apply to users, what features are applied, and the cost and benefits of developing applications. Finally, choose the Web or native based on these decisions.

It doesn't make sense to simply discuss the pros and cons of web and native without the specific application requirements. For example, simply using coverage to compliment Web,native actually has two versions of iOS and Android. Not much also. As for the coverage of Symbian,brew, these reasons are less convincing, given the user population of applications and the development of Low-cost smartphones. Which applications are suitable for the web and which applications are suitable for native is the key.

generally speaking, the need for excellent user experience, the use of the underlying functions of the system, that is, the depth of demand, suitable for native applications, and focus on content, especially the expansion of the services of the PC browser, focusing on cloud capabilities, that is, the breadth of requirements, suitable for Web applications.

depth or breadth, depending on the terminal or the cloud, are two important dimensions.

The underlying features include graphics acceleration, sensor usage, and so on. These are said to be given in HTML5, and indeed HTML5 can give a standard interface, but support for the underlying functionality needs to be supported by both the platform and OEM vendors. HTML5 support Simple games, very nostalgic, but the current class of complex graphics processing game ability is still insufficient.

Intelligent terminals and intelligent home, intelligent logistics, such as the combination of customization, native is a natural choice, at least in the early days.

Internet applications, SNS, micro-blog, newspapers and magazines and other publishing industry suitable for the web. Android fragmentation is very large, with different size of the screen, the web has a custom-typesetting function, in a certain range can be adapted to the terminal size, but also in the content of the request, with the size, by the cloud to fit. To the Internet cloud service-oriented manufacturers, terminal is the extension of services.

What are the technologies lacking in Mobile Web technology

The web has many advantages, low thresholds, low maintenance costs, avoidance of App Store partitioning, and why some publishers are dropping apps and betting on the web to give the publishing industry the reason for content providers to choose the Web. There is no problem with the introduction of Web technology, but there are still deficiencies in the issue of application economics, copyright protection, and its own security, efficiency and experience.

performance Constraints : Html/css/js is a scripting language, in the Web running environment for parsing, than binary execution code or intermediate language Java Bite Code efficiency is lower, performance is lower than the original is unable to break the bounds.

Lower -level functionality: HTML5 supports many local features, including increased off-line storage, 2D image capabilities, video/audio streaming, geographic location, access to mobile phone cameras and sensors, and user interface tools. But to the deep bottom of the function, the use of hardware chip media processing, 3D Graphics library (OpenGL calls), is still limited, can only invoke the encapsulated function.

the lag of new features : All the new features of the platform will now be implemented in the platform itself, that is, the native, and then the web-run environment supports this new feature, and the native application is a commercial opportunity to use the new features, and the Web running environment supports the fastest and next version.

Copyright Protection issues: scripting language can view the original code, the protection of the application of intellectual property defects. Of course, copyright in the cloud content provider is not a problem, but for the common need to profit developers is a headache.

security Issues : Both iOS and Android treat applications as a single user running in a sandbox, that is, security protection for the process. We start a browser on the PC, no matter how many pages we open above, it is still a browser process. HTML5 has access to locally sensitive information, such as contacts, the application that is open in the same web run environment, and whether or not there is a barrier between the application. The security issue translates to whether the Web supports multiple processes. And new performance issues: if each mobile Web application is going to open a Web runtime, it can cause a lot of device resources to consume.

differences between single processes and multiple processes

Need to remind, this has nothing to do with HTML5, HTML5 is just API standard interface set, does not include the concrete implementation of the system.

If only a single process can be used, the security protection mechanism provided by the underlying native system cannot be exploited, and a new security framework must be provided. In addition, the single process has a major problem in addition to security issues: one of the occurrences of crash will result in the crash of the entire process, which means that other web runs on the process are also crash off.

For reminders, this has nothing to do with HTML5, HTML5 is just an API standard interface set and does not include a specific implementation of the system.

For the web through Cross-platform tools such as PhoneGap, Mosync, and so on, there are or through the embedded methods provided by the system, such as Android through the WebView control, in which the full web runtime is encapsulated. Different applications are separate processes, as shown in the following figure. This is not in the scope of our discussion.

We need to discuss the following two scenarios:

1. Widgets opened in widget Pannel through widget Manager

2, through the URL in the browser open, multiple applications may be opened in different browser windows, may be different browser tag.

WebKit of single process

WebKit browsers, such as the Android browser, are a single process. Whether the system browser is turned on or the URL specified in the application is intent, the system has only one process com.android.browser.

There are two issues to be noted in this case:

1. Stability and robustness (I've always had a problem with translation to be robust): The crash of a single app can cause the entire browser to crash, that is, apps running on that browser will crash.

2, security issues: Different apps run in the same process. Today, HTML5 supports a number of locally sensitive operations, including storage, user information, how to isolate these apps, and how to provide security within a process.

Not long ago, Mozilla launched the full web operating system: the Firefox OS. Mozilla's PC browser supports multiple processes, but it's not clear what's in the Firefox OS. A single process-initiated security issue must be resolved before it can be commercially available.

The solution: multi-process

With the popularization of HTML5, the ability of the web becomes larger, besides being able to achieve more applications, but also assume greater responsibility. in order to ensure the normal operation and safe operation of the applications, the solution is to divide the single process into multiple processes, and they are isolated from each other to ensure that no one is invalidated and that all is not compromised.

Multiple processes have different ways, one is the application of multiple processes, that is, the parent-child process, there is a main process, there are many child processes, one is independent of multiple processes. The former parent-child process has the same user ID, has the same security policy, and the latter can adopt the security architecture of the native system. Both of these ways can solve stability and robustness.

Google's Chrome and Microsoft IE8 are the first to implement multiple processes, followed by Mozilla Firefox, and are quickly implemented in other WebKit Web browsers, such as Apple Safari.

WebKit2

WEBKIT2 supports multiple processes and is renamed to WebKit2 because it is incompatible with the original WebKit on the API. Web content (js,html, layout) is separated from the application UI in a separate process, providing process separation directly in the framework, benefiting other WebKit based clients such as chat Client,mail client, That is, the app part can stay the same.

The process boundary is below the API boundary. Some WebKit will process the application logic in the app's UI process, and the rest of the Webkit,webcore and JS engines, in web process, handle the actual rendering. These two processes are independent of each other, providing the possibility of placing web process in sandbox safely.

There are two subsystems that support process separation: COREIPC, and Drawingarea. COREIPC, as the name suggests, is the communication between the UI process and the Web process, including message passing and events. Drawingarea is a Cross-platform abstraction drawing area, which can have a variety of cross mapping strategies, simple is the bitmap of shared memory.

The Webpageproxy in the WebKit (UI process) passes the IPC, passing the URL, and the Web process process, while the Web process WebKit (Web process) handles the network, WebCore renders, If a HTML5 URL has malicious code, it will crash the corresponding web process without affecting the operation of other apps.

Chrome

Chrome is the first browser to support multiple processes and is the most responsible one. In chrome, processes are decomposed on top of API boundaries, optimized as a multi-process application and managed by proxy and process. That is, this is the way the parent-child process, and not as a stand-alone process in webKit2 as a system for security, related work has been provided by Chrome itself.

Chrome has four main process types: 1, the browser process (also known as the host process in the diagram), handles the browser user interface and manages all other processes; 2, Render Preocess, A render process can handle one or more tabs, with an example of a single tab and multiple tabs in the diagram, that is, one or two renderview;3, plugin process;4, and extension process.

Microsoft IE 8 browser

Microsoft uses a similar implementation structure, also known as loosely coupled IE (loosely-coupled ie,lcie). Separating open browsing process from rendering process. The main process includes the browser, UI, and Frame (Windows), which includes tab. Multiple tabs can be processed in the same process, but they must be separated if they have different security levels. Atvicex control is handled by the tab process.

Mozilla

Mozilla's situation, the implementation of ideas basically the same, in the data presented in the early version of the architecture of Firefox 3.6.4 Beta builds, which is mainly a separate browser plugin.

Now Mazilla launched the mobile operating system Firefox os,web operating environment will become the system of all applications of the operating environment, there must be a well-established mechanism of multiple processes.

Reference and Description:

The architecture of the "1" webkit:webbrowser

"2" http://news.softpedia.com/news/Multi-Processes-in-Browsers-Chrome-Internet-Explorer-Firefox-and-WebKit-140535.shtml

"3" Http://trac.webkit.org/wiki/WebKit2

"4" http://hi.baidu.com/ksoftware/blog/item/590b65ee2beb38e1b3fb9559.html

"Note" Above the diagram, with the blue empty frame is I draw, because did not do the code-level research, for my current understanding of the way.


RELATED links: My industrial eco-chain and gossip articles

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.