Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: views/controls/native/native_view_host.cc

Issue 118025: Fix a memory leak... the wrapped platform helper isn't a view, so it's not au... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/native/native_view_host.h ('k') | views/controls/native/native_view_host_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native/native_view_host.cc
===================================================================
--- views/controls/native/native_view_host.cc (revision 17205)
+++ views/controls/native/native_view_host.cc (working copy)
@@ -19,7 +19,6 @@
NativeViewHost::NativeViewHost()
: native_view_(NULL),
- native_wrapper_(NULL),
fast_resize_(false),
focus_view_(NULL) {
// The native widget is placed relative to the root. As such, we need to
@@ -62,7 +61,7 @@
}
void NativeViewHost::Layout() {
- if (!native_view_ || !native_wrapper_)
+ if (!native_view_ || !native_wrapper_.get())
return;
// Since widgets know nothing about the View hierarchy (they are direct
@@ -75,7 +74,7 @@
gfx::Rect vis_bounds = GetVisibleBounds();
bool visible = !vis_bounds.IsEmpty();
- if (visible && !fast_resize_ && native_wrapper_) {
+ if (visible && !fast_resize_) {
if (vis_bounds.size() != size()) {
// Only a portion of the Widget is really visible.
int x = vis_bounds.x();
@@ -118,8 +117,8 @@
void NativeViewHost::ViewHierarchyChanged(bool is_add, View* parent,
View* child) {
if (is_add && GetWidget()) {
- if (!native_wrapper_)
- native_wrapper_ = NativeViewHostWrapper::CreateWrapper(this);
+ if (!native_wrapper_.get())
+ native_wrapper_.reset(NativeViewHostWrapper::CreateWrapper(this));
native_wrapper_->AddedToWidget();
} else if (!is_add) {
native_wrapper_->RemovedFromWidget();
« no previous file with comments | « views/controls/native/native_view_host.h ('k') | views/controls/native/native_view_host_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698