Hi,

Can the app register its events when it is launched for the first time? (no 
enforced main document loading after the installation)

BR,
Mikhail

________________________________________
From: Crosswalk-dev [[email protected]] on 
behalf of Shao, Changbin [[email protected]]
Sent: Friday, November 22, 2013 8:38 AM
To: [email protected]
Subject: [Crosswalk-dev] Intent to implement : [Runtime Model] System event

Summary:
  A system event is an event sent by the system. This event type does not 
originate from the DOM itself and thus lives outside of the main document's 
lifetime. A system event can wake up a terminated application. For example, 
"OnAlarm" event is one of this kind, it can launch a terminated app's main 
document (AKA event page), when the alarm time is scheduled. Then the main 
document can determine which view to show.

The overall design of Runtime Model event system,
https://docs.google.com/document/d/1cDb54Cs1wjbNQPb7W44_4aj1bzPI9dqsb2aRDkZmDTE/edit#heading=h.v1w5rrn37icm

Spec: http://www.w3.org/2012/sysapps/app-lifecycle/

Affected component: xwalk/application

Related feature in Jira: https://crosswalk-project.org/jira/browse/XWALK-1

Target Release: Crosswalk-4

Target Platform: N/A

Implementation details:

I plan to register system events at application install time. The system events 
information is saved in system database during installation, so that a system 
level service is able to get the system events list for a specified application 
and wake up the application if it is terminated.

There are two options to implement this feature,

1. 'Run main document to register event after complete installation'. This is 
like Chromium extension way. In detail, crosswalk installs application package 
first, after that it loads and executes the main document if the main document 
exists. As a result, render process is able to get events list information of 
main document, then notifies browser process to write these events information 
into database. One of the disadvantage is there may be side effect. For 
example, if main document directly calls 'window.open()', a window will pop up 
during installation.

2. 'Write copy of system events information in manifest file'.  In detail, 
application developer must writes manually into manifest file with the system 
events information of the main document. Therefore, during installation the 
events information will be obtained from the manifest data and then is written 
into database. The disadvantage of this way is developer has to add copy of 
events info in manifest file, this is troublesome for application update, and 
also this method is not able to support add/remove system event dynamically in 
the main document.

I prefer option 1, the side effect could be alleviated by good programming 
style. For instance, developer should use 'onLaunch' event callback in the main 
document to open application window.

Thanks
Changbin
_______________________________________________
Crosswalk-dev mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-dev
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Crosswalk-dev mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-dev

Reply via email to