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

Unified Diff: cc/scheduler/rate_limiter.cc

Issue 53153006: Simplify rate limiting since it's main thread shared context only (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment 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
« no previous file with comments | « cc/scheduler/rate_limiter.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/rate_limiter.cc
diff --git a/cc/scheduler/rate_limiter.cc b/cc/scheduler/rate_limiter.cc
deleted file mode 100644
index d89d95b8cf23acfbb5ae886fbf3b972de9d9c51e..0000000000000000000000000000000000000000
--- a/cc/scheduler/rate_limiter.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/scheduler/rate_limiter.h"
-
-#include "base/bind.h"
-#include "base/debug/trace_event.h"
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/single_thread_task_runner.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
-
-namespace cc {
-
-scoped_refptr<RateLimiter> RateLimiter::Create(
- WebKit::WebGraphicsContext3D* context,
- RateLimiterClient* client,
- base::SingleThreadTaskRunner* task_runner) {
- return make_scoped_refptr(new RateLimiter(context, client, task_runner));
-}
-
-RateLimiter::RateLimiter(WebKit::WebGraphicsContext3D* context,
- RateLimiterClient* client,
- base::SingleThreadTaskRunner* task_runner)
- : context_(context),
- active_(false),
- client_(client),
- task_runner_(task_runner) {
- DCHECK(context);
-}
-
-RateLimiter::~RateLimiter() {}
-
-void RateLimiter::Start() {
- if (active_)
- return;
-
- TRACE_EVENT0("cc", "RateLimiter::Start");
- active_ = true;
- task_runner_->PostTask(FROM_HERE,
- base::Bind(&RateLimiter::RateLimitContext, this));
-}
-
-void RateLimiter::Stop() {
- TRACE_EVENT0("cc", "RateLimiter::Stop");
- client_ = NULL;
-}
-
-void RateLimiter::RateLimitContext() {
- if (!client_)
- return;
-
- TRACE_EVENT0("cc", "RateLimiter::RateLimitContext");
-
- active_ = false;
- client_->RateLimit();
- context_->rateLimitOffscreenContextCHROMIUM();
-}
-
-} // namespace cc
« no previous file with comments | « cc/scheduler/rate_limiter.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698