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

Unified Diff: remoting/protocol/fake_session.h

Issue 1545743002: Move ownership of Transport out of Session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass_client
Patch Set: Created 5 years 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/fake_connection_to_host.cc ('k') | remoting/protocol/fake_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_session.h
diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h
index ef0aea46cb46536db10b8b5c8b88ec71e250fd2c..5717a971098bf5094f6963de7c8e4710cee8b0e4 100644
--- a/remoting/protocol/fake_session.h
+++ b/remoting/protocol/fake_session.h
@@ -21,24 +21,8 @@ namespace protocol {
extern const char kTestJid[];
-class FakeTransport : public Transport {
- public:
- FakeTransport();
- ~FakeTransport() override;
-
- // Transport interface.
- void Start(EventHandler* event_handler,
- Authenticator* authenticator) override;
- bool ProcessTransportInfo(buzz::XmlElement* transport_info) override;
- FakeStreamChannelFactory* GetStreamChannelFactory() override;
- FakeStreamChannelFactory* GetMultiplexedChannelFactory() override;
-
- private:
- FakeStreamChannelFactory channel_factory_;
-};
+class FakeAuthenticator;
-// FakeSession is a dummy protocol::Session that uses FakeStreamSocket for all
-// channels.
class FakeSession : public Session {
public:
FakeSession();
@@ -55,16 +39,20 @@ class FakeSession : public Session {
ErrorCode error() override;
const std::string& jid() override;
const SessionConfig& config() override;
- FakeTransport* GetTransport() override;
+ void SetTransport(Transport* transport) override;
void Close(ErrorCode error) override;
private:
+ // Callback provided to the |transport_|.
+ void SendTransportInfo(scoped_ptr<buzz::XmlElement> transport_info);
+
EventHandler* event_handler_ = nullptr;
scoped_ptr<SessionConfig> config_;
std::string jid_;
- FakeTransport transport_;
+ scoped_ptr<FakeAuthenticator> authenticator_;
+ Transport* transport_;
ErrorCode error_ = OK;
bool closed_ = false;
« no previous file with comments | « remoting/protocol/fake_connection_to_host.cc ('k') | remoting/protocol/fake_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698