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

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 137957)
+++ content/browser/web_contents/web_contents_impl.cc (working copy)
@@ -220,6 +220,18 @@
delegate->AddNavigationHeaders(params->url, &params->extra_headers);
}
+int GetSwitchValueAsInt(
+ const CommandLine& command_line,
+ const std::string& switch_string,
+ int min_value) {
+ std::string string_value = command_line.GetSwitchValueASCII(switch_string);
+ int int_value;
+ if (base::StringToInt(string_value, &int_value))
+ return std::max(min_value, int_value);
+ else
+ return min_value;
+}
+
} // namespace
namespace content {
@@ -515,6 +527,19 @@
}
#endif
+ if (command_line.HasSwitch(switches::kDefaultTileWidth))
+ prefs.default_tile_width =
+ GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1);
+ if (command_line.HasSwitch(switches::kDefaultTileHeight))
+ prefs.default_tile_height =
+ GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1);
+ if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth))
+ prefs.max_untiled_layer_width =
+ GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1);
+ if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight))
+ prefs.max_untiled_layer_height =
+ GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerHeight, 1);
+
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