Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2081)

Unified Diff: remoting/protocol/protobuf_video_reader.cc

Issue 7604021: Revert 96089 - Remove video_channel() from Session interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/protobuf_video_reader.cc
===================================================================
--- remoting/protocol/protobuf_video_reader.cc (revision 96105)
+++ remoting/protocol/protobuf_video_reader.cc (working copy)
@@ -4,10 +4,7 @@
#include "remoting/protocol/protobuf_video_reader.h"
-#include "base/bind.h"
#include "base/task.h"
-#include "net/socket/stream_socket.h"
-#include "remoting/base/constants.h"
#include "remoting/proto/video.pb.h"
#include "remoting/protocol/session.h"
@@ -22,30 +19,13 @@
ProtobufVideoReader::~ProtobufVideoReader() { }
void ProtobufVideoReader::Init(protocol::Session* session,
- VideoStub* video_stub,
- const InitializedCallback& callback) {
- initialized_callback_ = callback;
+ VideoStub* video_stub) {
+ reader_.Init(
+ session->video_channel(),
+ NewCallback(this, &ProtobufVideoReader::OnNewData));
video_stub_ = video_stub;
-
- session->CreateStreamChannel(
- kVideoChannelName,
- base::Bind(&ProtobufVideoReader::OnChannelReady, base::Unretained(this)));
}
-void ProtobufVideoReader::OnChannelReady(const std::string& name,
- net::StreamSocket* socket) {
- DCHECK_EQ(name, std::string(kVideoChannelName));
- if (!socket) {
- initialized_callback_.Run(false);
- return;
- }
-
- DCHECK(!channel_.get());
- channel_.reset(socket);
- reader_.Init(socket, NewCallback(this, &ProtobufVideoReader::OnNewData));
- initialized_callback_.Run(true);
-}
-
void ProtobufVideoReader::OnNewData(VideoPacket* packet, Task* done_task) {
video_stub_->ProcessVideoPacket(packet, done_task);
}
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698