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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 8418026: Fix possible memory leak due to tooltip property in aura::Window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/renderer_host/backing_store_skia.h" 8 #include "content/browser/renderer_host/backing_store_skia.h"
9 #include "content/browser/renderer_host/web_input_event_aura.h" 9 #include "content/browser/renderer_host/web_input_event_aura.h"
10 #include "content/browser/renderer_host/render_widget_host.h" 10 #include "content/browser/renderer_host/render_widget_host.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } // namespace 73 } // namespace
74 74
75 //////////////////////////////////////////////////////////////////////////////// 75 ////////////////////////////////////////////////////////////////////////////////
76 // RenderWidgetHostViewAura, public: 76 // RenderWidgetHostViewAura, public:
77 77
78 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) 78 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
79 : host_(host), 79 : host_(host),
80 ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))), 80 ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))),
81 is_loading_(false) { 81 is_loading_(false) {
82 host_->SetView(this); 82 host_->SetView(this);
83 window_->SetProperty(aura::kTooltipTextKey, &tooltip_);
83 } 84 }
84 85
85 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { 86 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
86 } 87 }
87 88
88 void RenderWidgetHostViewAura::Init() { 89 void RenderWidgetHostViewAura::Init() {
89 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); 90 window_->Init(ui::Layer::LAYER_HAS_TEXTURE);
90 } 91 }
91 92
92 //////////////////////////////////////////////////////////////////////////////// 93 ////////////////////////////////////////////////////////////////////////////////
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 int error_code) { 214 int error_code) {
214 UpdateCursorIfOverSelf(); 215 UpdateCursorIfOverSelf();
215 Destroy(); 216 Destroy();
216 } 217 }
217 218
218 void RenderWidgetHostViewAura::Destroy() { 219 void RenderWidgetHostViewAura::Destroy() {
219 delete window_; 220 delete window_;
220 } 221 }
221 222
222 void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) { 223 void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) {
223 string16* tooltip = new string16(tooltip_text); 224 tooltip_ = tooltip_text;
224 window_->SetProperty(aura::kTooltipTextKey, tooltip);
225 } 225 }
226 226
227 BackingStore* RenderWidgetHostViewAura::AllocBackingStore( 227 BackingStore* RenderWidgetHostViewAura::AllocBackingStore(
228 const gfx::Size& size) { 228 const gfx::Size& size) {
229 return new BackingStoreSkia(host_, size); 229 return new BackingStoreSkia(host_, size);
230 } 230 }
231 231
232 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) 232 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
233 void RenderWidgetHostViewAura::AcceleratedSurfaceNew( 233 void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
234 int32 width, 234 int32 width,
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 468 }
469 #endif 469 #endif
470 470
471 //////////////////////////////////////////////////////////////////////////////// 471 ////////////////////////////////////////////////////////////////////////////////
472 // RenderWidgetHostViewAura, private: 472 // RenderWidgetHostViewAura, private:
473 473
474 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { 474 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() {
475 //NOTIMPLEMENTED(); 475 //NOTIMPLEMENTED();
476 // TODO(beng): See RenderWidgetHostViewWin. 476 // TODO(beng): See RenderWidgetHostViewWin.
477 } 477 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698