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

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

Issue 647613002: Fix RenderWidgetHostViewGuest leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 #include <QuartzCore/QuartzCore.h> 9 #include <QuartzCore/QuartzCore.h>
10 10
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 cocoa_view_ = nil; 563 cocoa_view_ = nil;
564 564
565 UnlockMouse(); 565 UnlockMouse();
566 566
567 // Ensure that the browser compositor is destroyed in a safe order. 567 // Ensure that the browser compositor is destroyed in a safe order.
568 ShutdownBrowserCompositor(); 568 ShutdownBrowserCompositor();
569 569
570 // We are owned by RenderWidgetHostViewCocoa, so if we go away before the 570 // We are owned by RenderWidgetHostViewCocoa, so if we go away before the
571 // RenderWidgetHost does we need to tell it not to hold a stale pointer to 571 // RenderWidgetHost does we need to tell it not to hold a stale pointer to
572 // us. 572 // us.
573 if (render_widget_host_) 573 if (render_widget_host_) {
574 render_widget_host_->SetView(NULL); 574 if (render_widget_host_->GetView() == this)
575 render_widget_host_->SetView(NULL);
lazyboy 2014/10/10 01:22:58 It might be consistent to call render_widget_host_
576 }
575 } 577 }
576 578
577 void RenderWidgetHostViewMac::SetDelegate( 579 void RenderWidgetHostViewMac::SetDelegate(
578 NSObject<RenderWidgetHostViewMacDelegate>* delegate) { 580 NSObject<RenderWidgetHostViewMacDelegate>* delegate) {
579 [cocoa_view_ setResponderDelegate:delegate]; 581 [cocoa_view_ setResponderDelegate:delegate];
580 } 582 }
581 583
582 void RenderWidgetHostViewMac::SetAllowPauseForResizeOrRepaint(bool allow) { 584 void RenderWidgetHostViewMac::SetAllowPauseForResizeOrRepaint(bool allow) {
583 allow_pause_for_resize_or_repaint_ = allow; 585 allow_pause_for_resize_or_repaint_ = allow;
584 } 586 }
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after
3317 3319
3318 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3320 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3319 // regions that are not draggable. (See ControlRegionView in 3321 // regions that are not draggable. (See ControlRegionView in
3320 // native_app_window_cocoa.mm). This requires the render host view to be 3322 // native_app_window_cocoa.mm). This requires the render host view to be
3321 // draggable by default. 3323 // draggable by default.
3322 - (BOOL)mouseDownCanMoveWindow { 3324 - (BOOL)mouseDownCanMoveWindow {
3323 return YES; 3325 return YES;
3324 } 3326 }
3325 3327
3326 @end 3328 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/browser/web_contents/web_contents_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698