Commit 4ff15302 authored by Ryo Hashimoto's avatar Ryo Hashimoto Committed by Commit Bot

ash: Fix CT remote view host ownership

View hierarchy takes the ownership of the remote view host.
Replace unique_ptr with raw pointer to avoid double-free.

BUG=925769
TEST=manually

Change-Id: Ic34a87081782d10e4ad42ecfaa9fb6127abf52cb
Reviewed-on: https://chromium-review.googlesource.com/c/1488403Reviewed-by: default avatarMitsuru Oshima (Slow) <oshima@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635818}
parent 9d5958d2
...@@ -121,7 +121,7 @@ ArcCustomTabView::ArcCustomTabView(int32_t surface_id, int32_t top_margin) ...@@ -121,7 +121,7 @@ ArcCustomTabView::ArcCustomTabView(int32_t surface_id, int32_t top_margin)
surface_id_(surface_id), surface_id_(surface_id),
top_margin_(top_margin), top_margin_(top_margin),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
AddChildView(remote_view_host_.get()); AddChildView(remote_view_host_);
} }
ArcCustomTabView::~ArcCustomTabView() = default; ArcCustomTabView::~ArcCustomTabView() = default;
......
...@@ -44,7 +44,7 @@ class ArcCustomTabView : public views::View, public mojom::ArcCustomTabView { ...@@ -44,7 +44,7 @@ class ArcCustomTabView : public views::View, public mojom::ArcCustomTabView {
void ConvertPointFromWindow(aura::Window* window, gfx::Point* point); void ConvertPointFromWindow(aura::Window* window, gfx::Point* point);
mojo::Binding<mojom::ArcCustomTabView> binding_; mojo::Binding<mojom::ArcCustomTabView> binding_;
std::unique_ptr<ws::ServerRemoteViewHost> remote_view_host_; ws::ServerRemoteViewHost* remote_view_host_;
int32_t surface_id_, top_margin_; int32_t surface_id_, top_margin_;
base::WeakPtrFactory<ArcCustomTabView> weak_ptr_factory_; base::WeakPtrFactory<ArcCustomTabView> weak_ptr_factory_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment