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

Unified Diff: cc/layers/layer.cc

Issue 17114008: cc: Remove cc::Thread and cc::ThreadImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-thread: clarify threads in UpdateBackgroundAnimateTicking, test asserts Created 7 years, 6 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
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 5ec0621fc6e68146ab88616ac2d927be1740aea9..7c7f432e2cc83d68bdafb2e5e22dfe2fc94f42e9 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -6,11 +6,12 @@
#include <algorithm>
+#include "base/location.h"
#include "base/metrics/histogram.h"
+#include "base/single_thread_task_runner.h"
#include "cc/animation/animation.h"
#include "cc/animation/animation_events.h"
#include "cc/animation/layer_animation_controller.h"
-#include "cc/base/thread.h"
#include "cc/layers/layer_impl.h"
#include "cc/output/copy_output_request.h"
#include "cc/trees/layer_tree_host.h"
@@ -657,12 +658,14 @@ static void RunCopyCallbackOnMainThread(scoped_ptr<CopyOutputRequest> request,
request->SendBitmapResult(bitmap.Pass());
}
-static void PostCopyCallbackToMainThread(Thread* main_thread,
- scoped_ptr<CopyOutputRequest> request,
- scoped_ptr<SkBitmap> bitmap) {
- main_thread->PostTask(base::Bind(&RunCopyCallbackOnMainThread,
- base::Passed(&request),
- base::Passed(&bitmap)));
+static void PostCopyCallbackToMainThread(
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
+ scoped_ptr<CopyOutputRequest> request,
+ scoped_ptr<SkBitmap> bitmap) {
+ main_thread_task_runner->PostTask(FROM_HERE,
+ base::Bind(&RunCopyCallbackOnMainThread,
+ base::Passed(&request),
+ base::Passed(&bitmap)));
}
void Layer::PushPropertiesTo(LayerImpl* layer) {
@@ -712,11 +715,13 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
for (ScopedPtrVector<CopyOutputRequest>::iterator it = copy_requests_.begin();
it != copy_requests_.end();
++it) {
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner =
+ layer_tree_host()->proxy()->MainThreadTaskRunner();
scoped_ptr<CopyOutputRequest> original_request = copy_requests_.take(it);
scoped_ptr<CopyOutputRequest> main_thread_request =
CopyOutputRequest::CreateBitmapRequest(base::Bind(
&PostCopyCallbackToMainThread,
- layer_tree_host()->proxy()->MainThread(),
+ main_thread_task_runner,
base::Passed(&original_request)));
main_thread_copy_requests.push_back(main_thread_request.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698