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

Side by Side Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 910013003: Mac: Fix crash due to occluding view during tear-down (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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 #import <Carbon/Carbon.h> 5 #import <Carbon/Carbon.h>
6 6
7 #import "content/browser/web_contents/web_contents_view_mac.h" 7 #import "content/browser/web_contents/web_contents_view_mac.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 name:NSWindowDidChangeOcclusionStateNotification 620 name:NSWindowDidChangeOcclusionStateNotification
621 object:newWindow]; 621 object:newWindow];
622 } 622 }
623 } 623 }
624 } 624 }
625 625
626 - (void)windowChangedOcclusionState:(NSNotification*)notification { 626 - (void)windowChangedOcclusionState:(NSNotification*)notification {
627 DCHECK(base::mac::IsOSMavericksOrLater()); 627 DCHECK(base::mac::IsOSMavericksOrLater());
628 NSWindow* window = [notification object]; 628 NSWindow* window = [notification object];
629 WebContentsImpl* webContents = [self webContents]; 629 WebContentsImpl* webContents = [self webContents];
630 if (window && webContents) { 630 if (window && webContents && !webContents->IsBeingDestroyed()) {
631 if ([window occlusionState] & NSWindowOcclusionStateVisible) { 631 if ([window occlusionState] & NSWindowOcclusionStateVisible) {
632 webContents->WasUnOccluded(); 632 webContents->WasUnOccluded();
633 } else { 633 } else {
634 webContents->WasOccluded(); 634 webContents->WasOccluded();
635 } 635 }
636 } 636 }
637 } 637 }
638 638
639 @end 639 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698