DescriptionFix RenderWidgetHostViewGuest leak.
This used to happen on view initiated destruction, as opposed to
RenderWidgetHostImpl initiated ones. In RWH initiated destruction,
the views gets deleted properly.
"View initiated destruction" means the view is first deleted before
the host, this is aura's RWHViewAura::OnWindowDestroyed() or mac's
~RenderWidgetHostViewMac().
In view(V1) initiated destruction, RWH::SetView(NULL) call makes
the host(H) drop the pointer to the view(V2) it's holding, in cases
where the view initiated the destruction is not the view of
the host(V1!=V2), it will leak V2.
This scenario happens when there's an interstitial page showing
inside <webview> guest. The platform RWHView gets deleted but
the RWHViewGuest leaks as the RWH's view pointer is cleared while
clearing the platform view.
BUG=321662
Test=No visible change, internal change.
To check leak sanitizer test, my steps are:
gyp:
CC=clang CXX=clang++ builddir_name=./tmp-llvm GYP_PARALLEL=1 \
PATH=$PWD/third_party/llvm-build/Release+Asserts/bin:$PATH \
GYP_GENERATORS='ninja' ./build/gyp_chromium -Gconfig=Release \
-Goutput_dir=out_asan_new -D"asan=1" -D"clang=1" \
-D"component=static_library" -D"lsan=1" -D"target_arch=x64" \
-D"use_allocator=none"
build:
PATH=$PWD/third_party/llvm-build/Release+Asserts/bin:$PATH \
ninja -C out_asan_new/Release -j 2048 browser_tests
run:
ASAN_OPTIONS="detect_leaks=1" \
LSAN_OPTIONS="suppressions=./tools/lsan/suppressions.txt" \
./out_asan_new/Release/browser_tests \
--gtest_filter=WebViewTest.InterstitialTeardown \
--disable-seccomp-sandbox
Committed: https://crrev.com/549b3b4f0cf5691d093823f285ffd437614af1f6
Cr-Commit-Position: refs/heads/master@{#300286}
Patch Set 1 #Patch Set 2 : clean up for review #Patch Set 3 : . #
Total comments: 1
Patch Set 4 : Add content_unittests #
Total comments: 2
Patch Set 5 : add comment for GetView() == this #Patch Set 6 : add is_guest_view_hack_ to RWHV #
Total comments: 6
Patch Set 7 : remove is_guest_view_hack from CreateViewForPopupWidet #Patch Set 8 : fix mac #Patch Set 9 : fix aura test #Patch Set 10 : add is_guest_view_hack_ check in rwhvmac-delegate call (needs review) #
Total comments: 3
Patch Set 11 : bring back mac delegate() #Messages
Total messages: 25 (3 generated)
|