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

Side by Side Diff: cc/test/remote_proto_channel_bridge.cc

Issue 1513643010: cc:: Add remote mode to the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/test/remote_proto_channel_bridge.h"
6
7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/proto/compositor_message.pb.h"
10
11 namespace cc {
12
13 FakeRemoteProtoChannel::FakeRemoteProtoChannel(RemoteProtoChannelBridge* bridge)
14 : bridge_(bridge), receiver_(nullptr) {
15 DCHECK(bridge_);
16 }
17
18 FakeRemoteProtoChannel::~FakeRemoteProtoChannel() {}
19
20 void FakeRemoteProtoChannel::SetProtoReceiver(ProtoReceiver* receiver) {
21 // This should should only be called once.
22 DCHECK(!receiver_);
23 receiver_ = receiver;
24 }
25
26 FakeRemoteProtoChannelMain::FakeRemoteProtoChannelMain(
27 RemoteProtoChannelBridge* bridge)
28 : FakeRemoteProtoChannel(bridge) {}
29
30 void FakeRemoteProtoChannelMain::SendCompositorProto(
31 const proto::CompositorMessage& proto) {
32 bridge_->channel_impl.receiver_->OnProtoReceived(
33 make_scoped_ptr(new proto::CompositorMessage(proto)));
34 }
35
36 FakeRemoteProtoChannelImpl::FakeRemoteProtoChannelImpl(
37 RemoteProtoChannelBridge* bridge)
38 : FakeRemoteProtoChannel(bridge) {}
39
40 void FakeRemoteProtoChannelImpl::SendCompositorProto(
41 const proto::CompositorMessage& proto) {
42 bridge_->channel_main.receiver_->OnProtoReceived(
43 make_scoped_ptr(new proto::CompositorMessage(proto)));
44 }
45
46 RemoteProtoChannelBridge::RemoteProtoChannelBridge()
47 : channel_main(this), channel_impl(this) {}
48
49 RemoteProtoChannelBridge::~RemoteProtoChannelBridge() {}
50
51 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698