Commit ba833c2b authored by tbarzic@chromium.org's avatar tbarzic@chromium.org

Make html_contents_ in BallonViewImpl scoped_ptr.

Initially, this object was owned by views hierarchy, but this is not the case since
http://src.chromium.org/viewvc/chrome?view=rev&revision=42404.

The leak didn't manifest itself until http://src.chromium.org/viewvc/chrome?view=rev&revision=110041

TEST=none
BUG=104029


Review URL: http://codereview.chromium.org/8585011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110460 0039d316-1c4b-4281-b951-d872f2087c98
parent b4574c02
...@@ -214,7 +214,7 @@ BalloonViewImpl::~BalloonViewImpl() { ...@@ -214,7 +214,7 @@ BalloonViewImpl::~BalloonViewImpl() {
if (control_view_host_.get()) { if (control_view_host_.get()) {
control_view_host_->CloseNow(); control_view_host_->CloseNow();
} }
if (html_contents_) { if (html_contents_.get()) {
html_contents_->Shutdown(); html_contents_->Shutdown();
} }
} }
...@@ -224,7 +224,7 @@ BalloonViewImpl::~BalloonViewImpl() { ...@@ -224,7 +224,7 @@ BalloonViewImpl::~BalloonViewImpl() {
void BalloonViewImpl::Show(Balloon* balloon) { void BalloonViewImpl::Show(Balloon* balloon) {
balloon_ = balloon; balloon_ = balloon;
html_contents_ = new BalloonViewHost(balloon); html_contents_.reset(new BalloonViewHost(balloon));
if (web_ui_) if (web_ui_)
html_contents_->EnableWebUI(); html_contents_->EnableWebUI();
AddChildView(html_contents_->view()); AddChildView(html_contents_->view());
...@@ -255,7 +255,7 @@ gfx::Size BalloonViewImpl::GetSize() const { ...@@ -255,7 +255,7 @@ gfx::Size BalloonViewImpl::GetSize() const {
} }
BalloonHost* BalloonViewImpl::GetHost() const { BalloonHost* BalloonViewImpl::GetHost() const {
return html_contents_; return html_contents_.get();
} }
void BalloonViewImpl::RepositionToBalloon() { void BalloonViewImpl::RepositionToBalloon() {
...@@ -352,7 +352,7 @@ void BalloonViewImpl::Deactivated() { ...@@ -352,7 +352,7 @@ void BalloonViewImpl::Deactivated() {
void BalloonViewImpl::DelayedClose(bool by_user) { void BalloonViewImpl::DelayedClose(bool by_user) {
html_contents_->Shutdown(); html_contents_->Shutdown();
html_contents_ = NULL; html_contents_.reset();
balloon_->OnClose(by_user); balloon_->OnClose(by_user);
} }
......
...@@ -99,8 +99,8 @@ class BalloonViewImpl : public BalloonView, ...@@ -99,8 +99,8 @@ class BalloonViewImpl : public BalloonView,
// Non-owned pointer to the balloon which owns this object. // Non-owned pointer to the balloon which owns this object.
Balloon* balloon_; Balloon* balloon_;
// The renderer of the HTML contents. Pointer owned by the views hierarchy. // The renderer of the HTML contents.
BalloonViewHost* html_contents_; scoped_ptr<BalloonViewHost> html_contents_;
// A widget for ControlView. // A widget for ControlView.
scoped_ptr<views::Widget> control_view_host_; scoped_ptr<views::Widget> control_view_host_;
......
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