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

Unified Diff: cc/base/switches.cc

Issue 73923003: Shared Raster Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Task namespace for WorkerPool Created 7 years, 1 month 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: cc/base/switches.cc
diff --git a/cc/base/switches.cc b/cc/base/switches.cc
old mode 100644
new mode 100755
index be4a2c55adfbcb22214a0a92439f59da8fd112e2..ac0982244e1e4f12d28d61635fee9f1d1b0c921a
--- a/cc/base/switches.cc
+++ b/cc/base/switches.cc
@@ -5,6 +5,7 @@
#include "cc/base/switches.h"
#include "base/command_line.h"
+#include "base/strings/string_number_conversions.h"
namespace cc {
namespace switches {
@@ -198,5 +199,16 @@ bool IsMapImageEnabled() {
return false;
}
+int GetNumRasterThreads() {
reveman 2013/11/21 16:36:10 nit: indent 2 spaces not 4
reveman 2013/11/21 16:36:10 return size_t instead of int?
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ std::string string_value =
+ command_line.GetSwitchValueASCII(cc::switches::kNumRasterThreads);
vivekg 2013/11/21 17:18:12 In case kNumRasterThreads command line switch is n
reveman 2013/11/21 17:30:02 Yes, please add a command_line.HasSwitch check and
+ int num_threads;
+ base::StringToInt(string_value, &num_threads);
+ if (num_threads == 0)
+ num_threads = 1; // Min num of threads
reveman 2013/11/21 16:36:10 we should also put a limit on the max number of th
+ return num_threads;
+}
+
} // namespace switches
} // namespace cc
« no previous file with comments | « cc/base/switches.h ('k') | cc/resources/worker_pool.h » ('j') | cc/resources/worker_pool.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698