summaryrefslogtreecommitdiffstats
path: root/content/browser/web_contents/web_contents_view_guest.h
diff options
context:
space:
mode:
authorlazyboy <lazyboy@chromium.org>2014-10-20 10:16:04 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-20 17:16:43 +0000
commit549b3b4f0cf5691d093823f285ffd437614af1f6 (patch)
treedf95982227c5aac7f101d7d9e187e4f811ef2768 /content/browser/web_contents/web_contents_view_guest.h
parentadb045fd004834946c39bc11c24399ac4ebbac7c (diff)
downloadchromium_src-549b3b4f0cf5691d093823f285ffd437614af1f6.zip
chromium_src-549b3b4f0cf5691d093823f285ffd437614af1f6.tar.gz
chromium_src-549b3b4f0cf5691d093823f285ffd437614af1f6.tar.bz2
Fix 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 Review URL: https://codereview.chromium.org/647613002 Cr-Commit-Position: refs/heads/master@{#300286}
Diffstat (limited to 'content/browser/web_contents/web_contents_view_guest.h')
-rw-r--r--content/browser/web_contents/web_contents_view_guest.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/browser/web_contents/web_contents_view_guest.h b/content/browser/web_contents/web_contents_view_guest.h
index ae72f5b..dfb76e7 100644
--- a/content/browser/web_contents/web_contents_view_guest.h
+++ b/content/browser/web_contents/web_contents_view_guest.h
@@ -59,7 +59,7 @@ class WebContentsViewGuest : public WebContentsView,
virtual void CreateView(const gfx::Size& initial_size,
gfx::NativeView context) override;
virtual RenderWidgetHostViewBase* CreateViewForWidget(
- RenderWidgetHost* render_widget_host) override;
+ RenderWidgetHost* render_widget_host, bool is_guest_view_hack) override;
virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
RenderWidgetHost* render_widget_host) override;
virtual void SetPageTitle(const base::string16& title) override;