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

Unified Diff: components/viz/client/client_compositor_frame_sink.cc

Issue 2907683004: Move ClientCompositorFrameSink to components/viz (Closed)
Patch Set: c Created 3 years, 7 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 | « components/viz/client/client_compositor_frame_sink.h ('k') | content/renderer/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/viz/client/client_compositor_frame_sink.cc
diff --git a/services/ui/public/cpp/client_compositor_frame_sink.cc b/components/viz/client/client_compositor_frame_sink.cc
similarity index 88%
rename from services/ui/public/cpp/client_compositor_frame_sink.cc
rename to components/viz/client/client_compositor_frame_sink.cc
index bc3a61b499d53e7e64e652d9905beba2c73ed061..df0ad3f928eb32b6699386d8c3f8eb223a4fb50b 100644
--- a/services/ui/public/cpp/client_compositor_frame_sink.cc
+++ b/components/viz/client/client_compositor_frame_sink.cc
@@ -1,8 +1,8 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "services/ui/public/cpp/client_compositor_frame_sink.h"
+#include "components/viz/client/client_compositor_frame_sink.h"
#include "base/bind.h"
#include "base/memory/ptr_util.h"
@@ -10,7 +10,7 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_sink_client.h"
-namespace ui {
+namespace viz {
ClientCompositorFrameSink::ClientCompositorFrameSink(
scoped_refptr<cc::ContextProvider> context_provider,
@@ -24,7 +24,9 @@ ClientCompositorFrameSink::ClientCompositorFrameSink(
nullptr),
compositor_frame_sink_info_(std::move(compositor_frame_sink_info)),
client_request_(std::move(client_request)),
- enable_surface_synchronization_(enable_surface_synchronization) {}
+ enable_surface_synchronization_(enable_surface_synchronization) {
+ DETACH_FROM_THREAD(thread_checker_);
+}
ClientCompositorFrameSink::~ClientCompositorFrameSink() {}
@@ -33,8 +35,7 @@ bool ClientCompositorFrameSink::BindToClient(
if (!cc::CompositorFrameSink::BindToClient(client))
return false;
- DCHECK(!thread_checker_);
- thread_checker_.reset(new base::ThreadChecker());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
compositor_frame_sink_.Bind(std::move(compositor_frame_sink_info_));
client_binding_.reset(
new mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient>(
@@ -63,8 +64,7 @@ void ClientCompositorFrameSink::SetLocalSurfaceId(
void ClientCompositorFrameSink::SubmitCompositorFrame(
cc::CompositorFrame frame) {
- DCHECK(thread_checker_);
- DCHECK(thread_checker_->CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!compositor_frame_sink_)
return;
@@ -92,8 +92,7 @@ void ClientCompositorFrameSink::DidNotProduceFrame(
void ClientCompositorFrameSink::DidReceiveCompositorFrameAck(
const cc::ReturnedResourceArray& resources) {
- DCHECK(thread_checker_);
- DCHECK(thread_checker_->CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!client_)
return;
client_->ReclaimResources(resources);
@@ -107,8 +106,7 @@ void ClientCompositorFrameSink::OnBeginFrame(
void ClientCompositorFrameSink::ReclaimResources(
const cc::ReturnedResourceArray& resources) {
- DCHECK(thread_checker_);
- DCHECK(thread_checker_->CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!client_)
return;
client_->ReclaimResources(resources);
@@ -118,4 +116,4 @@ void ClientCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frames) {
compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frames);
}
-} // namespace ui
+} // namespace viz
« no previous file with comments | « components/viz/client/client_compositor_frame_sink.h ('k') | content/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698