diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 22:17:22 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 22:17:22 +0000 |
commit | 6928c77fd5827419081b8b010c729419d6cd8e5a (patch) | |
tree | 1902447112fa1c51b905ac53bb7e6fdd9b3c0f84 /remoting | |
parent | 52ded45f70f0defc422d0fcf2b1cd873be839a69 (diff) | |
download | chromium_src-6928c77fd5827419081b8b010c729419d6cd8e5a.zip chromium_src-6928c77fd5827419081b8b010c729419d6cd8e5a.tar.gz chromium_src-6928c77fd5827419081b8b010c729419d6cd8e5a.tar.bz2 |
Revert 57112 - Rename (Host|Client)Message to Chromoting(Host|Client)Message.
Rename HostMessage and ClientMessage to Chromoting{Host|Client}Message to
avoid conflicts with messages in X11.
Actually, only ClientMessage needs to be changed due to conflict, but HostMessage is changed to keep the names consistent.
BUG=none
TEST=remoting unittests
Review URL: http://codereview.chromium.org/3161034
TBR=garykac@chromium.org
Review URL: http://codereview.chromium.org/3141036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
28 files changed, 97 insertions, 99 deletions
diff --git a/remoting/base/codec_test.cc b/remoting/base/codec_test.cc index 40c42ed..fd4469c 100644 --- a/remoting/base/codec_test.cc +++ b/remoting/base/codec_test.cc @@ -85,7 +85,7 @@ class EncoderMessageTester { } // Test that we received the correct message. - void ReceivedMessage(ChromotingHostMessage* message) { + void ReceivedMessage(HostMessage* message) { EXPECT_TRUE(message->has_update_stream_packet()); if (state_ == kWaitingForBeginRect) { @@ -162,7 +162,7 @@ class DecoderTester { EXPECT_TRUE(frame_.get()); } - void ReceivedMessage(ChromotingHostMessage* message) { + void ReceivedMessage(HostMessage* message) { if (message->has_update_stream_packet()) { decoder_->PartialDecode(message); return; @@ -265,7 +265,7 @@ class EncoderTester { EXPECT_GT(data_available_, 0); } - void DataAvailable(ChromotingHostMessage* message, + void DataAvailable(HostMessage* message, Encoder::EncodingState state) { ++data_available_; message_tester_->ReceivedMessage(message); @@ -274,7 +274,7 @@ class EncoderTester { // Send the message to the DecoderTester. if (decoder_tester_) { if (state & Encoder::EncodingStarting) { - ChromotingHostMessage* begin_update = new ChromotingHostMessage(); + HostMessage* begin_update = new HostMessage(); begin_update->mutable_begin_update_stream(); decoder_tester_->ReceivedMessage(begin_update); } @@ -284,7 +284,7 @@ class EncoderTester { } if (state & Encoder::EncodingEnded) { - ChromotingHostMessage* end_update = new ChromotingHostMessage(); + HostMessage* end_update = new HostMessage(); end_update->mutable_end_update_stream(); decoder_tester_->ReceivedMessage(end_update); } diff --git a/remoting/base/decoder.h b/remoting/base/decoder.h index 9795761..1df477d 100644 --- a/remoting/base/decoder.h +++ b/remoting/base/decoder.h @@ -24,7 +24,7 @@ typedef std::vector<gfx::Rect> UpdatedRects; // Sequence of actions with a decoder is as follows: // // 1. BeginDecode(PartialDecodeDone, DecodeDone, VideoFrame) -// 2. PartialDecode(ChromotingHostMessage) +// 2. PartialDecode(HostMessage) // ... // 3. EndDecode() // @@ -54,15 +54,15 @@ class Decoder { Task* partial_decode_done, Task* decode_done) = 0; - // Give a ChromotingHostMessage that contains the update stream packet that - // contains the encoded data to the decoder. + // Give a HostMessage that contains the update stream packet that contains + // the encoded data to the decoder. // The decoder will own |message| and is responsible for deleting it. // // If the decoder has written something into |frame|, // |partial_decode_done_| is called with |frame| and updated regions. // Return true if the decoder can accept |message| and decode it. // - // ChromotingHostMessage returned by this method will contain a + // HostMessage returned by this method will contain a // UpdateStreamPacketMessage. // This message will contain either: // 1. UpdateStreamBeginRect @@ -71,7 +71,7 @@ class Decoder { // // See remoting/base/protocol/chromotocol.proto for more information about // these messages. - virtual bool PartialDecode(ChromotingHostMessage* message) = 0; + virtual bool PartialDecode(HostMessage* message) = 0; // Notify the decoder that we have received the last update stream packet. // If the decoding of the update stream has completed |decode_done_| is diff --git a/remoting/base/decoder_verbatim.cc b/remoting/base/decoder_verbatim.cc index 3af6032..e17310d 100644 --- a/remoting/base/decoder_verbatim.cc +++ b/remoting/base/decoder_verbatim.cc @@ -38,8 +38,8 @@ bool DecoderVerbatim::BeginDecode(scoped_refptr<media::VideoFrame> frame, return true; } -bool DecoderVerbatim::PartialDecode(ChromotingHostMessage* message) { - scoped_ptr<ChromotingHostMessage> msg_deleter(message); +bool DecoderVerbatim::PartialDecode(HostMessage* message) { + scoped_ptr<HostMessage> msg_deleter(message); DCHECK(message->has_update_stream_packet()); bool ret = true; @@ -62,7 +62,7 @@ void DecoderVerbatim::EndDecode() { updated_rects_ = NULL; } -bool DecoderVerbatim::HandleBeginRect(ChromotingHostMessage* message) { +bool DecoderVerbatim::HandleBeginRect(HostMessage* message) { DCHECK_EQ(kWaitingForBeginRect, state_); state_ = kWaitingForRectData; @@ -86,7 +86,7 @@ bool DecoderVerbatim::HandleBeginRect(ChromotingHostMessage* message) { return true; } -bool DecoderVerbatim::HandleRectData(ChromotingHostMessage* message) { +bool DecoderVerbatim::HandleRectData(HostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); DCHECK_EQ(0, message->update_stream_packet().rect_data().sequence_number()); @@ -118,7 +118,7 @@ bool DecoderVerbatim::HandleRectData(ChromotingHostMessage* message) { return true; } -bool DecoderVerbatim::HandleEndRect(ChromotingHostMessage* message) { +bool DecoderVerbatim::HandleEndRect(HostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); state_ = kWaitingForBeginRect; return true; diff --git a/remoting/base/decoder_verbatim.h b/remoting/base/decoder_verbatim.h index 67b6cfa..22543f9 100644 --- a/remoting/base/decoder_verbatim.h +++ b/remoting/base/decoder_verbatim.h @@ -18,15 +18,15 @@ class DecoderVerbatim : public Decoder { UpdatedRects* update_rects, Task* partial_decode_done, Task* decode_done); - virtual bool PartialDecode(ChromotingHostMessage* message); + virtual bool PartialDecode(HostMessage* message); virtual void EndDecode(); void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } private: - bool HandleBeginRect(ChromotingHostMessage* message); - bool HandleRectData(ChromotingHostMessage* message); - bool HandleEndRect(ChromotingHostMessage* message); + bool HandleBeginRect(HostMessage* message); + bool HandleRectData(HostMessage* message); + bool HandleEndRect(HostMessage* message); // The internal state of the decoder. State state_; diff --git a/remoting/base/decoder_verbatim_unittest.cc b/remoting/base/decoder_verbatim_unittest.cc index 8c00d76..947750a 100644 --- a/remoting/base/decoder_verbatim_unittest.cc +++ b/remoting/base/decoder_verbatim_unittest.cc @@ -21,7 +21,7 @@ TEST(DecoderVerbatimTest, SimpleDecode) { const size_t kWidth = 10; const size_t kHeight = 1; const char kData[] = "ABCDEFGHIJ"; - scoped_ptr<ChromotingHostMessage> msg(new ChromotingHostMessage()); + scoped_ptr<HostMessage> msg(new HostMessage()); // Prepare the begin rect message. UpdateStreamBeginRect* begin_rect = diff --git a/remoting/base/decoder_zlib.cc b/remoting/base/decoder_zlib.cc index b2b782a..e44a2f2 100644 --- a/remoting/base/decoder_zlib.cc +++ b/remoting/base/decoder_zlib.cc @@ -49,8 +49,8 @@ bool DecoderZlib::BeginDecode(scoped_refptr<media::VideoFrame> frame, return true; } -bool DecoderZlib::PartialDecode(ChromotingHostMessage* message) { - scoped_ptr<ChromotingHostMessage> msg_deleter(message); +bool DecoderZlib::PartialDecode(HostMessage* message) { + scoped_ptr<HostMessage> msg_deleter(message); DCHECK(message->has_update_stream_packet()); bool ret = true; @@ -74,7 +74,7 @@ void DecoderZlib::EndDecode() { decompressor_.reset(); } -bool DecoderZlib::HandleBeginRect(ChromotingHostMessage* message) { +bool DecoderZlib::HandleBeginRect(HostMessage* message) { DCHECK_EQ(kWaitingForBeginRect, state_); state_ = kWaitingForRectData; @@ -100,7 +100,7 @@ bool DecoderZlib::HandleBeginRect(ChromotingHostMessage* message) { return true; } -bool DecoderZlib::HandleRectData(ChromotingHostMessage* message) { +bool DecoderZlib::HandleRectData(HostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); DCHECK_EQ(0, message->update_stream_packet().rect_data().sequence_number()); @@ -145,7 +145,7 @@ bool DecoderZlib::HandleRectData(ChromotingHostMessage* message) { return true; } -bool DecoderZlib::HandleEndRect(ChromotingHostMessage* message) { +bool DecoderZlib::HandleEndRect(HostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); state_ = kWaitingForBeginRect; diff --git a/remoting/base/decoder_zlib.h b/remoting/base/decoder_zlib.h index ee897ab..05f8a99 100644 --- a/remoting/base/decoder_zlib.h +++ b/remoting/base/decoder_zlib.h @@ -20,16 +20,16 @@ class DecoderZlib : public Decoder { UpdatedRects* update_rects, Task* partial_decode_done, Task* decode_done); - virtual bool PartialDecode(ChromotingHostMessage* message); + virtual bool PartialDecode(HostMessage* message); virtual void EndDecode(); // TODO(hclam): Should make this into the Decoder interface. void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } private: - bool HandleBeginRect(ChromotingHostMessage* message); - bool HandleRectData(ChromotingHostMessage* message); - bool HandleEndRect(ChromotingHostMessage* message); + bool HandleBeginRect(HostMessage* message); + bool HandleRectData(HostMessage* message); + bool HandleEndRect(HostMessage* message); // The internal state of the decoder. State state_; diff --git a/remoting/base/encoder.h b/remoting/base/encoder.h index 3704f3f..0c1fd50f 100644 --- a/remoting/base/encoder.h +++ b/remoting/base/encoder.h @@ -17,7 +17,7 @@ namespace media { namespace remoting { class CaptureData; -class ChromotingHostMessage; +class HostMessage; // A class to perform the task of encoding a continous stream of // images. @@ -40,8 +40,7 @@ class Encoder { // of HostMessage to reduce the amount of memory copies. // The callback takes ownership of the HostMessage and is responsible for // deleting it. - typedef Callback2<ChromotingHostMessage*, - EncodingState>::Type DataAvailableCallback; + typedef Callback2<HostMessage*, EncodingState>::Type DataAvailableCallback; virtual ~Encoder() {} diff --git a/remoting/base/encoder_verbatim.cc b/remoting/base/encoder_verbatim.cc index d3821d7..6a5a7d6 100644 --- a/remoting/base/encoder_verbatim.cc +++ b/remoting/base/encoder_verbatim.cc @@ -23,7 +23,7 @@ void EncoderVerbatim::Encode(scoped_refptr<CaptureData> capture_data, for (InvalidRects::const_iterator r = rects.begin(); r != rects.end(); ++r, ++index) { const gfx::Rect& dirty_rect = *r; - ChromotingHostMessage* msg = new ChromotingHostMessage(); + HostMessage* msg = new HostMessage(); UpdateStreamPacketMessage* packet = msg->mutable_update_stream_packet(); if (EncodeRect(dirty_rect.x(), dirty_rect.y(), dirty_rect.width(), diff --git a/remoting/base/encoder_zlib.cc b/remoting/base/encoder_zlib.cc index fdf8725..84842ac 100644 --- a/remoting/base/encoder_zlib.cc +++ b/remoting/base/encoder_zlib.cc @@ -48,7 +48,7 @@ void EncoderZlib::EncodeRect(CompressorZlib* compressor, const int bytes_per_pixel = GetBytesPerPixel(capture_data_->pixel_format()); const int row_size = bytes_per_pixel * rect.width(); - ChromotingHostMessage* message = PrepareMessage(&rect); + HostMessage* message = PrepareMessage(&rect); const uint8 * in = capture_data_->data_planes().data[0] + rect.y() * strides + rect.x() * bytes_per_pixel; @@ -107,8 +107,8 @@ void EncoderZlib::EncodeRect(CompressorZlib* compressor, } } -ChromotingHostMessage* EncoderZlib::PrepareMessage(const gfx::Rect* rect) { - ChromotingHostMessage* message = new ChromotingHostMessage(); +HostMessage* EncoderZlib::PrepareMessage(const gfx::Rect* rect) { + HostMessage* message = new HostMessage(); UpdateStreamPacketMessage* packet = message->mutable_update_stream_packet(); // Prepare the begin rect content. @@ -126,8 +126,7 @@ ChromotingHostMessage* EncoderZlib::PrepareMessage(const gfx::Rect* rect) { return message; } -void EncoderZlib::SubmitMessage(ChromotingHostMessage* message, - size_t rect_index) { +void EncoderZlib::SubmitMessage(HostMessage* message, size_t rect_index) { EncodingState state = EncodingInProgress; if (rect_index == 0 && message->update_stream_packet().has_begin_rect()) state |= EncodingStarting; diff --git a/remoting/base/encoder_zlib.h b/remoting/base/encoder_zlib.h index 0c88e7e..476135b 100644 --- a/remoting/base/encoder_zlib.h +++ b/remoting/base/encoder_zlib.h @@ -31,12 +31,12 @@ class EncoderZlib : public Encoder { void EncodeRect(CompressorZlib* compressor, const gfx::Rect& rect, size_t rect_index); - // Create a new ChromotingHostMessage with the right flag and attributes. - // The message can be used immediately for output of encoding. - ChromotingHostMessage* PrepareMessage(const gfx::Rect* rect); + // Create a new HostMessage with the right flag and attributes. The message + // can be used immediately for output of encoding. + HostMessage* PrepareMessage(const gfx::Rect* rect); // Submit |message| to |callback_|. - void SubmitMessage(ChromotingHostMessage* message, size_t rect_index); + void SubmitMessage(HostMessage* message, size_t rect_index); scoped_refptr<CaptureData> capture_data_; scoped_ptr<DataAvailableCallback> callback_; diff --git a/remoting/base/protocol/chromotocol.proto b/remoting/base/protocol/chromotocol.proto index 341b044..d6e587f 100644 --- a/remoting/base/protocol/chromotocol.proto +++ b/remoting/base/protocol/chromotocol.proto @@ -98,7 +98,7 @@ message UpdateStreamPacketMessage { // Defines the message that is sent from the host to the client. // Only one of these messages should be present. // NEXT ID: 5 -message ChromotingHostMessage { +message HostMessage { optional InitClientMessage init_client= 1; optional BeginUpdateStreamMessage begin_update_stream = 2; optional EndUpdateStreamMessage end_update_stream = 3; @@ -161,7 +161,7 @@ message MouseUpEvent { // Defines the message that is sent from the client to the host. // Only one of these messages should be present. // NEXT ID: 7 -message ChromotingClientMessage { +message ClientMessage { optional KeyEvent key_event = 1; optional MouseSetPositionEvent mouse_set_position_event = 2; optional MouseMoveEvent mouse_move_event = 3; diff --git a/remoting/base/protocol_decoder.cc b/remoting/base/protocol_decoder.cc index 0dc8441..3724f5a 100644 --- a/remoting/base/protocol_decoder.cc +++ b/remoting/base/protocol_decoder.cc @@ -18,12 +18,12 @@ ProtocolDecoder::ProtocolDecoder() void ProtocolDecoder::ParseClientMessages(scoped_refptr<media::DataBuffer> data, ClientMessageList* messages) { - ParseMessages<ChromotingClientMessage>(data, messages); + ParseMessages<ClientMessage>(data, messages); } void ProtocolDecoder::ParseHostMessages(scoped_refptr<media::DataBuffer> data, HostMessageList* messages) { - ParseMessages<ChromotingHostMessage>(data, messages); + ParseMessages<HostMessage>(data, messages); } template <typename T> diff --git a/remoting/base/protocol_decoder.h b/remoting/base/protocol_decoder.h index b74da64..119198f 100644 --- a/remoting/base/protocol_decoder.h +++ b/remoting/base/protocol_decoder.h @@ -15,8 +15,8 @@ namespace remoting { -typedef std::vector<ChromotingHostMessage*> HostMessageList; -typedef std::vector<ChromotingClientMessage*> ClientMessageList; +typedef std::vector<HostMessage*> HostMessageList; +typedef std::vector<ClientMessage*> ClientMessageList; // A protocol decoder is used to decode data transmitted in the chromoting // network. diff --git a/remoting/base/protocol_decoder_unittest.cc b/remoting/base/protocol_decoder_unittest.cc index da13a0d..c2473a8 100644 --- a/remoting/base/protocol_decoder_unittest.cc +++ b/remoting/base/protocol_decoder_unittest.cc @@ -16,7 +16,7 @@ static const int kWidth = 640; static const int kHeight = 480; static const std::string kTestData = "Chromoting rockz"; -static void AppendMessage(const ChromotingHostMessage& msg, +static void AppendMessage(const HostMessage& msg, std::string* buffer) { // Contains one encoded message. scoped_refptr<media::DataBuffer> encoded_msg; @@ -31,7 +31,7 @@ static void PrepareData(uint8** buffer, int* size) { std::string encoded_data; // The first message is InitClient. - ChromotingHostMessage msg; + HostMessage msg; msg.mutable_init_client()->set_width(kWidth); msg.mutable_init_client()->set_height(kHeight); AppendMessage(msg, &encoded_data); diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc index 9226186..76f5b0c8 100644 --- a/remoting/client/chromoting_client.cc +++ b/remoting/client/chromoting_client.cc @@ -105,7 +105,7 @@ void ChromotingClient::HandleMessages(HostConnection* conn, } for (size_t i = 0; i < messages->size(); ++i) { - ChromotingHostMessage* msg = (*messages)[i]; + HostMessage* msg = (*messages)[i]; // TODO(ajwong): Consider creating a macro similar to the IPC message // mappings. Also reconsider the lifetime of the message object. if (msg->has_init_client()) { @@ -175,10 +175,10 @@ void ChromotingClient::SetState(State s) { Repaint(); } -void ChromotingClient::InitClient(ChromotingHostMessage* msg) { +void ChromotingClient::InitClient(HostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_init_client()); - scoped_ptr<ChromotingHostMessage> deleter(msg); + scoped_ptr<HostMessage> deleter(msg); // Resize the window. int width = msg->init_client().width(); @@ -191,21 +191,21 @@ void ChromotingClient::InitClient(ChromotingHostMessage* msg) { input_handler_->Initialize(); } -void ChromotingClient::BeginUpdate(ChromotingHostMessage* msg) { +void ChromotingClient::BeginUpdate(HostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_begin_update_stream()); view_->HandleBeginUpdateStream(msg); } -void ChromotingClient::HandleUpdate(ChromotingHostMessage* msg) { +void ChromotingClient::HandleUpdate(HostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_update_stream_packet()); view_->HandleUpdateStreamPacket(msg); } -void ChromotingClient::EndUpdate(ChromotingHostMessage* msg) { +void ChromotingClient::EndUpdate(HostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_end_update_stream()); diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h index c7026e3..bdc2e26 100644 --- a/remoting/client/chromoting_client.h +++ b/remoting/client/chromoting_client.h @@ -65,10 +65,10 @@ class ChromotingClient : public HostConnection::HostEventCallback { void SetState(State s); // Handles for chromotocol messages. - void InitClient(ChromotingHostMessage* msg); - void BeginUpdate(ChromotingHostMessage* msg); - void HandleUpdate(ChromotingHostMessage* msg); - void EndUpdate(ChromotingHostMessage* msg); + void InitClient(HostMessage* msg); + void BeginUpdate(HostMessage* msg); + void HandleUpdate(HostMessage* msg); + void EndUpdate(HostMessage* msg); // The following are not owned by this class. ClientConfig config_; diff --git a/remoting/client/chromoting_view.h b/remoting/client/chromoting_view.h index e094f79..a50b407 100644 --- a/remoting/client/chromoting_view.h +++ b/remoting/client/chromoting_view.h @@ -9,7 +9,7 @@ namespace remoting { -class ChromotingHostMessage; +class HostMessage; // ChromotingView defines the behavior of an object that draws a view of the // remote desktop. Its main function is to choose the right decoder and render @@ -47,13 +47,13 @@ class ChromotingView { virtual void SetHostScreenSize(int width, int height) = 0; // Handle the BeginUpdateStream message. - virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg) = 0; + virtual void HandleBeginUpdateStream(HostMessage* msg) = 0; // Handle the UpdateStreamPacket message. - virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg) = 0; + virtual void HandleUpdateStreamPacket(HostMessage* msg) = 0; // Handle the EndUpdateStream message. - virtual void HandleEndUpdateStream(ChromotingHostMessage* msg) = 0; + virtual void HandleEndUpdateStream(HostMessage* msg) = 0; }; } // namespace remoting diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc index 25c16bf..6715888 100644 --- a/remoting/client/plugin/pepper_view.cc +++ b/remoting/client/plugin/pepper_view.cc @@ -139,7 +139,7 @@ void PepperView::SetHostScreenSize(int width, int height) { backing_store_height_ = height; } -void PepperView::HandleBeginUpdateStream(ChromotingHostMessage* msg) { +void PepperView::HandleBeginUpdateStream(HostMessage* msg) { if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleBeginUpdateStream, @@ -147,7 +147,7 @@ void PepperView::HandleBeginUpdateStream(ChromotingHostMessage* msg) { return; } - scoped_ptr<ChromotingHostMessage> deleter(msg); + scoped_ptr<HostMessage> deleter(msg); // TODO(hclam): Use the information from the message to create the decoder. // We lazily construct the decoder. @@ -169,7 +169,7 @@ void PepperView::HandleBeginUpdateStream(ChromotingHostMessage* msg) { NewRunnableMethod(this, &PepperView::OnDecodeDone)); } -void PepperView::HandleUpdateStreamPacket(ChromotingHostMessage* msg) { +void PepperView::HandleUpdateStreamPacket(HostMessage* msg) { if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleUpdateStreamPacket, @@ -180,7 +180,7 @@ void PepperView::HandleUpdateStreamPacket(ChromotingHostMessage* msg) { decoder_->PartialDecode(msg); } -void PepperView::HandleEndUpdateStream(ChromotingHostMessage* msg) { +void PepperView::HandleEndUpdateStream(HostMessage* msg) { if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleEndUpdateStream, @@ -188,7 +188,7 @@ void PepperView::HandleEndUpdateStream(ChromotingHostMessage* msg) { return; } - scoped_ptr<ChromotingHostMessage> deleter(msg); + scoped_ptr<HostMessage> deleter(msg); decoder_->EndDecode(); } diff --git a/remoting/client/plugin/pepper_view.h b/remoting/client/plugin/pepper_view.h index 7cfa61b..bb4557b 100644 --- a/remoting/client/plugin/pepper_view.h +++ b/remoting/client/plugin/pepper_view.h @@ -44,9 +44,9 @@ class PepperView : public ChromotingView { virtual void UnsetSolidFill(); virtual void SetViewport(int x, int y, int width, int height); virtual void SetHostScreenSize(int width, int height); - virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg); - virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg); - virtual void HandleEndUpdateStream(ChromotingHostMessage* msg); + virtual void HandleBeginUpdateStream(HostMessage* msg); + virtual void HandleUpdateStreamPacket(HostMessage* msg); + virtual void HandleEndUpdateStream(HostMessage* msg); private: void OnPaintDone(); diff --git a/remoting/client/x11_input_handler.cc b/remoting/client/x11_input_handler.cc index 887862c..455ff61 100644 --- a/remoting/client/x11_input_handler.cc +++ b/remoting/client/x11_input_handler.cc @@ -9,8 +9,8 @@ #include "remoting/client/x11_view.h" #include "remoting/jingle_glue/jingle_thread.h" -// Include Xlib at the end because it clashes with Status in -// base/tracked_objects.h. +// Include Xlib at the end because it clashes with ClientMessage defined in +// the protocol buffer. #include <X11/Xlib.h> namespace remoting { diff --git a/remoting/client/x11_view.cc b/remoting/client/x11_view.cc index ff51e9a..b733d93 100644 --- a/remoting/client/x11_view.cc +++ b/remoting/client/x11_view.cc @@ -169,8 +169,8 @@ void X11View::InitPaintTarget() { CHECK(picture_) << "Backing picture not created"; } -void X11View::HandleBeginUpdateStream(ChromotingHostMessage* msg) { - scoped_ptr<ChromotingHostMessage> deleter(msg); +void X11View::HandleBeginUpdateStream(HostMessage* msg) { + scoped_ptr<HostMessage> deleter(msg); // TODO(hclam): Use the information from the message to create the decoder. // We lazily construct the decoder. @@ -184,12 +184,12 @@ void X11View::HandleBeginUpdateStream(ChromotingHostMessage* msg) { NewRunnableMethod(this, &X11View::OnDecodeDone)); } -void X11View::HandleUpdateStreamPacket(ChromotingHostMessage* msg) { +void X11View::HandleUpdateStreamPacket(HostMessage* msg) { decoder_->PartialDecode(msg); } -void X11View::HandleEndUpdateStream(ChromotingHostMessage* msg) { - scoped_ptr<ChromotingHostMessage> deleter(msg); +void X11View::HandleEndUpdateStream(HostMessage* msg) { + scoped_ptr<HostMessage> deleter(msg); decoder_->EndDecode(); } diff --git a/remoting/client/x11_view.h b/remoting/client/x11_view.h index 1f1cc1c5..2825575 100644 --- a/remoting/client/x11_view.h +++ b/remoting/client/x11_view.h @@ -32,9 +32,9 @@ class X11View : public ChromotingView { virtual void UnsetSolidFill(); virtual void SetViewport(int x, int y, int width, int height); virtual void SetHostScreenSize(int width, int height); - virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg); - virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg); - virtual void HandleEndUpdateStream(ChromotingHostMessage* msg) ; + virtual void HandleBeginUpdateStream(HostMessage* msg); + virtual void HandleUpdateStreamPacket(HostMessage* msg); + virtual void HandleEndUpdateStream(HostMessage* msg) ; Display* display() { return display_; } diff --git a/remoting/host/client_connection.cc b/remoting/host/client_connection.cc index b6e8759..6c8516a 100644 --- a/remoting/host/client_connection.cc +++ b/remoting/host/client_connection.cc @@ -38,10 +38,10 @@ ClientConnection::~ClientConnection() { // static scoped_refptr<media::DataBuffer> ClientConnection::CreateWireFormatDataBuffer( - const ChromotingHostMessage* msg) { + const HostMessage* msg) { // TODO(hclam): Instead of serializing |msg| create an DataBuffer // object that wraps around it. - scoped_ptr<const ChromotingHostMessage> message_deleter(msg); + scoped_ptr<const HostMessage> message_deleter(msg); return SerializeAndFrameMessage(*msg); } @@ -53,7 +53,7 @@ void ClientConnection::SendInitClientMessage(int width, int height) { if (!channel_) return; - ChromotingHostMessage msg; + HostMessage msg; msg.mutable_init_client()->set_width(width); msg.mutable_init_client()->set_height(height); DCHECK(msg.IsInitialized()); @@ -67,7 +67,7 @@ void ClientConnection::SendBeginUpdateStreamMessage() { if (!channel_) return; - ChromotingHostMessage msg; + HostMessage msg; msg.mutable_begin_update_stream(); DCHECK(msg.IsInitialized()); @@ -96,7 +96,7 @@ void ClientConnection::SendEndUpdateStreamMessage() { if (!channel_) return; - ChromotingHostMessage msg; + HostMessage msg; msg.mutable_end_update_stream(); DCHECK(msg.IsInitialized()); diff --git a/remoting/host/client_connection.h b/remoting/host/client_connection.h index c139ff0..c03a9bb 100644 --- a/remoting/host/client_connection.h +++ b/remoting/host/client_connection.h @@ -62,11 +62,11 @@ class ClientConnection : public base::RefCountedThreadSafe<ClientConnection>, virtual ~ClientConnection(); - // Creates a DataBuffer object that wraps around ChromotingHostMessage. The - // DataBuffer object will be responsible for serializing and framing the - // message. DataBuffer will also own |msg| after this call. + // 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 ChromotingHostMessage* msg); + const HostMessage* msg); virtual void set_jingle_channel(JingleChannel* channel) { channel_ = channel; @@ -84,11 +84,11 @@ class ClientConnection : public base::RefCountedThreadSafe<ClientConnection>, // 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 ChromotingHostMessage. This is a special case only - // for UpdateStreamPacket to reduce the amount of memory copies. + // 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(ChromotingHostMessage). + // CreateWireFormatDataBuffer(HostMessage). virtual void SendUpdateStreamPacketMessage( scoped_refptr<media::DataBuffer> data); diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc index b8747dd..f2cb3aa 100644 --- a/remoting/host/session_manager.cc +++ b/remoting/host/session_manager.cc @@ -319,7 +319,7 @@ void SessionManager::DoRateControl() { ScheduleNextRateControl(); } -void SessionManager::DoSendUpdate(ChromotingHostMessage* message, +void SessionManager::DoSendUpdate(HostMessage* message, Encoder::EncodingState state) { DCHECK_EQ(network_loop_, MessageLoop::current()); @@ -393,7 +393,7 @@ void SessionManager::DoEncode( } void SessionManager::EncodeDataAvailableTask( - ChromotingHostMessage* message, Encoder::EncodingState state) { + HostMessage* message, Encoder::EncodingState state) { DCHECK_EQ(encode_loop_, MessageLoop::current()); // Before a new encode task starts, notify clients a new update diff --git a/remoting/host/session_manager.h b/remoting/host/session_manager.h index c39ca3b..83c437a 100644 --- a/remoting/host/session_manager.h +++ b/remoting/host/session_manager.h @@ -131,7 +131,7 @@ class SessionManager : public base::RefCountedThreadSafe<SessionManager> { void DoRateControl(); // DoSendUpdate takes ownership of header and is responsible for deleting it. - void DoSendUpdate(ChromotingHostMessage* message, + void DoSendUpdate(HostMessage* message, Encoder::EncodingState state); void DoSendInit(scoped_refptr<ClientConnection> client, int width, int height); @@ -146,7 +146,7 @@ class SessionManager : public base::RefCountedThreadSafe<SessionManager> { // EncodeDataAvailableTask takes ownership of header and is responsible for // deleting it. - void EncodeDataAvailableTask(ChromotingHostMessage* message, + void EncodeDataAvailableTask(HostMessage* message, Encoder::EncodingState state); // Message loops used by this class. diff --git a/remoting/host/session_manager_unittest.cc b/remoting/host/session_manager_unittest.cc index 6747b01..29fa0f8 100644 --- a/remoting/host/session_manager_unittest.cc +++ b/remoting/host/session_manager_unittest.cc @@ -106,7 +106,7 @@ TEST_F(SessionManagerTest, OneRecordCycle) { .WillOnce(RunCallback(update_rects, data)); // Expect the encoder be called. - ChromotingHostMessage* msg = new ChromotingHostMessage(); + HostMessage* msg = new HostMessage(); EXPECT_CALL(*encoder_, Encode(data, false, NotNull())) .WillOnce(FinishEncode(msg)); |