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

Unified Diff: remoting/host/gnubby_connection_factory.cc

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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/gnubby_connection_factory.cc
diff --git a/remoting/host/gnubby_connection_factory.cc b/remoting/host/gnubby_connection_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3d1f6af0a4fe905d9d7890a1743496bcb26c8062
--- /dev/null
+++ b/remoting/host/gnubby_connection_factory.cc
@@ -0,0 +1,58 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/gnubby_connection_factory.h"
+
+#include "base/lazy_instance.h"
+#include "remoting/host/gnubby_auth_handler.h"
+#include "remoting/host/gnubby_connection.h"
+
+namespace remoting {
+
+namespace {
+
+class DefaultGnubbyConnectionFactory : public GnubbyConnectionFactory {
+ public:
+ DefaultGnubbyConnectionFactory();
+ virtual ~DefaultGnubbyConnectionFactory();
+
+ virtual GnubbyConnection* Create(
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
+ GnubbyAuthHandler* auth_handler,
+ int connection_id,
+ net::StreamSocket* socket);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DefaultGnubbyConnectionFactory);
+};
+
+DefaultGnubbyConnectionFactory::DefaultGnubbyConnectionFactory() {}
+
+DefaultGnubbyConnectionFactory::~DefaultGnubbyConnectionFactory() {}
+
+GnubbyConnection* DefaultGnubbyConnectionFactory::Create(
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
+ GnubbyAuthHandler* auth_handler,
+ int connection_id,
+ net::StreamSocket* socket) {
+ return new GnubbyConnection(
+ network_task_runner, auth_handler, connection_id, socket);
+}
+
+} // namespace
+
+// The default GnubbyConnectionFactory instance.
+static base::LazyInstance<DefaultGnubbyConnectionFactory> g_default_factory_ =
+ LAZY_INSTANCE_INITIALIZER;
+
+GnubbyConnectionFactory::GnubbyConnectionFactory() {}
+
+GnubbyConnectionFactory::~GnubbyConnectionFactory() {}
+
+// static
+GnubbyConnectionFactory* GnubbyConnectionFactory::GetDefaultFactory() {
+ return &g_default_factory_.Get();
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698