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

Unified Diff: remoting/protocol/fake_session.h

Issue 1531983002: Replace ice_connection_to_client_unittest.cc with connection_unittest.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
Index: remoting/protocol/fake_session.h
diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h
index 658dc194866dcbd20f40bf3742aafaaddd05cd2e..b49cdc291528badbfe52c96eb202f39d8e9b3b1b 100644
--- a/remoting/protocol/fake_session.h
+++ b/remoting/protocol/fake_session.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "remoting/protocol/fake_stream_socket.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/transport.h"
@@ -42,10 +43,10 @@ class FakeSession : public Session {
FakeSession();
~FakeSession() override;
- EventHandler* event_handler() { return event_handler_; }
+ void SimulateConnection(FakeSession* peer);
+ EventHandler* event_handler() { return event_handler_; }
void set_error(ErrorCode error) { error_ = error; }
-
bool is_closed() const { return closed_; }
// Session interface.
@@ -57,15 +58,19 @@ class FakeSession : public Session {
void Close(ErrorCode error) override;
public:
joedow 2015/12/17 17:29:11 not part of your change, but why is public set twi
Sergey Ulanov 2015/12/17 17:36:18 Thanks for catching this!
- EventHandler* event_handler_;
+ EventHandler* event_handler_ = nullptr;
scoped_ptr<SessionConfig> config_;
std::string jid_;
FakeTransport transport_;
- ErrorCode error_;
- bool closed_;
+ ErrorCode error_ = OK;
+ bool closed_ = false;
+
+ base::WeakPtr<FakeSession> peer_;
+
+ base::WeakPtrFactory<FakeSession> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(FakeSession);
};

Powered by Google App Engine
This is Rietveld 408576698