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

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

Issue 2804983003: [blink] Use early returns in baseBackgroundColor(Override) setters. (Closed)
Patch Set: Revert compositing update fix, keep other changes. 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
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | 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 452dcaa34d090d5a6747d3752ba3d6568d2826f8..757c642e0722bfa8fe5bd624184344c782b2f764 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3581,6 +3581,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()) {
@@ -3595,6 +3600,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
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698