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

Unified Diff: remoting/protocol/channel_dispatcher_base.h

Issue 8587053: Remove event_channel() and control_channel() from Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: remoting/protocol/channel_dispatcher_base.h
diff --git a/remoting/protocol/channel_dispatcher_base.h b/remoting/protocol/channel_dispatcher_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..f4d2088a8233a92bb0447d8f8a90ce4b27efcbfb
--- /dev/null
+++ b/remoting/protocol/channel_dispatcher_base.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
+#define REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace net {
+class StreamSocket;
+} // namespace net
+
+namespace remoting {
+namespace protocol {
+
+class Session;
+
+class ChannelDispatcherBase {
Wez 2011/11/17 22:39:41 What is this class used for?
Sergey Ulanov 2011/11/17 23:10:38 Done.
+ public:
+ // The callback is called when initialization is finished. The
+ // parameter is set to true on success.
+ typedef base::Callback<void(bool)> InitializedCallback;
+
+ explicit ChannelDispatcherBase(const char* name);
Wez 2011/11/17 22:39:41 What does |name| refer to?
Sergey Ulanov 2011/11/17 23:10:38 renamed channel_name_
+ virtual ~ChannelDispatcherBase();
+
+ // Initializes the channel the |session|.
Wez 2011/11/17 22:39:41 typo?
Sergey Ulanov 2011/11/17 23:10:38 Done.
+ void Init(Session* session, const InitializedCallback& callback);
+
+ protected:
+ net::StreamSocket* channel() { return channel_.get(); }
+
+ // Following method should be overriden in the child classes.
+ virtual void OnInitialized() = 0;
+
+ private:
+ void OnChannelReady(net::StreamSocket* socket);
+
+ std::string name_;
+ Session* session_;
+ InitializedCallback initialized_callback_;
+ scoped_ptr<net::StreamSocket> channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
« no previous file with comments | « no previous file | remoting/protocol/channel_dispatcher_base.cc » ('j') | remoting/protocol/channel_dispatcher_base.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698