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

Unified Diff: cc/rate_limiter.cc

Issue 12566033: cc: Chromify RateLimiter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« cc/rate_limiter.h ('K') | « cc/rate_limiter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/rate_limiter.cc
diff --git a/cc/rate_limiter.cc b/cc/rate_limiter.cc
index 2c5cbabf8f9e8c9bbcb418b9f11d50bd3269c7f2..f2d5274ebdf0154508b1050f3c98db6c05ed090f 100644
--- a/cc/rate_limiter.cc
+++ b/cc/rate_limiter.cc
@@ -10,50 +10,48 @@
namespace cc {
-scoped_refptr<RateLimiter> RateLimiter::create(WebKit::WebGraphicsContext3D* context, RateLimiterClient *client, Thread* thread)
-{
- return make_scoped_refptr(new RateLimiter(context, client, thread));
+scoped_refptr<RateLimiter> RateLimiter::Create(
+ WebKit::WebGraphicsContext3D* context,
+ RateLimiterClient* client,
+ Thread* thread) {
+ return make_scoped_refptr(new RateLimiter(context, client, thread));
}
-RateLimiter::RateLimiter(WebKit::WebGraphicsContext3D* context, RateLimiterClient *client, Thread* thread)
- : m_thread(thread)
- , m_context(context)
- , m_active(false)
- , m_client(client)
-{
- DCHECK(context);
+RateLimiter::RateLimiter(WebKit::WebGraphicsContext3D* context,
+ RateLimiterClient* client,
+ Thread* thread)
+ : thread_(thread),
+ context_(context),
+ active_(false),
+ client_(client) {
+ DCHECK(context);
}
-RateLimiter::~RateLimiter()
-{
-}
+RateLimiter::~RateLimiter() {}
-void RateLimiter::start()
-{
- if (m_active)
- return;
+void RateLimiter::Start() {
+ if (active_)
+ return;
- TRACE_EVENT0("cc", "RateLimiter::start");
- m_active = true;
- m_thread->postTask(base::Bind(&RateLimiter::rateLimitContext, this));
+ TRACE_EVENT0("cc", "RateLimiter::Start");
+ active_ = true;
+ thread_->postTask(base::Bind(&RateLimiter::RateLimitContext, this));
}
-void RateLimiter::stop()
-{
- TRACE_EVENT0("cc", "RateLimiter::stop");
- m_client = 0;
+void RateLimiter::Stop() {
+ TRACE_EVENT0("cc", "RateLimiter::Stop");
+ client_ = NULL;
}
-void RateLimiter::rateLimitContext()
-{
- if (!m_client)
- return;
+void RateLimiter::RateLimitContext() {
+ if (!client_)
+ return;
- TRACE_EVENT0("cc", "RateLimiter::rateLimitContext");
+ TRACE_EVENT0("cc", "RateLimiter::RateLimitContext");
- m_active = false;
- m_client->rateLimit();
- m_context->rateLimitOffscreenContextCHROMIUM();
+ active_ = false;
+ client_->RateLimit();
+ context_->rateLimitOffscreenContextCHROMIUM();
}
} // namespace cc
« cc/rate_limiter.h ('K') | « cc/rate_limiter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698