Chromium Code Reviews| Index: content/browser/web_contents/web_drag_dest_mac.mm |
| diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm |
| index 625df3f1ecf6d60aa7f1306ead3da079e8f30172..cebb19445404a13486fb36f1bf45e00e26e15b47 100644 |
| --- a/content/browser/web_contents/web_drag_dest_mac.mm |
| +++ b/content/browser/web_contents/web_drag_dest_mac.mm |
| @@ -134,6 +134,12 @@ int GetModifierFlags() { |
| NSPoint viewPoint = [self flipWindowPointToView:windowPoint view:view]; |
| NSPoint screenPoint = [self flipWindowPointToScreen:windowPoint view:view]; |
| gfx::Point transformedPt; |
| + if (!webContents_->GetRenderWidgetHostView()) { |
| + // This could happen when the renderer process for the top-level RWH crashes |
| + // (see https://cebug.com/670645). |
|
Avi (use Gerrit)
2016/12/02 23:07:24
typo in the link
EhsanK
2016/12/02 23:09:51
Done.
|
| + canceled_ = true; |
| + return NSDragOperationNone; |
| + } |
| currentRWHForDrag_ = |
| [self GetRenderWidgetHostAtPoint:viewPoint transformedPt:&transformedPt] |
| ->GetWeakPtr(); |
| @@ -203,6 +209,8 @@ int GetModifierFlags() { |
| - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)info |
| view:(NSView*)view { |
| + if (canceled_) |
| + return NSDragOperationNone; |
| // Create the appropriate mouse locations for WebCore. The draggingLocation |
| // is in window coordinates. Both need to be flipped. |
| NSPoint windowPoint = [info draggingLocation]; |