appid based resource and stream synching (needed by xwalk)

Change-Id: I38da04ef45347e262394c023b9e665b704219bcf
fix high risk coverity warnings

Change-Id: I47d29c937029e13c4b2b02dbd6a98325550bac90
unfinished work for multi resource multi stream mapping

Change-Id: I4c85f96c91c381d41306f7f9fcec1807e7d44dc0