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

Unified Diff: webkit/compositor_bindings/web_compositor_support_impl.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 165064 Created 8 years, 2 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: webkit/compositor_bindings/web_compositor_support_impl.cc
diff --git a/webkit/compositor_bindings/web_compositor_support_impl.cc b/webkit/compositor_bindings/web_compositor_support_impl.cc
index 32a18408180f2ff163223c1aac85fcc6eec1549f..3669ff1816ccd45b499e0f04fb0ad4bba38577a5 100644
--- a/webkit/compositor_bindings/web_compositor_support_impl.cc
+++ b/webkit/compositor_bindings/web_compositor_support_impl.cc
@@ -7,8 +7,8 @@
#include "base/memory/scoped_ptr.h"
#include "cc/settings.h"
+#include "cc/thread_impl.h"
#include "webkit/compositor_bindings/web_animation_impl.h"
-#include "webkit/compositor_bindings/web_compositor_impl.h"
#include "webkit/compositor_bindings/web_content_layer_impl.h"
#include "webkit/compositor_bindings/web_delegated_renderer_layer_impl.h"
#include "webkit/compositor_bindings/web_external_texture_layer_impl.h"
@@ -21,6 +21,7 @@
#include "webkit/compositor_bindings/web_solid_color_layer_impl.h"
#include "webkit/compositor_bindings/web_transform_animation_curve_impl.h"
#include "webkit/compositor_bindings/web_video_layer_impl.h"
+#include "webkit/glue/webthread_impl.h"
using WebKit::WebAnimation;
using WebKit::WebAnimationCurve;
@@ -45,26 +46,28 @@ using WebKit::WebTransformAnimationCurve;
using WebKit::WebVideoFrameProvider;
using WebKit::WebVideoLayer;
-using WebKit::WebCompositorImpl;
-
namespace webkit {
-WebCompositorSupportImpl::WebCompositorSupportImpl() {
+WebCompositorSupportImpl::WebCompositorSupportImpl()
+ : impl_thread_(NULL) {
}
WebCompositorSupportImpl::~WebCompositorSupportImpl() {
}
-void WebCompositorSupportImpl::initialize(WebKit::WebThread* thread) {
- WebCompositorImpl::initialize(thread);
+void WebCompositorSupportImpl::initialize(WebKit::WebThread* impl_thread) {
+ if (impl_thread) {
+ webkit_glue::WebThreadImpl* web_thread_impl = static_cast<webkit_glue::WebThreadImpl*>(impl_thread);
+ MessageLoop* impl_message_loop = web_thread_impl->message_loop();
+ impl_thread_ = cc::ThreadImpl::createForDifferentThread(impl_message_loop->message_loop_proxy()).release();
+ }
}
bool WebCompositorSupportImpl::isThreadingEnabled() {
- return WebCompositorImpl::isThreadingEnabled();
+ return !!impl_thread_;
}
void WebCompositorSupportImpl::shutdown() {
- WebCompositorImpl::shutdown();
}
void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) {
@@ -88,7 +91,7 @@ WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView(
const WebLayerTreeView::Settings& settings) {
scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl(
new WebKit::WebLayerTreeViewImpl(client));
- if (!layerTreeViewImpl->initialize(settings))
+ if (!layerTreeViewImpl->initialize(settings, impl_thread_))
jamesr 2012/10/31 04:42:13 this passes ownership of impl_thread_ to the cc::L
return NULL;
layerTreeViewImpl->setRootLayer(root);
return layerTreeViewImpl.release();

Powered by Google App Engine
This is Rietveld 408576698