On Tue, Apr 29, 2014 at 12:58 AM, Alive <al...@mozilla.com> wrote: > Jonas, > > Thanks for clarifying, I'd filed > https://bugzilla.mozilla.org/show_bug.cgi?id=1003024 to do setVisible as > early as we could. > For a normal launched app (webapps-launch) we should do setVisible(true) > right away after the iframe in the DOM tree, > for system message launched app (open-app with stayBackground=true) we > should do setVisible(false) right away after the iframe in the DOM tree.
Is there any way we could do setVisible(true/false) *before* adding the iframe to the DOM tree? I guess that's not possible since the iframe doesn't get a setVisible function until after the iframe has been added to the DOM tree? We really need to rewrite the browser API in C++ so that it > Let me know if this is insufficient. You need to ask someone that knows the details of the Browser API implementation better than I do. The question we really need answered is "how early do we need to set the visibility to ensure that the process gets a high priority as soon as possible after forking". When we fork() a new process from the nuwa process, does it inherit the OOM priority from the nuwa process? What OOM priority does the nuwa process have? Ideally we would give forked process a very high priority until we can check if setVisible was called with true or false. / Jonas > -Alive > > Jonas Sicking <jo...@sicking.cc> 於 2014/4/29 上午6:01 寫道: > > On Mon, Apr 28, 2014 at 4:04 AM, Alive <al...@mozilla.com> wrote: > > Hi, > > I am not sure how does this matter if setVisible is too late or too early > while an app is launching. > The fact is while we launch an app, the previous app is still foreground > after it's going out of viewport && the foreground app is loaded. > > > Whenever we're about to launch a *visible* app to the user, we should > set that app as visible right away. In fact it should ideally get an > even higher priority than the currently visible app. > > If a user launches another app, then our first priority should be to > launch that app. Even if that means killing the currently running app. > > Generally using the App API to launch an app should count as launching > a visible app. > > With system messages things are a bit more complex. Messages for > WebActivities or telephony should obviously count as launching a > visible app to the user. However messages for the Alarm API should > count as launching a hidden app. > > > For the question here couldn't we just set docShell.isActive = true by > default? > > > Setting docShell.isActive probably won't affect the process priority > at all. So I don't think that will make a difference. > > / Jonas > > What will happen if the setVisible call is too late and what state if no one > calls setVisible on the iframe? Neither foreground nor background? > > -Alive > > Gabriele Svelto <gsve...@mozilla.com> 於 2014/4/26 下午3:15 寫道: > > On 26/04/2014 01:48, Jonas Sicking wrote: > > That only works once an app is far enough along in the launch process > that it's able to run javascript. We need to give apps a high priority > before then. > > Is gaia currently setting the "visibility flag" on <iframes> of > launching apps right away? If not, we should make that happen. > > > We should but I still wanted to measure how long it takes for the whole > process to happen. I just haven't got enough time to do it yet (still > too busy fixing v1.3t bugs). > > Gabriele > > _______________________________________________ > dev-b2g mailing list > dev-b2g@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-b2g > > > -- > Alive C. Kuo, Senior Front-end/Software Engineer, FirefoxOS, MoCo. Taiwan, > Taipei office. > al...@mozilla.com > > > > > > > -- > Alive C. Kuo, Senior Front-end/Software Engineer, FirefoxOS, MoCo. Taiwan, > Taipei office. > al...@mozilla.com > > > > > _______________________________________________ dev-b2g mailing list dev-b2g@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-b2g