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

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: Fix unit test hang by explicitly NULLing out impl_thread_message_loop_proxy_ Created 8 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: 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..c9d666b32340e58b04a36f8269c5c7e01d383dfb 100644
--- a/webkit/compositor_bindings/web_compositor_support_impl.cc
+++ b/webkit/compositor_bindings/web_compositor_support_impl.cc
@@ -5,10 +5,11 @@
#include "config.h"
#include "webkit/compositor_bindings/web_compositor_support_impl.h"
+#include "base/message_loop_proxy.h"
#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 +22,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,8 +47,6 @@ using WebKit::WebTransformAnimationCurve;
using WebKit::WebVideoFrameProvider;
using WebKit::WebVideoLayer;
-using WebKit::WebCompositorImpl;
-
namespace webkit {
WebCompositorSupportImpl::WebCompositorSupportImpl() {
@@ -55,16 +55,21 @@ WebCompositorSupportImpl::WebCompositorSupportImpl() {
WebCompositorSupportImpl::~WebCompositorSupportImpl() {
}
-void WebCompositorSupportImpl::initialize(WebKit::WebThread* thread) {
- WebCompositorImpl::initialize(thread);
+void WebCompositorSupportImpl::initialize(WebKit::WebThread* impl_thread) {
+ if (impl_thread) {
+ impl_thread_message_loop_proxy_ =
+ static_cast<webkit_glue::WebThreadImpl*>(impl_thread)->
+ message_loop()->message_loop_proxy();
+ } else {
+ impl_thread_message_loop_proxy_ = NULL;
jamesr 2012/11/03 00:13:13 could you do this in ::shutdown() ?
+ }
}
bool WebCompositorSupportImpl::isThreadingEnabled() {
- return WebCompositorImpl::isThreadingEnabled();
+ return impl_thread_message_loop_proxy_;
}
void WebCompositorSupportImpl::shutdown() {
- WebCompositorImpl::shutdown();
}
void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) {
@@ -88,7 +93,11 @@ WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView(
const WebLayerTreeView::Settings& settings) {
scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl(
new WebKit::WebLayerTreeViewImpl(client));
- if (!layerTreeViewImpl->initialize(settings))
+ scoped_ptr<cc::Thread> impl_thread(NULL);
+ if (impl_thread_message_loop_proxy_)
+ impl_thread = cc::ThreadImpl::createForDifferentThread(
+ impl_thread_message_loop_proxy_);
+ if (!layerTreeViewImpl->initialize(settings, impl_thread.Pass()))
return NULL;
layerTreeViewImpl->setRootLayer(root);
return layerTreeViewImpl.release();
« no previous file with comments | « webkit/compositor_bindings/web_compositor_support_impl.h ('k') | webkit/compositor_bindings/web_layer_tree_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698