diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 23:44:45 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 23:44:45 +0000 |
commit | c56acf54ff891a942b62effd95fd7a1984533cab (patch) | |
tree | e631a3d707fdd74acc670a54bfc3dac7631524e1 /remoting/host | |
parent | b1308bd418eefc8b1f3410724229c1016a47f01d (diff) | |
download | chromium_src-c56acf54ff891a942b62effd95fd7a1984533cab.zip chromium_src-c56acf54ff891a942b62effd95fd7a1984533cab.tar.gz chromium_src-c56acf54ff891a942b62effd95fd7a1984533cab.tar.bz2 |
Use VideoStub interface on the host side.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/5232004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r-- | remoting/host/session_manager.cc | 7 | ||||
-rw-r--r-- | remoting/host/session_manager_unittest.cc | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc index ebd1061..219c982 100644 --- a/remoting/host/session_manager.cc +++ b/remoting/host/session_manager.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" +#include "base/task.h" #include "remoting/base/capture_data.h" #include "remoting/base/tracer.h" #include "remoting/proto/control.pb.h" @@ -305,7 +306,7 @@ void SessionManager::DoRateControl() { for (size_t i = 0; i < connections_.size(); ++i) { max_pending_update_streams = std::max(max_pending_update_streams, - connections_[i]->GetPendingUpdateStreamMessages()); + connections_[i]->video_stub()->GetPendingPackets()); } // If |slow_down| equals zero, we have no slow down. @@ -336,9 +337,9 @@ void SessionManager::DoSendVideoPacket(VideoPacket* packet) { for (ConnectionToClientList::const_iterator i = connections_.begin(); i < connections_.end(); ++i) { - (*i)->SendVideoPacket(*packet); + (*i)->video_stub()->ProcessVideoPacket( + packet, new DeleteTask<VideoPacket>(packet)); } - delete packet; TraceContext::tracer()->PrintString("DoSendUpdate done"); } diff --git a/remoting/host/session_manager_unittest.cc b/remoting/host/session_manager_unittest.cc index 5c853b28..967d778 100644 --- a/remoting/host/session_manager_unittest.cc +++ b/remoting/host/session_manager_unittest.cc @@ -13,6 +13,7 @@ #include "testing/gtest/include/gtest/gtest.h" using ::remoting::protocol::MockConnectionToClient; +using ::remoting::protocol::MockVideoStub; using ::testing::_; using ::testing::AtLeast; @@ -101,9 +102,13 @@ TEST_F(SessionManagerTest, DISABLED_OneRecordCycle) { EXPECT_CALL(*encoder_, Encode(data, false, NotNull())) .WillOnce(FinishEncode(packet)); + MockVideoStub video_stub; + EXPECT_CALL(*connection_, video_stub()) + .WillRepeatedly(Return(&video_stub)); + // Expect the client be notified. - EXPECT_CALL(*connection_, SendVideoPacket(_)); - EXPECT_CALL(*connection_, GetPendingUpdateStreamMessages()) + EXPECT_CALL(video_stub, ProcessVideoPacket(_, _)); + EXPECT_CALL(video_stub, GetPendingPackets()) .Times(AtLeast(0)) .WillRepeatedly(Return(0)); |