| Index: remoting/client/plugin/chromoting_instance.cc
|
| diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
|
| index 73210471bce3001c9e17e91e7f33c16ec55c9b59..9e8c291fe6f3dbc5fb8312bfcb497b1dd15a97d9 100644
|
| --- a/remoting/client/plugin/chromoting_instance.cc
|
| +++ b/remoting/client/plugin/chromoting_instance.cc
|
| @@ -438,26 +438,29 @@ void ChromotingInstance::OnVideoSize(const webrtc::DesktopSize& size,
|
| PostLegacyJsonMessage("onDesktopSize", data.Pass());
|
| }
|
|
|
| -void ChromotingInstance::OnVideoShape(const webrtc::DesktopRegion& shape) {
|
| - if (desktop_shape_ && shape.Equals(*desktop_shape_))
|
| +void ChromotingInstance::OnVideoShape(const webrtc::DesktopRegion* shape) {
|
| + if ((shape && desktop_shape_ && shape->Equals(*desktop_shape_)) ||
|
| + (!shape && !desktop_shape_)) {
|
| return;
|
| + }
|
|
|
| - desktop_shape_.reset(new webrtc::DesktopRegion(shape));
|
| -
|
| - scoped_ptr<base::ListValue> rects_value(new base::ListValue());
|
| - for (webrtc::DesktopRegion::Iterator i(shape); !i.IsAtEnd(); i.Advance()) {
|
| - const webrtc::DesktopRect& rect = i.rect();
|
| - scoped_ptr<base::ListValue> rect_value(new base::ListValue());
|
| - rect_value->AppendInteger(rect.left());
|
| - rect_value->AppendInteger(rect.top());
|
| - rect_value->AppendInteger(rect.width());
|
| - rect_value->AppendInteger(rect.height());
|
| - rects_value->Append(rect_value.release());
|
| + scoped_ptr<base::DictionaryValue> shape_message(new base::DictionaryValue());
|
| + if (shape) {
|
| + desktop_shape_ = make_scoped_ptr(new webrtc::DesktopRegion(*shape));
|
| + scoped_ptr<base::ListValue> rects_value(new base::ListValue());
|
| + for (webrtc::DesktopRegion::Iterator i(*shape); !i.IsAtEnd(); i.Advance()) {
|
| + const webrtc::DesktopRect& rect = i.rect();
|
| + scoped_ptr<base::ListValue> rect_value(new base::ListValue());
|
| + rect_value->AppendInteger(rect.left());
|
| + rect_value->AppendInteger(rect.top());
|
| + rect_value->AppendInteger(rect.width());
|
| + rect_value->AppendInteger(rect.height());
|
| + rects_value->Append(rect_value.release());
|
| + }
|
| + shape_message->Set("rects", rects_value.release());
|
| }
|
|
|
| - scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
|
| - data->Set("rects", rects_value.release());
|
| - PostLegacyJsonMessage("onDesktopShape", data.Pass());
|
| + PostLegacyJsonMessage("onDesktopShape", shape_message.Pass());
|
| }
|
|
|
| void ChromotingInstance::OnVideoFrameDirtyRegion(
|
|
|