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

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

Issue 2804983003: [blink] Use early returns in baseBackgroundColor(Override) setters. (Closed)
Patch Set: Created 3 years, 8 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
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 fa53cf4be94d6f5fdaa592e667ebd34d4fd8f577..7a2b1cceac963303c524641c6e54d55669b9e61f 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -302,12 +302,20 @@ void WebFrameWidgetImpl::clearBackgroundColorOverride() {
}
void WebFrameWidgetImpl::setBaseBackgroundColorOverride(WebColor color) {
+ if (m_baseBackgroundColorOverrideEnabled &&
+ m_baseBackgroundColorOverride == color) {
+ return;
+ }
+
m_baseBackgroundColorOverrideEnabled = true;
m_baseBackgroundColorOverride = color;
updateBaseBackgroundColor();
}
void WebFrameWidgetImpl::clearBaseBackgroundColorOverride() {
+ if (!m_baseBackgroundColorOverrideEnabled)
+ return;
+
m_baseBackgroundColorOverrideEnabled = false;
updateBaseBackgroundColor();
}

Powered by Google App Engine
This is Rietveld 408576698