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

Side by Side Diff: remoting/protocol/message_channel_factory.h

Issue 1662673002: Add MessageChanneFactory interface and use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@framing
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_PROTOCOL_MESSAGE_CHANNEL_FACTORY_H_
6 #define REMOTING_PROTOCOL_MESSAGE_CHANNEL_FACTORY_H_
7
8 #include <string>
9
10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h"
12
13 namespace remoting {
14 namespace protocol {
15
16 class MessagePipe;
17
18 class MessageChannelFactory {
19 public:
20 typedef base::Callback<void(scoped_ptr<MessagePipe>)> ChannelCreatedCallback;
21
22 virtual ~MessageChannelFactory() {}
23
24 // Creates new channels and calls the |callback| when then new channel is
25 // created and connected. Callback may be called synchronously, before the
26 // call returns. If channel channel creation fails the callback is never
Jamie 2016/02/03 02:01:02 Duplicate "channel".
Sergey Ulanov 2016/02/03 20:09:18 Done.
27 // called. All channels must be destroyed, and CancelChannelCreation()
28 // called for any pending channels, before the factory is destroyed.
29 virtual void CreateChannel(const std::string& name,
30 const ChannelCreatedCallback& callback) = 0;
31
32 // Cancels a pending CreateChannel() operation for the named channel. If the
33 // channel creation already completed then canceling it has no effect. When
34 // shutting down this method must be called for each channel pending creation.
35 virtual void CancelChannelCreation(const std::string& name) = 0;
36 };
37
38 } // namespace protocol
39 } // namespace remoting
40
41 #endif // REMOTING_PROTOCOL_MESSAGE_CHANNEL_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698