Skip to content

Commit

Permalink
Remove rtc::SocketAddress from PreXmppAuth::StartPreXmppAuth.
Browse files Browse the repository at this point in the history
The end goal is to stop using rtc::SocketAddress in libjingle_xmpp,
it seems that PreXmppAuth::StartPreXmppAuth doesn't use this parameter
so this CL removes it.

It seems that a deeper refactoring is needed, most of the parameters
are unused.

Bug: 919085
Change-Id: I5039296580995303cc0df3a2a89ac75bbc0a669a
Reviewed-on: https://chromium-review.googlesource.com/c/1405322
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621793}
  • Loading branch information
Mirko Bonadei authored and Commit Bot committed Jan 10, 2019
1 parent bb118ea commit 5a0f1a1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion jingle/notifier/base/gaia_token_pre_xmpp_auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ GaiaTokenPreXmppAuth::~GaiaTokenPreXmppAuth() { }

void GaiaTokenPreXmppAuth::StartPreXmppAuth(
const buzz::Jid& jid,
const rtc::SocketAddress& server,
const std::string& pass,
const std::string& auth_mechanism,
const std::string& auth_token) {
Expand Down
1 change: 0 additions & 1 deletion jingle/notifier/base/gaia_token_pre_xmpp_auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth {
// all the methods out as we don't actually do any authentication at
// this point.
void StartPreXmppAuth(const buzz::Jid& jid,
const rtc::SocketAddress& server,
const std::string& pass,
const std::string& auth_mechanism,
const std::string& auth_token) override;
Expand Down
7 changes: 3 additions & 4 deletions jingle/notifier/base/xmpp_connection_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class MockPreXmppAuth : public buzz::PreXmppAuth {
std::string(const std::vector<std::string>&, bool));
MOCK_METHOD1(CreateSaslMechanism,
buzz::SaslMechanism*(const std::string&));
MOCK_METHOD5(StartPreXmppAuth,
MOCK_METHOD4(StartPreXmppAuth,
void(const buzz::Jid&,
const rtc::SocketAddress&,
const std::string&,
const std::string&,
const std::string&));
Expand Down Expand Up @@ -127,7 +126,7 @@ TEST_F(XmppConnectionTest, ImmediateFailure) {
}

TEST_F(XmppConnectionTest, PreAuthFailure) {
EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _,_));
EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _,_));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthDone()).WillOnce(Return(true));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthorized()).WillOnce(Return(false));
EXPECT_CALL(*mock_pre_xmpp_auth_, HadError()).WillOnce(Return(true));
Expand All @@ -148,7 +147,7 @@ TEST_F(XmppConnectionTest, PreAuthFailure) {
}

TEST_F(XmppConnectionTest, FailureAfterPreAuth) {
EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _,_));
EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _,_));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthDone()).WillOnce(Return(true));
EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthorized()).WillOnce(Return(true));
EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthMechanism()).WillOnce(Return(""));
Expand Down
1 change: 0 additions & 1 deletion third_party/libjingle_xmpp/xmpp/prexmppauth.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class PreXmppAuth : public SaslHandler {

virtual void StartPreXmppAuth(
const Jid& jid,
const rtc::SocketAddress& server,
const std::string& pass,
const std::string& auth_mechanism,
const std::string& auth_token) = 0;
Expand Down
2 changes: 1 addition & 1 deletion third_party/libjingle_xmpp/xmpp/xmppclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int XmppClient::ProcessStart() {
if (d_->pre_auth_) {
d_->pre_auth_->SignalAuthDone.connect(this, &XmppClient::OnAuthDone);
d_->pre_auth_->StartPreXmppAuth(
d_->engine_->GetUser(), d_->server_, d_->pass_,
d_->engine_->GetUser(), d_->pass_,
d_->auth_mechanism_, d_->auth_token_);
d_->pass_.clear(); // done with this;
return STATE_PRE_XMPP_LOGIN;
Expand Down

0 comments on commit 5a0f1a1

Please sign in to comment.