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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2728683007: Fix crash when de-referencing the WebFrameWidget. (Closed)
Patch Set: add comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 8a38208b82174a374b576187f2450ca2c8b40ac8..b982e288a6868b086d9008056ceccb60efb000e7 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -2538,15 +2538,23 @@ void WebViewImpl::willCloseLayerTreeView() {
}
void WebViewImpl::didAcquirePointerLock() {
- mainFrameImpl()->frameWidget()->didAcquirePointerLock();
+ if (mainFrameImpl())
+ mainFrameImpl()->frameWidget()->didAcquirePointerLock();
}
void WebViewImpl::didNotAcquirePointerLock() {
- mainFrameImpl()->frameWidget()->didNotAcquirePointerLock();
+ if (mainFrameImpl())
+ mainFrameImpl()->frameWidget()->didNotAcquirePointerLock();
}
void WebViewImpl::didLosePointerLock() {
- mainFrameImpl()->frameWidget()->didLosePointerLock();
+ // Make sure that the main frame wasn't swapped-out when the pointer lock is
+ // lost. There's a race that can happen when a pointer lock is requested, but
+ // the browser swaps out the main frame while the pointer lock request is in
+ // progress. This won't be needed once the main frame is refactored to not use
+ // the WebViewImpl as its WebWidget.
+ if (mainFrameImpl())
+ mainFrameImpl()->frameWidget()->didLosePointerLock();
}
// TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
« 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