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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.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/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index f6586700e856de30197df47465adfd35b72ab985..19ba33f5a6e79093d6682ff64b1fb65c5c9340c4 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3597,6 +3597,11 @@ void WebViewImpl::setBaseBackgroundColor(WebColor color) {
}
void WebViewImpl::setBaseBackgroundColorOverride(WebColor color) {
+ if (m_baseBackgroundColorOverrideEnabled &&
+ m_baseBackgroundColorOverride == color) {
+ return;
+ }
+
m_baseBackgroundColorOverrideEnabled = true;
m_baseBackgroundColorOverride = color;
if (mainFrameImpl()) {
@@ -3611,6 +3616,9 @@ void WebViewImpl::setBaseBackgroundColorOverride(WebColor color) {
}
void WebViewImpl::clearBaseBackgroundColorOverride() {
+ if (!m_baseBackgroundColorOverrideEnabled)
+ return;
+
m_baseBackgroundColorOverrideEnabled = false;
if (mainFrameImpl()) {
// Force lifecycle update to ensure we're good to call

Powered by Google App Engine
This is Rietveld 408576698