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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetBase.cpp

Issue 2844243003: Speculative fix for crash in blink::DragData::modifiers. (Closed)
Patch Set: Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "web/WebFrameWidgetBase.h" 5 #include "web/WebFrameWidgetBase.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/VisualViewport.h" 9 #include "core/frame/VisualViewport.h"
10 #include "core/input/EventHandler.h" 10 #include "core/input/EventHandler.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 operations_allowed_ = operations_allowed; 73 operations_allowed_ = operations_allowed;
74 74
75 return DragTargetDragEnterOrOver(point_in_viewport, screen_point, kDragOver, 75 return DragTargetDragEnterOrOver(point_in_viewport, screen_point, kDragOver,
76 modifiers); 76 modifiers);
77 } 77 }
78 78
79 void WebFrameWidgetBase::DragTargetDragLeave(const WebPoint& point_in_viewport, 79 void WebFrameWidgetBase::DragTargetDragLeave(const WebPoint& point_in_viewport,
80 const WebPoint& screen_point) { 80 const WebPoint& screen_point) {
81 DCHECK(current_drag_data_); 81 DCHECK(current_drag_data_);
82 82
83 if (IgnoreInputEvents()) { 83 // TODO(paulmeyer): It shouldn't be possible for |m_currentDragData| to be
84 // null here, but this is somehow happening (rarely). This suggests that in
85 // some cases drag-leave is happening before drag-enter, which should be
86 // impossible. This needs to be investigated further. Once fixed, the extra
87 // check for |!m_currentDragData| should be removed. (crbug.com/671152)
88 if (IgnoreInputEvents() || !current_drag_data_) {
84 CancelDrag(); 89 CancelDrag();
85 return; 90 return;
86 } 91 }
87 92
88 WebPoint point_in_root_frame(ViewportToRootFrame(point_in_viewport)); 93 WebPoint point_in_root_frame(ViewportToRootFrame(point_in_viewport));
89 DragData drag_data(current_drag_data_.Get(), point_in_root_frame, 94 DragData drag_data(current_drag_data_.Get(), point_in_root_frame,
90 screen_point, 95 screen_point,
91 static_cast<DragOperation>(operations_allowed_)); 96 static_cast<DragOperation>(operations_allowed_));
92 97
93 GetPage()->GetDragController().DragExited(&drag_data, 98 GetPage()->GetDragController().DragExited(&drag_data,
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 280
276 if (GetPage()) { 281 if (GetPage()) {
277 WebMouseEvent transformed_event = TransformWebMouseEvent( 282 WebMouseEvent transformed_event = TransformWebMouseEvent(
278 ToWebLocalFrameImpl(LocalRoot())->GetFrameView(), mouse_event); 283 ToWebLocalFrameImpl(LocalRoot())->GetFrameView(), mouse_event);
279 GetPage()->GetPointerLockController().DispatchLockedMouseEvent( 284 GetPage()->GetPointerLockController().DispatchLockedMouseEvent(
280 transformed_event, event_type); 285 transformed_event, event_type);
281 } 286 }
282 } 287 }
283 288
284 } // namespace blink 289 } // namespace blink
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