Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_TREES_REMOTE_PROTO_CHANNEL_H_ | 5 #ifndef CC_TREES_REMOTE_PROTO_CHANNEL_H_ |
| 6 #define CC_TREES_REMOTE_PROTO_CHANNEL_H_ | 6 #define CC_TREES_REMOTE_PROTO_CHANNEL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 namespace proto { | 12 namespace proto { |
| 13 class CompositorMessage; | 13 class CompositorMessage; |
| 14 } | 14 } |
| 15 | 15 |
| 16 // Provides a bridge for getting compositor protobuf messages to/from the | 16 // Provides a bridge for getting compositor protobuf messages to/from the |
| 17 // outside world. | 17 // outside world. |
| 18 class RemoteProtoChannel { | 18 class RemoteProtoChannel { |
| 19 public: | 19 public: |
| 20 // Meant to be implemented by a RemoteChannel that needs to receive and parse | 20 // Meant to be implemented by a RemoteChannel that needs to receive and parse |
| 21 // incoming protobufs. | 21 // incoming protobufs. |
| 22 class ProtoReceiver { | 22 class ProtoReceiver { |
| 23 public: | 23 public: |
| 24 // TODO(khushalsagar): This should probably include a closure that returns | |
|
David Trainor- moved to gerrit
2015/12/11 17:13:44
We could influence channel throttling with that wh
Khushal
2015/12/11 22:49:37
Yup. We could avoid blocking the main thread on th
| |
| 25 // the status of processing this proto. | |
| 24 virtual void OnProtoReceived( | 26 virtual void OnProtoReceived( |
| 25 scoped_ptr<proto::CompositorMessage> proto) = 0; | 27 scoped_ptr<proto::CompositorMessage> proto) = 0; |
| 26 | 28 |
| 27 protected: | 29 protected: |
| 28 virtual ~ProtoReceiver() {} | 30 virtual ~ProtoReceiver() {} |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 virtual void SetProtoReceiver(ProtoReceiver* receiver) = 0; | 33 virtual void SetProtoReceiver(ProtoReceiver* receiver) = 0; |
| 32 virtual void SendCompositorProto(const proto::CompositorMessage& proto) = 0; | 34 virtual void SendCompositorProto(const proto::CompositorMessage& proto) = 0; |
| 33 | 35 |
| 34 protected: | 36 protected: |
| 35 virtual ~RemoteProtoChannel() {} | 37 virtual ~RemoteProtoChannel() {} |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 } // namespace cc | 40 } // namespace cc |
| 39 | 41 |
| 40 #endif // CC_TREES_REMOTE_PROTO_CHANNEL_H_ | 42 #endif // CC_TREES_REMOTE_PROTO_CHANNEL_H_ |
| OLD | NEW |