crosswalk-project/crosswalk — pull request #926 by shaochangbin (2013-10-21 08:13:37+00:00)
Title: None persistent main document

The following CL is to implement https://crosswalk-project.org/jira/browse/XWALK-2.

This CL mainly introduces two IPC communication pairs to support none persistent main document, 'ShouldSuspend'/'ShouldSuspendAck' as well as 'Suspend'/'SuspendAck'.

The first pair of message is to make sure main document is idle before unloading. If we find the main document is not
idle between the first pair of IPC communication, the second IPC pair will be canceled, that is to say, the main document won't enter suspending(closing) state. The second IPC pair will give render process a chance to do simple clean up task before main document is finally closed.

The CL makes ApplicationProcessManager as an Observer for Runtime objects. Therefore, whenever a Runtime object is added or removed, the ApplicationProcessManager could be notified.

It also add the command line option to set main document idle time and suspending time, which gives user oppotunity to change and may also help testing.