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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 160073005: Cache the boolean value in instance variable instead of calling usingDelegatedRenderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache the boolean value in usingDelegatedRenderer Created 6 years, 10 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: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 4f1c64d810b30557b4b3434ce3de598a3915c4f4..132a9c2c99df872e36c01086230126103fb932b9 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -105,15 +105,12 @@ void CopyFromCompositingSurfaceFinished(
}
bool UsingDelegatedRenderer() {
- bool using_delegated_renderer = false;
-
- using_delegated_renderer |= CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableDelegatedRenderer);
-
- using_delegated_renderer &= !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableDelegatedRenderer);
-
- return using_delegated_renderer;
+ static bool g_using_delegated_renderer =
no sievers 2014/02/12 17:37:00 nit: remove 'g_' prefix since the scope of the var
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableDelegatedRenderer) &&
no sievers 2014/02/12 17:37:00 nit: indent is wrong in this whole block
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableDelegatedRenderer);
+ return g_using_delegated_renderer;
}
ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
« 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