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

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

Issue 1622633003: [DevTools] Check that mainFrameImpl() has been initalized before accessing it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/DevToolsEmulator.cpp
diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.cpp b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
index 44ed45095d8384e64a4090c0bc2d08b0f127f028..ac941acb27f029b8cb6383f19c5ad9aee03af2be 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -316,7 +316,14 @@ void DevToolsEmulator::setTouchEventEmulationEnabled(bool enabled)
m_webViewImpl->page()->settings().setMaxTouchPoints(enabled ? 1 : m_originalMaxTouchPoints);
}
m_touchEventEmulationEnabled = enabled;
- m_webViewImpl->mainFrameImpl()->frameView()->layout();
+ // TODO(dgozman): mainFrameImpl() check in this class should be unnecessary.
+ // It is only needed when we reattach and restore InspectorEmulationAgent,
+ // which happens before everything has been setup correctly, and therefore
+ // fails during remote -> local main frame transition.
+ // We should instead route emulation through the WebViewImpl which has
+ // local main frame, and remove InspectorEmulationAgent entirely.
nasko 2016/01/26 19:43:07 WebViewImpl is not guaranteed to have local main f
dgozman 2016/01/27 17:54:44 Ah, right. But if we send the page-level IPC from
nasko 2016/01/27 17:55:57 Page-level IPCs in general should go to all proces
+ if (m_webViewImpl->mainFrameImpl())
+ m_webViewImpl->mainFrameImpl()->frameView()->layout();
}
void DevToolsEmulator::setScriptExecutionDisabled(bool scriptExecutionDisabled)
« 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