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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.h

Issue 647613002: Fix RenderWidgetHostViewGuest leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bring back mac delegate() Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 23 matching lines...) Expand all
34 // Eventually all RenderWidgetHostViewGuest code will be subsumed by 34 // Eventually all RenderWidgetHostViewGuest code will be subsumed by
35 // RenderWidgetHostViewChildFrame and this class will be removed. 35 // RenderWidgetHostViewChildFrame and this class will be removed.
36 // 36 //
37 // Some elements that are platform specific will be deal with by delegating 37 // Some elements that are platform specific will be deal with by delegating
38 // the relevant calls to the platform view. 38 // the relevant calls to the platform view.
39 class CONTENT_EXPORT RenderWidgetHostViewGuest 39 class CONTENT_EXPORT RenderWidgetHostViewGuest
40 : public RenderWidgetHostViewChildFrame, 40 : public RenderWidgetHostViewChildFrame,
41 public ui::GestureConsumer, 41 public ui::GestureConsumer,
42 public ui::GestureEventHelper { 42 public ui::GestureEventHelper {
43 public: 43 public:
44 RenderWidgetHostViewGuest(RenderWidgetHost* widget, 44 RenderWidgetHostViewGuest(
45 BrowserPluginGuest* guest, 45 RenderWidgetHost* widget,
46 RenderWidgetHostViewBase* platform_view); 46 BrowserPluginGuest* guest,
47 base::WeakPtr<RenderWidgetHostViewBase> platform_view);
47 virtual ~RenderWidgetHostViewGuest(); 48 virtual ~RenderWidgetHostViewGuest();
48 49
49 bool OnMessageReceivedFromEmbedder(const IPC::Message& message, 50 bool OnMessageReceivedFromEmbedder(const IPC::Message& message,
50 RenderWidgetHostImpl* embedder); 51 RenderWidgetHostImpl* embedder);
51 52
52 // RenderWidgetHostView implementation. 53 // RenderWidgetHostView implementation.
53 virtual bool OnMessageReceived(const IPC::Message& msg) override; 54 virtual bool OnMessageReceived(const IPC::Message& msg) override;
54 virtual void InitAsChild(gfx::NativeView parent_view) override; 55 virtual void InitAsChild(gfx::NativeView parent_view) override;
55 virtual void SetSize(const gfx::Size& size) override; 56 virtual void SetSize(const gfx::Size& size) override;
56 virtual void SetBounds(const gfx::Rect& rect) override; 57 virtual void SetBounds(const gfx::Rect& rect) override;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const gfx::Rect& guest_window_rect, 171 const gfx::Rect& guest_window_rect,
171 const blink::WebInputEvent* event); 172 const blink::WebInputEvent* event);
172 173
173 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied 174 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied
174 // to one another, therefore we access |guest_| through WeakPtr. 175 // to one another, therefore we access |guest_| through WeakPtr.
175 base::WeakPtr<BrowserPluginGuest> guest_; 176 base::WeakPtr<BrowserPluginGuest> guest_;
176 gfx::Size size_; 177 gfx::Size size_;
177 // The platform view for this RenderWidgetHostView. 178 // The platform view for this RenderWidgetHostView.
178 // RenderWidgetHostViewGuest mostly only cares about stuff related to 179 // RenderWidgetHostViewGuest mostly only cares about stuff related to
179 // compositing, the rest are directly forwared to this |platform_view_|. 180 // compositing, the rest are directly forwared to this |platform_view_|.
180 RenderWidgetHostViewBase* platform_view_; 181 base::WeakPtr<RenderWidgetHostViewBase> platform_view_;
181 #if defined(USE_AURA) 182 #if defined(USE_AURA)
182 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; 183 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_;
183 #endif 184 #endif
184 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); 185 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest);
185 }; 186 };
186 187
187 } // namespace content 188 } // namespace content
188 189
189 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ 190 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/interstitial_page_impl.cc ('k') | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698