diff options
author | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 23:05:05 +0000 |
---|---|---|
committer | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 23:05:05 +0000 |
commit | 53a4597d56e4ca47d70a0f72901d005f0019aca3 (patch) | |
tree | 794a2e9af105a28cfacf7b9ae77d7852985bd87c /remoting | |
parent | febe94524deeb320646d623cd91ed87e1db67a7b (diff) | |
download | chromium_src-53a4597d56e4ca47d70a0f72901d005f0019aca3.zip chromium_src-53a4597d56e4ca47d70a0f72901d005f0019aca3.tar.gz chromium_src-53a4597d56e4ca47d70a0f72901d005f0019aca3.tar.bz2 |
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
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57112
Review URL: http://codereview.chromium.org/3161034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
31 files changed, 105 insertions, 104 deletions
diff --git a/remoting/base/codec_test.cc b/remoting/base/codec_test.cc index fd4469c..40c42ed 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(HostMessage* message) { + void ReceivedMessage(ChromotingHostMessage* message) { EXPECT_TRUE(message->has_update_stream_packet()); if (state_ == kWaitingForBeginRect) { @@ -162,7 +162,7 @@ class DecoderTester { EXPECT_TRUE(frame_.get()); } - void ReceivedMessage(HostMessage* message) { + void ReceivedMessage(ChromotingHostMessage* message) { if (message->has_update_stream_packet()) { decoder_->PartialDecode(message); return; @@ -265,7 +265,7 @@ class EncoderTester { EXPECT_GT(data_available_, 0); } - void DataAvailable(HostMessage* message, + void DataAvailable(ChromotingHostMessage* 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) { - HostMessage* begin_update = new HostMessage(); + ChromotingHostMessage* begin_update = new ChromotingHostMessage(); begin_update->mutable_begin_update_stream(); decoder_tester_->ReceivedMessage(begin_update); } @@ -284,7 +284,7 @@ class EncoderTester { } if (state & Encoder::EncodingEnded) { - HostMessage* end_update = new HostMessage(); + ChromotingHostMessage* end_update = new ChromotingHostMessage(); end_update->mutable_end_update_stream(); decoder_tester_->ReceivedMessage(end_update); } diff --git a/remoting/base/decoder.h b/remoting/base/decoder.h index eb7f7ed..75ffa03 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(HostMessage) +// 2. PartialDecode(ChromotingHostMessage) // ... // 3. EndDecode() // @@ -57,15 +57,15 @@ class Decoder { Task* partial_decode_done, Task* decode_done) = 0; - // Give a HostMessage that contains the update stream packet that contains - // the encoded data to the decoder. + // Give a ChromotingHostMessage 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. // - // HostMessage returned by this method will contain a + // ChromotingHostMessage returned by this method will contain a // UpdateStreamPacketMessage. // This message will contain either: // 1. UpdateStreamBeginRect @@ -74,7 +74,7 @@ class Decoder { // // See remoting/base/protocol/chromotocol.proto for more information about // these messages. - virtual bool PartialDecode(HostMessage* message) = 0; + virtual bool PartialDecode(ChromotingHostMessage* 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 af4f83b..b944bbc 100644 --- a/remoting/base/decoder_verbatim.cc +++ b/remoting/base/decoder_verbatim.cc @@ -42,8 +42,8 @@ bool DecoderVerbatim::BeginDecode(scoped_refptr<media::VideoFrame> frame, return true; } -bool DecoderVerbatim::PartialDecode(HostMessage* message) { - scoped_ptr<HostMessage> msg_deleter(message); +bool DecoderVerbatim::PartialDecode(ChromotingHostMessage* message) { + scoped_ptr<ChromotingHostMessage> msg_deleter(message); DCHECK(message->has_update_stream_packet()); DCHECK(started_); @@ -70,7 +70,7 @@ void DecoderVerbatim::EndDecode() { started_ = false; } -bool DecoderVerbatim::HandleBeginRect(HostMessage* message) { +bool DecoderVerbatim::HandleBeginRect(ChromotingHostMessage* message) { DCHECK_EQ(kWaitingForBeginRect, state_); state_ = kWaitingForRectData; @@ -94,7 +94,7 @@ bool DecoderVerbatim::HandleBeginRect(HostMessage* message) { return true; } -bool DecoderVerbatim::HandleRectData(HostMessage* message) { +bool DecoderVerbatim::HandleRectData(ChromotingHostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); DCHECK_EQ(0, message->update_stream_packet().rect_data().sequence_number()); @@ -126,7 +126,7 @@ bool DecoderVerbatim::HandleRectData(HostMessage* message) { return true; } -bool DecoderVerbatim::HandleEndRect(HostMessage* message) { +bool DecoderVerbatim::HandleEndRect(ChromotingHostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); state_ = kWaitingForBeginRect; return true; diff --git a/remoting/base/decoder_verbatim.h b/remoting/base/decoder_verbatim.h index 22543f9..67b6cfa 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(HostMessage* message); + virtual bool PartialDecode(ChromotingHostMessage* message); virtual void EndDecode(); void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } private: - bool HandleBeginRect(HostMessage* message); - bool HandleRectData(HostMessage* message); - bool HandleEndRect(HostMessage* message); + bool HandleBeginRect(ChromotingHostMessage* message); + bool HandleRectData(ChromotingHostMessage* message); + bool HandleEndRect(ChromotingHostMessage* 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 947750a..8c00d76 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<HostMessage> msg(new HostMessage()); + scoped_ptr<ChromotingHostMessage> msg(new ChromotingHostMessage()); // Prepare the begin rect message. UpdateStreamBeginRect* begin_rect = diff --git a/remoting/base/decoder_zlib.cc b/remoting/base/decoder_zlib.cc index 43a5fe2..8aabfbc 100644 --- a/remoting/base/decoder_zlib.cc +++ b/remoting/base/decoder_zlib.cc @@ -53,8 +53,8 @@ bool DecoderZlib::BeginDecode(scoped_refptr<media::VideoFrame> frame, return true; } -bool DecoderZlib::PartialDecode(HostMessage* message) { - scoped_ptr<HostMessage> msg_deleter(message); +bool DecoderZlib::PartialDecode(ChromotingHostMessage* message) { + scoped_ptr<ChromotingHostMessage> msg_deleter(message); DCHECK(message->has_update_stream_packet()); DCHECK(started_); @@ -82,7 +82,7 @@ void DecoderZlib::EndDecode() { started_ = false; } -bool DecoderZlib::HandleBeginRect(HostMessage* message) { +bool DecoderZlib::HandleBeginRect(ChromotingHostMessage* message) { DCHECK_EQ(kWaitingForBeginRect, state_); state_ = kWaitingForRectData; @@ -108,7 +108,7 @@ bool DecoderZlib::HandleBeginRect(HostMessage* message) { return true; } -bool DecoderZlib::HandleRectData(HostMessage* message) { +bool DecoderZlib::HandleRectData(ChromotingHostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); DCHECK_EQ(0, message->update_stream_packet().rect_data().sequence_number()); @@ -153,7 +153,7 @@ bool DecoderZlib::HandleRectData(HostMessage* message) { return true; } -bool DecoderZlib::HandleEndRect(HostMessage* message) { +bool DecoderZlib::HandleEndRect(ChromotingHostMessage* message) { DCHECK_EQ(kWaitingForRectData, state_); state_ = kWaitingForBeginRect; diff --git a/remoting/base/decoder_zlib.h b/remoting/base/decoder_zlib.h index 05f8a99..ee897ab 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(HostMessage* message); + virtual bool PartialDecode(ChromotingHostMessage* 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(HostMessage* message); - bool HandleRectData(HostMessage* message); - bool HandleEndRect(HostMessage* message); + bool HandleBeginRect(ChromotingHostMessage* message); + bool HandleRectData(ChromotingHostMessage* message); + bool HandleEndRect(ChromotingHostMessage* message); // The internal state of the decoder. State state_; diff --git a/remoting/base/encoder.h b/remoting/base/encoder.h index 0c1fd50f..4d2cf85 100644 --- a/remoting/base/encoder.h +++ b/remoting/base/encoder.h @@ -17,7 +17,6 @@ namespace media { namespace remoting { class CaptureData; -class HostMessage; // A class to perform the task of encoding a continous stream of // images. @@ -40,7 +39,8 @@ 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<HostMessage*, EncodingState>::Type DataAvailableCallback; + typedef Callback2<ChromotingHostMessage*, + EncodingState>::Type DataAvailableCallback; virtual ~Encoder() {} diff --git a/remoting/base/encoder_verbatim.cc b/remoting/base/encoder_verbatim.cc index 6a5a7d6..d3821d7 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; - HostMessage* msg = new HostMessage(); + ChromotingHostMessage* msg = new ChromotingHostMessage(); 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 84842ac..fdf8725 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(); - HostMessage* message = PrepareMessage(&rect); + ChromotingHostMessage* 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, } } -HostMessage* EncoderZlib::PrepareMessage(const gfx::Rect* rect) { - HostMessage* message = new HostMessage(); +ChromotingHostMessage* EncoderZlib::PrepareMessage(const gfx::Rect* rect) { + ChromotingHostMessage* message = new ChromotingHostMessage(); UpdateStreamPacketMessage* packet = message->mutable_update_stream_packet(); // Prepare the begin rect content. @@ -126,7 +126,8 @@ HostMessage* EncoderZlib::PrepareMessage(const gfx::Rect* rect) { return message; } -void EncoderZlib::SubmitMessage(HostMessage* message, size_t rect_index) { +void EncoderZlib::SubmitMessage(ChromotingHostMessage* 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 476135b..0c88e7e 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 HostMessage with the right flag and attributes. The message - // can be used immediately for output of encoding. - HostMessage* PrepareMessage(const gfx::Rect* rect); + // 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); // Submit |message| to |callback_|. - void SubmitMessage(HostMessage* message, size_t rect_index); + void SubmitMessage(ChromotingHostMessage* 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 df510d9..f2752d9 100644 --- a/remoting/base/protocol/chromotocol.proto +++ b/remoting/base/protocol/chromotocol.proto @@ -99,7 +99,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 HostMessage { +message ChromotingHostMessage { optional InitClientMessage init_client= 1; optional BeginUpdateStreamMessage begin_update_stream = 2; optional EndUpdateStreamMessage end_update_stream = 3; @@ -162,7 +162,7 @@ message MouseUpEvent { // Defines the message that is sent from the client to the host. // Only one of the optional messages should be present. // NEXT ID: 7 -message ClientMessage { +message ChromotingClientMessage { 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 3724f5a..0dc8441 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<ClientMessage>(data, messages); + ParseMessages<ChromotingClientMessage>(data, messages); } void ProtocolDecoder::ParseHostMessages(scoped_refptr<media::DataBuffer> data, HostMessageList* messages) { - ParseMessages<HostMessage>(data, messages); + ParseMessages<ChromotingHostMessage>(data, messages); } template <typename T> diff --git a/remoting/base/protocol_decoder.h b/remoting/base/protocol_decoder.h index 119198f..b74da64 100644 --- a/remoting/base/protocol_decoder.h +++ b/remoting/base/protocol_decoder.h @@ -15,8 +15,8 @@ namespace remoting { -typedef std::vector<HostMessage*> HostMessageList; -typedef std::vector<ClientMessage*> ClientMessageList; +typedef std::vector<ChromotingHostMessage*> HostMessageList; +typedef std::vector<ChromotingClientMessage*> 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 c2473a8..da13a0d 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 HostMessage& msg, +static void AppendMessage(const ChromotingHostMessage& 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. - HostMessage msg; + ChromotingHostMessage 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 76f5b0c8..9226186 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) { - HostMessage* msg = (*messages)[i]; + ChromotingHostMessage* 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(HostMessage* msg) { +void ChromotingClient::InitClient(ChromotingHostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_init_client()); - scoped_ptr<HostMessage> deleter(msg); + scoped_ptr<ChromotingHostMessage> deleter(msg); // Resize the window. int width = msg->init_client().width(); @@ -191,21 +191,21 @@ void ChromotingClient::InitClient(HostMessage* msg) { input_handler_->Initialize(); } -void ChromotingClient::BeginUpdate(HostMessage* msg) { +void ChromotingClient::BeginUpdate(ChromotingHostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_begin_update_stream()); view_->HandleBeginUpdateStream(msg); } -void ChromotingClient::HandleUpdate(HostMessage* msg) { +void ChromotingClient::HandleUpdate(ChromotingHostMessage* msg) { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK(msg->has_update_stream_packet()); view_->HandleUpdateStreamPacket(msg); } -void ChromotingClient::EndUpdate(HostMessage* msg) { +void ChromotingClient::EndUpdate(ChromotingHostMessage* 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 bdc2e26..c7026e3 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(HostMessage* msg); - void BeginUpdate(HostMessage* msg); - void HandleUpdate(HostMessage* msg); - void EndUpdate(HostMessage* msg); + void InitClient(ChromotingHostMessage* msg); + void BeginUpdate(ChromotingHostMessage* msg); + void HandleUpdate(ChromotingHostMessage* msg); + void EndUpdate(ChromotingHostMessage* msg); // The following are not owned by this class. ClientConfig config_; diff --git a/remoting/client/chromoting_view.cc b/remoting/client/chromoting_view.cc index 9bc1a8a..f985669 100644 --- a/remoting/client/chromoting_view.cc +++ b/remoting/client/chromoting_view.cc @@ -75,7 +75,7 @@ bool ChromotingView::BeginDecoding(Task* partial_decode_done, return true; } -bool ChromotingView::Decode(HostMessage* msg) { +bool ChromotingView::Decode(ChromotingHostMessage* msg) { if (!decoder_->IsStarted()) { LOG(ERROR) << "Attempt to decode payload before calling BeginDecode."; return false; diff --git a/remoting/client/chromoting_view.h b/remoting/client/chromoting_view.h index 051fd7b..0f19c09 100644 --- a/remoting/client/chromoting_view.h +++ b/remoting/client/chromoting_view.h @@ -51,7 +51,7 @@ class ChromotingView { // (1) Perform any platform-specific tasks for start of update stream. // (2) Make sure the |frame_| has been initialized. // (3) Delete the HostMessage. - virtual void HandleBeginUpdateStream(HostMessage* msg) = 0; + virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg) = 0; // Handle the UpdateStreamPacket message. // This method should perform the following tasks: @@ -66,14 +66,14 @@ class ChromotingView { // * For a given begin/end update stream, the encodings specified in the // update packets must all match. We may revisit this constraint at a // later date. - virtual void HandleUpdateStreamPacket(HostMessage* msg) = 0; + virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg) = 0; // Handle the EndUpdateStream message. // This method should perform the following tasks: // (1) Call EndDecoding(). // (2) Perform any platform-specific tasks for end of update stream. // (3) Delete the HostMessage. - virtual void HandleEndUpdateStream(HostMessage* msg) = 0; + virtual void HandleEndUpdateStream(ChromotingHostMessage* msg) = 0; protected: // Setup the decoder based on the given encoding. @@ -87,7 +87,7 @@ class ChromotingView { // Decode the given message. // BeginDecoding() must be called before any calls to Decode(). - bool Decode(HostMessage* msg); + bool Decode(ChromotingHostMessage* msg); // Finish decoding and send notifications to update the view. bool EndDecoding(); diff --git a/remoting/client/chromoting_view_unittest.cc b/remoting/client/chromoting_view_unittest.cc index 96d97ed..1856891 100644 --- a/remoting/client/chromoting_view_unittest.cc +++ b/remoting/client/chromoting_view_unittest.cc @@ -22,7 +22,7 @@ class MockDecoder : public Decoder { UpdatedRects* updated_rects, Task* partial_decode_done, Task* decode_done)); - MOCK_METHOD1(PartialDecode, bool(HostMessage* message)); + MOCK_METHOD1(PartialDecode, bool(ChromotingHostMessage* message)); MOCK_METHOD0(EndDecode, void()); MOCK_METHOD0(Encoding, UpdateStreamEncoding()); @@ -46,9 +46,9 @@ class FakeView : public ChromotingView { frame_height_ = height; } void SetHostScreenSize(int width, int height) {} - void HandleBeginUpdateStream(HostMessage* msg) {} - void HandleUpdateStreamPacket(HostMessage* msg) {} - void HandleEndUpdateStream(HostMessage* msg) {} + void HandleBeginUpdateStream(ChromotingHostMessage* msg) {} + void HandleUpdateStreamPacket(ChromotingHostMessage* msg) {} + void HandleEndUpdateStream(ChromotingHostMessage* msg) {} public: // Testing accessors. @@ -68,7 +68,7 @@ class FakeView : public ChromotingView { bool begin_decoding(Task* partial_decode_done, Task* decode_done) { return BeginDecoding(partial_decode_done, decode_done); } - bool decode(HostMessage* msg) { + bool decode(ChromotingHostMessage* msg) { return Decode(msg); } bool end_decoding() { diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc index 86b70fc..ab631a8 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) { frame_ = NULL; } -void PepperView::HandleBeginUpdateStream(HostMessage* msg) { +void PepperView::HandleBeginUpdateStream(ChromotingHostMessage* msg) { if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleBeginUpdateStream, @@ -147,7 +147,7 @@ void PepperView::HandleBeginUpdateStream(HostMessage* msg) { return; } - scoped_ptr<HostMessage> deleter(msg); + scoped_ptr<ChromotingHostMessage> deleter(msg); // Make sure the |frame_| is initialized. if (!frame_) { @@ -159,7 +159,7 @@ void PepperView::HandleBeginUpdateStream(HostMessage* msg) { } } -void PepperView::HandleUpdateStreamPacket(HostMessage* msg) { +void PepperView::HandleUpdateStreamPacket(ChromotingHostMessage* msg) { if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleUpdateStreamPacket, @@ -177,7 +177,7 @@ void PepperView::HandleUpdateStreamPacket(HostMessage* msg) { Decode(msg); } -void PepperView::HandleEndUpdateStream(HostMessage* msg) { +void PepperView::HandleEndUpdateStream(ChromotingHostMessage* msg) { if (!instance_->CurrentlyOnPluginThread()) { RunTaskOnPluginThread( NewRunnableMethod(this, &PepperView::HandleEndUpdateStream, @@ -185,7 +185,7 @@ void PepperView::HandleEndUpdateStream(HostMessage* msg) { return; } - scoped_ptr<HostMessage> deleter(msg); + scoped_ptr<ChromotingHostMessage> deleter(msg); EndDecoding(); } diff --git a/remoting/client/plugin/pepper_view.h b/remoting/client/plugin/pepper_view.h index d134207..5e12dce 100644 --- a/remoting/client/plugin/pepper_view.h +++ b/remoting/client/plugin/pepper_view.h @@ -42,9 +42,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(HostMessage* msg); - virtual void HandleUpdateStreamPacket(HostMessage* msg); - virtual void HandleEndUpdateStream(HostMessage* msg); + virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg); + virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg); + virtual void HandleEndUpdateStream(ChromotingHostMessage* msg); private: void OnPaintDone(); diff --git a/remoting/client/x11_input_handler.cc b/remoting/client/x11_input_handler.cc index 455ff61..887862c 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 ClientMessage defined in -// the protocol buffer. +// Include Xlib at the end because it clashes with Status in +// base/tracked_objects.h. #include <X11/Xlib.h> namespace remoting { diff --git a/remoting/client/x11_view.cc b/remoting/client/x11_view.cc index 267ae336..e40891a 100644 --- a/remoting/client/x11_view.cc +++ b/remoting/client/x11_view.cc @@ -157,8 +157,8 @@ void X11View::InitPaintTarget() { CHECK(picture_) << "Backing picture not created"; } -void X11View::HandleBeginUpdateStream(HostMessage* msg) { - scoped_ptr<HostMessage> deleter(msg); +void X11View::HandleBeginUpdateStream(ChromotingHostMessage* msg) { + scoped_ptr<ChromotingHostMessage> deleter(msg); // Make sure the |frame_| is initialized. if (!frame_) { @@ -170,7 +170,7 @@ void X11View::HandleBeginUpdateStream(HostMessage* msg) { } } -void X11View::HandleUpdateStreamPacket(HostMessage* msg) { +void X11View::HandleUpdateStreamPacket(ChromotingHostMessage* msg) { // Lazily initialize the decoder. SetupDecoder(msg->update_stream_packet().begin_rect().encoding()); if (!decoder_->IsStarted()) { @@ -181,8 +181,8 @@ void X11View::HandleUpdateStreamPacket(HostMessage* msg) { Decode(msg); } -void X11View::HandleEndUpdateStream(HostMessage* msg) { - scoped_ptr<HostMessage> deleter(msg); +void X11View::HandleEndUpdateStream(ChromotingHostMessage* msg) { + scoped_ptr<ChromotingHostMessage> deleter(msg); EndDecoding(); } diff --git a/remoting/client/x11_view.h b/remoting/client/x11_view.h index d2a52d5..3ae7f2a 100644 --- a/remoting/client/x11_view.h +++ b/remoting/client/x11_view.h @@ -29,9 +29,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(HostMessage* msg); - virtual void HandleUpdateStreamPacket(HostMessage* msg); - virtual void HandleEndUpdateStream(HostMessage* msg); + virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg); + virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg); + virtual void HandleEndUpdateStream(ChromotingHostMessage* msg); Display* display() { return display_; } diff --git a/remoting/host/client_connection.cc b/remoting/host/client_connection.cc index 6c8516a..b6e8759 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 HostMessage* msg) { + const ChromotingHostMessage* msg) { // TODO(hclam): Instead of serializing |msg| create an DataBuffer // object that wraps around it. - scoped_ptr<const HostMessage> message_deleter(msg); + scoped_ptr<const ChromotingHostMessage> message_deleter(msg); return SerializeAndFrameMessage(*msg); } @@ -53,7 +53,7 @@ void ClientConnection::SendInitClientMessage(int width, int height) { if (!channel_) return; - HostMessage msg; + ChromotingHostMessage 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; - HostMessage msg; + ChromotingHostMessage msg; msg.mutable_begin_update_stream(); DCHECK(msg.IsInitialized()); @@ -96,7 +96,7 @@ void ClientConnection::SendEndUpdateStreamMessage() { if (!channel_) return; - HostMessage msg; + ChromotingHostMessage msg; msg.mutable_end_update_stream(); DCHECK(msg.IsInitialized()); diff --git a/remoting/host/client_connection.h b/remoting/host/client_connection.h index c03a9bb..c139ff0 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 HostMessage. 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 ChromotingHostMessage. 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); + const ChromotingHostMessage* 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 HostMessage. This is a special case only for - // UpdateStreamPacket to reduce the amount of memory copies. + // and serialized from a ChromotingHostMessage. This is a special case only + // for UpdateStreamPacket to reduce the amount of memory copies. // // |data| should be created by calling to - // CreateWireFormatDataBuffer(HostMessage). + // CreateWireFormatDataBuffer(ChromotingHostMessage). virtual void SendUpdateStreamPacketMessage( scoped_refptr<media::DataBuffer> data); diff --git a/remoting/host/event_executor_win.cc b/remoting/host/event_executor_win.cc index de82a5a..258389e 100644 --- a/remoting/host/event_executor_win.cc +++ b/remoting/host/event_executor_win.cc @@ -355,7 +355,7 @@ EventExecutorWin::~EventExecutorWin() { void EventExecutorWin::HandleInputEvents(ClientMessageList* messages) { for (size_t i = 0; i < messages->size(); ++i) { - ClientMessage* msg = (*messages)[i]; + ChromotingClientMessage* msg = (*messages)[i]; if (msg->has_mouse_set_position_event()) { mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, static_cast<int>((msg->mouse_set_position_event().x() * 65535)), diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc index f2cb3aa..b8747dd 100644 --- a/remoting/host/session_manager.cc +++ b/remoting/host/session_manager.cc @@ -319,7 +319,7 @@ void SessionManager::DoRateControl() { ScheduleNextRateControl(); } -void SessionManager::DoSendUpdate(HostMessage* message, +void SessionManager::DoSendUpdate(ChromotingHostMessage* message, Encoder::EncodingState state) { DCHECK_EQ(network_loop_, MessageLoop::current()); @@ -393,7 +393,7 @@ void SessionManager::DoEncode( } void SessionManager::EncodeDataAvailableTask( - HostMessage* message, Encoder::EncodingState state) { + ChromotingHostMessage* 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 83c437a..c39ca3b 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(HostMessage* message, + void DoSendUpdate(ChromotingHostMessage* 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(HostMessage* message, + void EncodeDataAvailableTask(ChromotingHostMessage* 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 29fa0f8..6747b01 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. - HostMessage* msg = new HostMessage(); + ChromotingHostMessage* msg = new ChromotingHostMessage(); EXPECT_CALL(*encoder_, Encode(data, false, NotNull())) .WillOnce(FinishEncode(msg)); |