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

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

Issue 538883002: Speculative fix for DelegatedFrameHost destructor crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Absolutely minimal fix Created 6 years, 3 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.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) 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 [cocoa_view_ setMarkedRange:range.ToNSRange()]; 972 [cocoa_view_ setMarkedRange:range.ToNSRange()];
973 composition_range_ = range; 973 composition_range_ = range;
974 composition_bounds_ = character_bounds; 974 composition_bounds_ = character_bounds;
975 } 975 }
976 976
977 void RenderWidgetHostViewMac::RenderProcessGone(base::TerminationStatus status, 977 void RenderWidgetHostViewMac::RenderProcessGone(base::TerminationStatus status,
978 int error_code) { 978 int error_code) {
979 Destroy(); 979 Destroy();
980 } 980 }
981 981
982 void RenderWidgetHostViewMac::RenderWidgetHostGone() {
983 // Destroy the DelegatedFrameHost, to prevent crashes when Destroy is never
984 // called on the view.
985 // http://crbug.com/404828
986 ShutdownBrowserCompositor();
987 }
988
982 void RenderWidgetHostViewMac::Destroy() { 989 void RenderWidgetHostViewMac::Destroy() {
983 [[NSNotificationCenter defaultCenter] 990 [[NSNotificationCenter defaultCenter]
984 removeObserver:cocoa_view_ 991 removeObserver:cocoa_view_
985 name:NSWindowWillCloseNotification 992 name:NSWindowWillCloseNotification
986 object:popup_window_]; 993 object:popup_window_];
987 994
988 // We've been told to destroy. 995 // We've been told to destroy.
989 [cocoa_view_ retain]; 996 [cocoa_view_ retain];
990 [cocoa_view_ removeFromSuperview]; 997 [cocoa_view_ removeFromSuperview];
991 [cocoa_view_ autorelease]; 998 [cocoa_view_ autorelease];
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
3337 3344
3338 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3345 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3339 // regions that are not draggable. (See ControlRegionView in 3346 // regions that are not draggable. (See ControlRegionView in
3340 // native_app_window_cocoa.mm). This requires the render host view to be 3347 // native_app_window_cocoa.mm). This requires the render host view to be
3341 // draggable by default. 3348 // draggable by default.
3342 - (BOOL)mouseDownCanMoveWindow { 3349 - (BOOL)mouseDownCanMoveWindow {
3343 return YES; 3350 return YES;
3344 } 3351 }
3345 3352
3346 @end 3353 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698