On 11/27/2013 09:06 PM, Pozdnyakov, Mikhail wrote:
Hi there,

OK, my thoughts are the following:

1)  "Run main document to register event after complete installation"  this practically 
means "Force run application after installation" which is not acceptable IMHO
It's okay I suppose, and Chrome does that, it's not actually "force run application" but "load the main document" and they're different.
2)  Running of main document does not guarantee that all the necessary events 
will be registered, this is up to the application behavior..
There should be some guide for the application developer, and this is acceptable consider what if the application does want the behavior of not registering all the events in the beginning?
3) I found following in the spec:
"Note
To register for system events, need an event handler that is triggered when the application is 
first installed, the application is updated, or the runtime is updated to a new version 
("oninstalled" or similar). Registration through the Manifest would be beneficial 
too. "

So I think sys events data is better be stored in manifest file.

However I would like to appeal to Kenneth, Caio and Alexis as they are runtime 
owners to hear their opinion on it.

BR,
Mikhail

________________________________________
From: Shao, Changbin
Sent: Wednesday, November 27, 2013 7:05 AM
To: Shao, Changbin; Pozdnyakov, Mikhail; 
[email protected]
Subject: RE: [Crosswalk-dev] Intent to implement : [Runtime Model] System event

Hi all,
Is there any other comments about this feature request? I would like to choose 
option 1 to continue my work.

Thanks,
Changbin

-----Original Message-----
From: Crosswalk-dev [mailto:[email protected]
project.org] On Behalf Of Shao, Changbin
Sent: Tuesday, November 26, 2013 1:26 PM
To: Pozdnyakov, Mikhail; [email protected]
Subject: Re: [Crosswalk-dev] Intent to implement : [Runtime Model] System
event

Hi Mikhail,
Thanks for your response and suggestion.
Registering events at first launch time looks a good idea, while my concerns
upon this method include,

1. About 'onLaunched' API. I'm afraid the event manager has to execute
application main document after receiving 'onLaunched' event, no matter
whether application main document contains 'onLaunched' event listener or
not.
In detail, a typical launch procedure of a terminated application is,
- A system level service (eg. Application service from shared mode model)
sends 'onLaunched' event to event manager.
- Event manager gets supported event list of the specified application, checks
whether 'onLaunched' event is in the list. If 'onLaunched' event is in the list,
then event manager runs main document to launch the application,
otherwise the 'onLaunched' event is ignored and nothing happens.
As a result, it is an issue of chicken and egg. We want to register system
events when firstly executing main document. However, the main document
could not be executed because 'onLaunched' system event is not in the event
list yet.

2. We could not implement installation time API such as 'onInstalled'.
  http://developer.chrome.com/extensions/runtime.html#event-onInstalled

Thanks,
Changbin

-----Original Message-----
From: Pozdnyakov, Mikhail
Sent: Monday, November 25, 2013 11:42 PM
To: Shao, Changbin; [email protected]
Subject: RE: Intent to implement : [Runtime Model] System event

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_4aj1bzPI9
dqsb2aRDkZmDTE/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
_______________________________________________
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

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

Reply via email to