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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 647613002: Fix RenderWidgetHostViewGuest leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add is_guest_view_hack_ check in rwhvmac-delegate call (needs review) 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <IOSurface/IOSurfaceAPI.h> 9 #include <IOSurface/IOSurfaceAPI.h>
10 #include <list> 10 #include <list>
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 class CONTENT_EXPORT RenderWidgetHostViewMac 205 class CONTENT_EXPORT RenderWidgetHostViewMac
206 : public RenderWidgetHostViewBase, 206 : public RenderWidgetHostViewBase,
207 public DelegatedFrameHostClient, 207 public DelegatedFrameHostClient,
208 public BrowserCompositorViewMacClient, 208 public BrowserCompositorViewMacClient,
209 public IPC::Sender, 209 public IPC::Sender,
210 public gfx::DisplayObserver { 210 public gfx::DisplayObserver {
211 public: 211 public:
212 // The view will associate itself with the given widget. The native view must 212 // The view will associate itself with the given widget. The native view must
213 // be hooked up immediately to the view hierarchy, or else when it is 213 // be hooked up immediately to the view hierarchy, or else when it is
214 // deleted it will delete this out from under the caller. 214 // deleted it will delete this out from under the caller.
215 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); 215 //
216 // When |is_guest_view_hack| is true, this view isn't really the view for
217 // the |widget|, a RenderWidgetHostViewGuest is.
218 // TODO(lazyboy): Remove |is_guest_view_hack| once BrowserPlugin has migrated
219 // to use RWHVChildFrame (http://crbug.com/330264).
220 RenderWidgetHostViewMac(RenderWidgetHost* widget, bool is_guest_view_hack);
216 virtual ~RenderWidgetHostViewMac(); 221 virtual ~RenderWidgetHostViewMac();
217 222
218 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } 223 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; }
219 224
220 // |delegate| is used to separate out the logic from the NSResponder delegate. 225 // |delegate| is used to separate out the logic from the NSResponder delegate.
221 // |delegate| is retained by this class. 226 // |delegate| is retained by this class.
222 // |delegate| should be set at most once. 227 // |delegate| should be set at most once.
223 CONTENT_EXPORT void SetDelegate( 228 CONTENT_EXPORT void SetDelegate(
224 NSObject<RenderWidgetHostViewMacDelegate>* delegate); 229 NSObject<RenderWidgetHostViewMacDelegate>* delegate);
225 void SetAllowPauseForResizeOrRepaint(bool allow); 230 void SetAllowPauseForResizeOrRepaint(bool allow);
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 476
472 // Whether it's allowed to pause waiting for a new frame. 477 // Whether it's allowed to pause waiting for a new frame.
473 bool allow_pause_for_resize_or_repaint_; 478 bool allow_pause_for_resize_or_repaint_;
474 479
475 // The last scroll offset of the view. 480 // The last scroll offset of the view.
476 gfx::Vector2dF last_scroll_offset_; 481 gfx::Vector2dF last_scroll_offset_;
477 482
478 // The text to be shown in the tooltip, supplied by the renderer. 483 // The text to be shown in the tooltip, supplied by the renderer.
479 base::string16 tooltip_text_; 484 base::string16 tooltip_text_;
480 485
486 // True when this view acts as a platform view hack for a
487 // RenderWidgetHostViewGuest.
488 bool is_guest_view_hack_;
489
481 // Factory used to safely scope delayed calls to ShutdownHost(). 490 // Factory used to safely scope delayed calls to ShutdownHost().
482 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 491 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
483 492
484 // selected text on the renderer. 493 // selected text on the renderer.
485 std::string selected_text_; 494 std::string selected_text_;
486 495
487 // The window used for popup widgets. 496 // The window used for popup widgets.
488 base::scoped_nsobject<NSWindow> popup_window_; 497 base::scoped_nsobject<NSWindow> popup_window_;
489 498
490 // The fullscreen window used for pepper flash. 499 // The fullscreen window used for pepper flash.
(...skipping 16 matching lines...) Expand all
507 516
508 // The current caret bounds. 517 // The current caret bounds.
509 gfx::Rect caret_rect_; 518 gfx::Rect caret_rect_;
510 519
511 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 520 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
512 }; 521 };
513 522
514 } // namespace content 523 } // namespace content
515 524
516 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 525 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698