crosswalk-project/tizen-extensions-crosswalk — pull request #155 by qjia7 (2013-09-19 04:57:18+00:00)
Title: [SystemInfo] Use singleton model to support multi frames

The old design is one frame one set of listening mechanism. So when there are multi-frames, there will be multiple sets of events. However, the vconf only support to register the first one when asking twice for the same vconf_notify_key_changed with same Key and vconf_callback_fn and the others will be ignored. So, the old framework couldn't resolve the vconf issue.

The current design uses singleton event listening mechanism. Every property object (such as: cpu, local, storage ...) is singleton. Each of them will maintain an according events list. Use StartListening(Context* api) to push back the current context to the according list. Use StopListening(Context* api) to remove the current context from the list. When the property value changed, iterate the list to post message to all the listenng context.