|
|
Chromium Code Reviews|
Created:
4 years, 2 months ago by Shouqun1 Modified:
3 years, 8 months ago Reviewers:
Tobias Sargeant CC:
chromium-reviews, android-webview-reviews_chromium.org, agrieve+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[Android WebView] Call AwGLFunctor.onDetachedFromWindow with correct order.
HardwareRenderer should destoryed before BrowserViewRenderer's onDetachedFromWindow,
which makes sure resources returned by parent compositor are released immediately after detach.
BUG=655434
TEST=
Patch Set 1 : [Android WebView] Call AwGLFunctor.onDetachedFromWindow with correct order. #
Messages
Total messages: 12 (6 generated)
Description was changed from ========== [Android WebView] Call AwGLFunctor.onDetachedFromWindow with correct order. HardwareRenderer should destoryed before BrowserViewRenderer's onDetachedFromWindow, which makes sure BVR can get the resources returned by parent compositor. BUG=655434 TEST= ========== to ========== [Android WebView] Call AwGLFunctor.onDetachedFromWindow with correct order. HardwareRenderer should destoryed before BrowserViewRenderer's onDetachedFromWindow, which makes sure resources returned by parent compositor are released immediately after detach. BUG=655434 TEST= ==========
Description was changed from ========== [Android WebView] Call AwGLFunctor.onDetachedFromWindow with correct order. HardwareRenderer should destoryed before BrowserViewRenderer's onDetachedFromWindow, which makes sure resources returned by parent compositor are released immediately after detach. BUG=655434 TEST= ========== to ========== [Android WebView] Call AwGLFunctor.onDetachedFromWindow with correct order. HardwareRenderer should destoryed before BrowserViewRenderer's onDetachedFromWindow, which makes sure resources returned by parent compositor are released immediately after detach. BUG=655434 TEST= ==========
Patchset #1 (id:1) has been deleted
liushouqun@xiaomi.com changed reviewers: + boliu@chromium.org
PTAL
boliu@chromium.org changed reviewers: + tobiasjs@chromium.org
I'm gonna let toby take this one. Without out this, it just means we are holding onto one frame of resources even after detached. Isn't the end of the world, as long as that those resources are eventually get returned.
boliu@chromium.org changed reviewers: - boliu@chromium.org
On 2016/10/14 17:30:42, boliu wrote: > I'm gonna let toby take this one. > > Without out this, it just means we are holding onto one frame of resources even > after detached. Isn't the end of the world, as long as that those resources are > eventually get returned. Yes, but since the WebView is detached, the next frame of BVR (accordingly BVR.ReturnResourceFromParent) will be processed util next attach. If AwGLFunctor.onDetachedFromWindow is called after BVR.OnDetachedFromWindow, the resources will be hold util next WebView attach or destroy, since BVR can't get a chance to execute ReturnResourceFromParent until next attach. For applications with the following logic: (create WebView -> detach WebView -> <do sth for a while> -> attach WebView again), the resources will be hold during <do sth> stage, in which case, the memory footprint is increased accordingly. IMO, the ideal case is that when the WebView is in detached state, the resources are recycled.
On 2016/10/17 03:06:18, Shouqun1 wrote: > On 2016/10/14 17:30:42, boliu wrote: > > I'm gonna let toby take this one. > > > > Without out this, it just means we are holding onto one frame of resources > even > > after detached. Isn't the end of the world, as long as that those resources > are > > eventually get returned. > > Yes, but since the WebView is detached, the next frame of BVR (accordingly > BVR.ReturnResourceFromParent) will be processed util next attach. > > If AwGLFunctor.onDetachedFromWindow is called after BVR.OnDetachedFromWindow, > the resources will be hold util next WebView attach or destroy, since BVR can't > get a chance to execute ReturnResourceFromParent until next attach. > > For applications with the following logic: (create WebView -> detach WebView -> > <do sth for a while> -> attach WebView again), the resources will be hold during > <do sth> stage, in which case, the memory footprint is increased accordingly. > > IMO, the ideal case is that when the WebView is in detached state, the resources > are recycled. All true. I'm just saying this issue is not that severe, since memory won't grow unboundedly. An alternative solution is to always directly return resources, and never hold returned resources in RenderThreadManager. Anyway I'll let toby decide where this one goes.
On 2016/10/18 04:08:40, boliu wrote: > On 2016/10/17 03:06:18, Shouqun1 wrote: > > On 2016/10/14 17:30:42, boliu wrote: > > > I'm gonna let toby take this one. > > > > > > Without out this, it just means we are holding onto one frame of resources > > even > > > after detached. Isn't the end of the world, as long as that those resources > > are > > > eventually get returned. > > > > Yes, but since the WebView is detached, the next frame of BVR (accordingly > > BVR.ReturnResourceFromParent) will be processed util next attach. > > > > If AwGLFunctor.onDetachedFromWindow is called after BVR.OnDetachedFromWindow, > > the resources will be hold util next WebView attach or destroy, since BVR > can't > > get a chance to execute ReturnResourceFromParent until next attach. > > > > For applications with the following logic: (create WebView -> detach WebView > -> > > <do sth for a while> -> attach WebView again), the resources will be hold > during > > <do sth> stage, in which case, the memory footprint is increased accordingly. > > > > > IMO, the ideal case is that when the WebView is in detached state, the > resources > > are recycled. > > All true. I'm just saying this issue is not that severe, since memory won't grow > unboundedly. An alternative solution is to always directly return resources, and > never hold returned resources in RenderThreadManager. Anyway I'll let toby > decide where this one goes. The only concern I can see with changing the order is that if we detach the WebView and return child_frame_ before any frame is drawn, then it seems that DeleteHardwareRendererOnUI will have the wrong value for hardware_initialized (HasFrameOnUI will return false, even though the functor is attached).
On 2016/10/19 18:47:29, Tobias Sargeant wrote: > On 2016/10/18 04:08:40, boliu wrote: > > On 2016/10/17 03:06:18, Shouqun1 wrote: > > > On 2016/10/14 17:30:42, boliu wrote: > > > > I'm gonna let toby take this one. > > > > > > > > Without out this, it just means we are holding onto one frame of resources > > > even > > > > after detached. Isn't the end of the world, as long as that those > resources > > > are > > > > eventually get returned. > > > > > > Yes, but since the WebView is detached, the next frame of BVR (accordingly > > > BVR.ReturnResourceFromParent) will be processed util next attach. > > > > > > If AwGLFunctor.onDetachedFromWindow is called after > BVR.OnDetachedFromWindow, > > > the resources will be hold util next WebView attach or destroy, since BVR > > can't > > > get a chance to execute ReturnResourceFromParent until next attach. > > > > > > For applications with the following logic: (create WebView -> detach WebView > > -> > > > <do sth for a while> -> attach WebView again), the resources will be hold > > during > > > <do sth> stage, in which case, the memory footprint is increased > accordingly. > > > > > > > > IMO, the ideal case is that when the WebView is in detached state, the > > resources > > > are recycled. > > > > All true. I'm just saying this issue is not that severe, since memory won't > grow > > unboundedly. An alternative solution is to always directly return resources, > and > > never hold returned resources in RenderThreadManager. Anyway I'll let toby > > decide where this one goes. > > The only concern I can see with changing the order is that if we detach the > WebView and return child_frame_ before any frame is drawn, then it seems that > DeleteHardwareRendererOnUI will have the wrong value for hardware_initialized > (HasFrameOnUI will return false, even though the functor is attached). please work with shouqun to resolve that then |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
