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

Unified Diff: remoting/signaling/xmpp_signal_strategy.cc

Issue 2798393007: Use SignalingAddress in SignalStrategy insterface. (Closed)
Patch Set: header Created 3 years, 8 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/signaling/xmpp_signal_strategy.h ('k') | remoting/test/protocol_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/signaling/xmpp_signal_strategy.cc
diff --git a/remoting/signaling/xmpp_signal_strategy.cc b/remoting/signaling/xmpp_signal_strategy.cc
index 32ab1002e693430d5ecae2124df51ea99d926180..a493ab1a469bc6f4b6c99954b59166496ef59d1a 100644
--- a/remoting/signaling/xmpp_signal_strategy.cc
+++ b/remoting/signaling/xmpp_signal_strategy.cc
@@ -30,6 +30,7 @@
#include "net/url_request/url_request_context_getter.h"
#include "remoting/base/buffered_socket_writer.h"
#include "remoting/base/logging.h"
+#include "remoting/signaling/signaling_address.h"
#include "remoting/signaling/xmpp_login_handler.h"
#include "remoting/signaling/xmpp_stream_parser.h"
#include "third_party/libjingle_xmpp/xmllite/xmlelement.h"
@@ -67,7 +68,7 @@ class XmppSignalStrategy::Core : public XmppLoginHandler::Delegate {
void Disconnect();
State GetState() const;
Error GetError() const;
- std::string GetLocalJid() const;
+ const SignalingAddress& GetLocalAddress() const;
void AddListener(Listener* listener);
void RemoveListener(Listener* listener);
bool SendStanza(std::unique_ptr<buzz::XmlElement> stanza);
@@ -135,7 +136,7 @@ class XmppSignalStrategy::Core : public XmppLoginHandler::Delegate {
std::unique_ptr<XmppLoginHandler> login_handler_;
std::unique_ptr<XmppStreamParser> stream_parser_;
- std::string jid_;
+ SignalingAddress local_address_;
Error error_ = OK;
@@ -226,9 +227,9 @@ SignalStrategy::Error XmppSignalStrategy::Core::GetError() const {
return error_;
}
-std::string XmppSignalStrategy::Core::GetLocalJid() const {
+const SignalingAddress& XmppSignalStrategy::Core::GetLocalAddress() const {
DCHECK(thread_checker_.CalledOnValidThread());
- return jid_;
+ return local_address_;
}
void XmppSignalStrategy::Core::AddListener(Listener* listener) {
@@ -327,7 +328,7 @@ void XmppSignalStrategy::Core::OnHandshakeDone(
std::unique_ptr<XmppStreamParser> parser) {
DCHECK(thread_checker_.CalledOnValidThread());
- jid_ = jid;
+ local_address_ = SignalingAddress(jid);
stream_parser_ = std::move(parser);
stream_parser_->SetCallbacks(
base::Bind(&Core::OnStanza, base::Unretained(this)),
@@ -532,8 +533,8 @@ SignalStrategy::Error XmppSignalStrategy::GetError() const {
return core_->GetError();
}
-std::string XmppSignalStrategy::GetLocalJid() const {
- return core_->GetLocalJid();
+const SignalingAddress& XmppSignalStrategy::GetLocalAddress() const {
+ return core_->GetLocalAddress();
}
void XmppSignalStrategy::AddListener(Listener* listener) {
« no previous file with comments | « remoting/signaling/xmpp_signal_strategy.h ('k') | remoting/test/protocol_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698