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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10386213: Add command line flags for compositor's default tile size and (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
===================================================================
--- content/browser/web_contents/web_contents_impl.cc (revision 137875)
+++ content/browser/web_contents/web_contents_impl.cc (working copy)
@@ -229,6 +229,15 @@
delegate->AddNavigationHeaders(params->url, &params->extra_headers);
}
+int GetSwitchValueInt(
darin (slow to review) 2012/05/18 20:20:17 nit: GetSwitchValueInt -> GetSwitchValueAsInt
+ const CommandLine& command_line,
+ const std::string& switch_string) {
+ std::string string_value = command_line.GetSwitchValueASCII(switch_string);
+ int int_value;
darin (slow to review) 2012/05/18 20:20:17 nit: initialize int_value? or, check the return v
+ base::StringToInt(string_value, &int_value);
+ return int_value;
+}
+
} // namespace
namespace content {
@@ -535,6 +544,19 @@
}
#endif
+ if (command_line.HasSwitch(switches::kDefaultTileWidth))
+ prefs.default_tile_width = std::max(
+ 1, GetSwitchValueInt(command_line, switches::kDefaultTileWidth));
darin (slow to review) 2012/05/18 20:20:17 nit: maybe the lower bound value should just be a
+ if (command_line.HasSwitch(switches::kDefaultTileHeight))
+ prefs.default_tile_height = std::max(
+ 1, GetSwitchValueInt(command_line, switches::kDefaultTileHeight));
+ if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth))
+ prefs.max_untiled_layer_width = std::max(
+ 1, GetSwitchValueInt(command_line, switches::kMaxUntiledLayerWidth));
+ if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight))
+ prefs.max_untiled_layer_height = std::max(
+ 1, GetSwitchValueInt(command_line, switches::kMaxUntiledLayerHeight));
+
content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs);
return prefs;
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698