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

Unified Diff: remoting/host/security_key/gnubby_extension_session.cc

Issue 2085353004: Update GnubbyAuthHandler to use the current session ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host_extension
Patch Set: Fixing a non-windows build break and some additional cleanup Created 4 years, 6 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
Index: remoting/host/security_key/gnubby_extension_session.cc
diff --git a/remoting/host/security_key/gnubby_extension_session.cc b/remoting/host/security_key/gnubby_extension_session.cc
index 494c9aba96ec2fcbb150f8657bd9e5e9520c8b01..2b7ad954e45cb79e92265e7a5e01d0a6915782d0 100644
--- a/remoting/host/security_key/gnubby_extension_session.cc
+++ b/remoting/host/security_key/gnubby_extension_session.cc
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/values.h"
#include "remoting/base/logging.h"
+#include "remoting/host/client_session_details.h"
#include "remoting/host/security_key/gnubby_auth_handler.h"
#include "remoting/proto/control.pb.h"
#include "remoting/protocol/client_stub.h"
@@ -60,12 +61,18 @@ bool ConvertListValueToString(base::ListValue* bytes, std::string* out) {
namespace remoting {
GnubbyExtensionSession::GnubbyExtensionSession(
+ ClientSessionDetails* client_session_details,
protocol::ClientStub* client_stub)
- : client_stub_(client_stub) {
+ : client_stub_(client_stub),
+ client_session_details_(client_session_details) {
DCHECK(client_stub_);
+ DCHECK(client_session_details_);
- gnubby_auth_handler_ = remoting::GnubbyAuthHandler::Create(base::Bind(
- &GnubbyExtensionSession::SendMessageToClient, base::Unretained(this)));
+ gnubby_auth_handler_ = remoting::GnubbyAuthHandler::Create(
+ base::Bind(&GnubbyExtensionSession::SendMessageToClient,
+ base::Unretained(this)),
+ base::Bind(&GnubbyExtensionSession::GetDesktopSessionId,
+ base::Unretained(this)));
}
GnubbyExtensionSession::~GnubbyExtensionSession() {}
@@ -195,6 +202,10 @@ void GnubbyExtensionSession::SendMessageToClient(
client_stub_->DeliverHostMessage(message);
}
+uint32_t GnubbyExtensionSession::GetDesktopSessionId() const {
+ return client_session_details_->desktop_session_id();
+}
+
void GnubbyExtensionSession::SetGnubbyAuthHandlerForTesting(
std::unique_ptr<GnubbyAuthHandler> gnubby_auth_handler) {
DCHECK(gnubby_auth_handler);
@@ -202,6 +213,8 @@ void GnubbyExtensionSession::SetGnubbyAuthHandlerForTesting(
gnubby_auth_handler_ = std::move(gnubby_auth_handler);
gnubby_auth_handler_->SetSendMessageCallback(base::Bind(
&GnubbyExtensionSession::SendMessageToClient, base::Unretained(this)));
+ gnubby_auth_handler_->SetSessionIdCallback(base::Bind(
+ &GnubbyExtensionSession::GetDesktopSessionId, base::Unretained(this)));
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698