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

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: Address code review comments and fix all cc_unittests 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..786fe7d52d596c591667077c8909c2171d1d1817 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 "webkit/compositor_bindings/ccthread_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"
@@ -22,6 +22,7 @@
#include "webkit/compositor_bindings/web_transform_animation_curve_impl.h"
#include "webkit/compositor_bindings/web_video_layer_impl.h"
+using WebKit::CCThreadImpl;
using WebKit::WebAnimation;
using WebKit::WebAnimationCurve;
using WebKit::WebContentLayer;
@@ -45,26 +46,26 @@ 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)
+ impl_thread_ = CCThreadImpl::createForDifferentThread(impl_thread)
+ .release();
}
bool WebCompositorSupportImpl::isThreadingEnabled() {
- return WebCompositorImpl::isThreadingEnabled();
+ return !!impl_thread_;
}
void WebCompositorSupportImpl::shutdown() {
- WebCompositorImpl::shutdown();
}
void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) {
@@ -88,7 +89,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_))
return NULL;
layerTreeViewImpl->setRootLayer(root);
return layerTreeViewImpl.release();

Powered by Google App Engine
This is Rietveld 408576698