summaryrefslogtreecommitdiffstats
path: root/remoting/host/client_connection.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 22:56:04 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 22:56:04 +0000
commite295ff0698eda75aa7e2b887362310df59ff559e (patch)
tree371a61e5da9e5c572ef40045937d6548fbcae6e3 /remoting/host/client_connection.h
parent0a33b90c45a0b1a139e3a655666ba337ecb600b0 (diff)
downloadchromium_src-e295ff0698eda75aa7e2b887362310df59ff559e.zip
chromium_src-e295ff0698eda75aa7e2b887362310df59ff559e.tar.gz
chromium_src-e295ff0698eda75aa7e2b887362310df59ff559e.tar.bz2
Changing UpdateStreamPacket protobuf definition for chromoting
This code also changes the API for encoder and ClientConnection to eliminate one less copy. Review URL: http://codereview.chromium.org/2963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/client_connection.h')
-rw-r--r--remoting/host/client_connection.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/remoting/host/client_connection.h b/remoting/host/client_connection.h
index 3e85cc9..c647eb6 100644
--- a/remoting/host/client_connection.h
+++ b/remoting/host/client_connection.h
@@ -62,6 +62,12 @@ class ClientConnection : public base::RefCountedThreadSafe<ClientConnection>,
virtual ~ClientConnection();
+ // Creates a DataBuffer object that wraps around HostMessage. The DataBuffer
+ // object will be responsible for serializing and framing the message.
+ // DataBuffer will also own |msg| after this call.
+ static scoped_refptr<media::DataBuffer> CreateWireFormatDataBuffer(
+ const HostMessage* msg);
+
virtual void set_jingle_channel(JingleChannel* channel) {
channel_ = channel;
}
@@ -75,10 +81,15 @@ class ClientConnection : public base::RefCountedThreadSafe<ClientConnection>,
// Notifies the viewer the start of an update stream.
virtual void SendBeginUpdateStreamMessage();
- // Send encoded update stream data to the viewer. The viewer
- // should not take ownership of the data.
+ // Send encoded update stream data to the viewer.
+ //
+ // |data| is the actual bytes in wire format. That means it is fully framed
+ // and serialized from a HostMessage. This is a special case only for
+ // UpdateStreamPacket to reduce the amount of memory copies.
+ //
+ // |data| should be created by calling to
+ // CreateWireFormatDataBuffer(HostMessage).
virtual void SendUpdateStreamPacketMessage(
- const UpdateStreamPacketHeader* header,
scoped_refptr<media::DataBuffer> data);
// Notifies the viewer the update stream has ended.