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

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

Issue 2775113002: Audit use of m_client in WebFrameWidgetImpl and remove null checks. (Closed)
Patch Set: 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/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 5f235c711f502c0e4f278d903c1435bb9988525c..147caaab6d7f3f424c20567499e6918b90a3ae8e 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -188,13 +188,12 @@ void WebFrameWidgetImpl::sendResizeEventAndRepaint() {
m_localRoot->frame()->document()->enqueueResizeEvent();
}
- if (m_client) {
- if (isAcceleratedCompositingActive()) {
- updateLayerTreeViewport();
- } else {
- WebRect damagedRect(0, 0, m_size.width, m_size.height);
- m_client->didInvalidateRect(damagedRect);
- }
+ DCHECK(m_client);
+ if (isAcceleratedCompositingActive()) {
+ updateLayerTreeViewport();
+ } else {
+ WebRect damagedRect(0, 0, m_size.width, m_size.height);
+ m_client->didInvalidateRect(damagedRect);
}
}
@@ -340,6 +339,7 @@ WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
AutoReset<const WebInputEvent*> currentEventChange(&m_currentInputEvent,
&inputEvent);
+ DCHECK(m_client);
dcheng 2017/03/27 04:33:24 (Also, I'm not sure where this DCHECK comes from;
if (m_client->isPointerLocked() &&
WebInputEvent::isMouseEventType(inputEvent.type())) {
pointerLockMouseEvent(inputEvent);
@@ -423,8 +423,8 @@ void WebFrameWidgetImpl::scheduleAnimation() {
m_layerTreeView->setNeedsBeginFrame();
return;
}
- if (m_client)
- m_client->scheduleAnimation();
+ DCHECK(m_client);
+ m_client->scheduleAnimation();
}
CompositorMutatorImpl& WebFrameWidgetImpl::mutator() {
@@ -831,6 +831,7 @@ WebInputEventResult WebFrameWidgetImpl::handleMouseWheel(
WebInputEventResult WebFrameWidgetImpl::handleGestureEvent(
const WebGestureEvent& event) {
+ DCHECK(m_client);
dcheng 2017/03/27 04:33:24 Ditto.
WebInputEventResult eventResult = WebInputEventResult::NotHandled;
bool eventCancelled = false;
switch (event.type()) {
@@ -990,13 +991,12 @@ Element* WebFrameWidgetImpl::focusedElement() const {
}
void WebFrameWidgetImpl::initializeLayerTreeView() {
- if (m_client) {
- DCHECK(!m_mutator);
- m_layerTreeView = m_client->initializeLayerTreeView();
- if (m_layerTreeView && m_layerTreeView->compositorAnimationHost()) {
- m_animationHost = WTF::makeUnique<CompositorAnimationHost>(
- m_layerTreeView->compositorAnimationHost());
- }
+ DCHECK(m_client);
+ DCHECK(!m_mutator);
+ m_layerTreeView = m_client->initializeLayerTreeView();
+ if (m_layerTreeView && m_layerTreeView->compositorAnimationHost()) {
+ m_animationHost = WTF::makeUnique<CompositorAnimationHost>(
+ m_layerTreeView->compositorAnimationHost());
}
if (WebDevToolsAgentImpl* devTools = m_localRoot->devToolsAgentImpl())
@@ -1011,8 +1011,7 @@ void WebFrameWidgetImpl::initializeLayerTreeView() {
// FIXME: only unittests, click to play, Android priting, and printing (for
// headers and footers) make this assert necessary. We should make them not
// hit this code and then delete allowsBrokenNullLayerTreeView.
- DCHECK(m_layerTreeView || !m_client ||
- m_client->allowsBrokenNullLayerTreeView());
+ DCHECK(m_layerTreeView || m_client->allowsBrokenNullLayerTreeView());
}
void WebFrameWidgetImpl::setIsAcceleratedCompositingActive(bool active) {
@@ -1027,9 +1026,6 @@ void WebFrameWidgetImpl::setIsAcceleratedCompositingActive(bool active) {
if (m_isAcceleratedCompositingActive == active)
return;
- if (!m_client)
- return;
-
if (active) {
TRACE_EVENT0("blink",
"WebViewImpl::setIsAcceleratedCompositingActive(true)");
« 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