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

Unified Diff: cc/trees/thread_proxy.cc

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 3 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/browser/android/in_process/synchronous_compositor_factory_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index df9d560ac6f09f549a83faffc8d4e359a3d0ead8..585cbf52bf67c2b69b2d8522679e03d7fa5baed4 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -210,26 +210,22 @@ void ThreadProxy::RequestNewOutputSurface() {
layer_tree_host()->RequestNewOutputSurface();
}
-void ThreadProxy::SetOutputSurface(scoped_ptr<OutputSurface> output_surface) {
+void ThreadProxy::SetOutputSurface(OutputSurface* output_surface) {
Proxy::ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadProxy::InitializeOutputSurfaceOnImplThread,
- impl_thread_weak_ptr_, base::Passed(&output_surface)));
+ FROM_HERE, base::Bind(&ThreadProxy::InitializeOutputSurfaceOnImplThread,
+ impl_thread_weak_ptr_, output_surface));
}
-scoped_ptr<OutputSurface> ThreadProxy::ReleaseOutputSurface() {
+void ThreadProxy::ReleaseOutputSurface() {
DCHECK(IsMainThread());
DCHECK(layer_tree_host()->output_surface_lost());
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
CompletionEvent completion;
- scoped_ptr<OutputSurface> output_surface;
Proxy::ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadProxy::ReleaseOutputSurfaceOnImplThread,
- impl_thread_weak_ptr_, &completion, &output_surface));
+ FROM_HERE, base::Bind(&ThreadProxy::ReleaseOutputSurfaceOnImplThread,
+ impl_thread_weak_ptr_, &completion));
completion.Wait();
- return output_surface;
}
void ThreadProxy::DidInitializeOutputSurface(
@@ -1041,12 +1037,12 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
}
void ThreadProxy::InitializeOutputSurfaceOnImplThread(
- scoped_ptr<OutputSurface> output_surface) {
+ OutputSurface* output_surface) {
TRACE_EVENT0("cc", "ThreadProxy::InitializeOutputSurfaceOnImplThread");
DCHECK(IsImplThread());
LayerTreeHostImpl* host_impl = impl().layer_tree_host_impl.get();
- bool success = host_impl->InitializeRenderer(output_surface.Pass());
+ bool success = host_impl->InitializeRenderer(output_surface);
RendererCapabilities capabilities;
if (success) {
capabilities =
@@ -1065,14 +1061,13 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread(
}
void ThreadProxy::ReleaseOutputSurfaceOnImplThread(
- CompletionEvent* completion,
- scoped_ptr<OutputSurface>* output_surface) {
+ CompletionEvent* completion) {
DCHECK(IsImplThread());
// Unlike DidLoseOutputSurfaceOnImplThread, we don't need to call
// LayerTreeHost::DidLoseOutputSurface since it already knows.
impl().scheduler->DidLoseOutputSurface();
- *output_surface = impl().layer_tree_host_impl->ReleaseOutputSurface();
+ impl().layer_tree_host_impl->ReleaseOutputSurface();
completion->Signal();
}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/browser/android/in_process/synchronous_compositor_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698