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

Unified Diff: components/cryptauth/secure_channel.h

Issue 2800883003: [CrOS Tether] Update SecureChannel and BleConnectionManager to use CryptAuthService instead of a Del (Closed)
Patch Set: Added BleConnectionManager refactor as well. 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 | « components/cryptauth/fake_secure_channel.cc ('k') | components/cryptauth/secure_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cryptauth/secure_channel.h
diff --git a/components/cryptauth/secure_channel.h b/components/cryptauth/secure_channel.h
index 3732f242ed6f4822cb7dd27883d787d5d564209e..e0d83b2f85327c08df09262c690192f1411e0ae5 100644
--- a/components/cryptauth/secure_channel.h
+++ b/components/cryptauth/secure_channel.h
@@ -19,6 +19,8 @@
namespace cryptauth {
+class CryptAuthService;
+
// An authenticated bi-directional channel for exchanging messages with remote
// devices. |SecureChannel| manages a |Connection| by initializing it and
// authenticating it via a security handshake once the connection has occurred.
@@ -59,26 +61,18 @@ class SecureChannel : public ConnectionObserver {
const std::string& payload) = 0;
};
- class Delegate {
- public:
- virtual ~Delegate();
-
- virtual std::unique_ptr<SecureMessageDelegate>
- CreateSecureMessageDelegate() = 0;
- };
-
class Factory {
public:
static std::unique_ptr<SecureChannel> NewInstance(
std::unique_ptr<Connection> connection,
- std::unique_ptr<Delegate> delegate);
+ CryptAuthService* cryptauth_service);
static void SetInstanceForTesting(Factory* factory);
protected:
virtual std::unique_ptr<SecureChannel> BuildInstance(
std::unique_ptr<Connection> connection,
- std::unique_ptr<Delegate> delegate);
+ CryptAuthService* cryptauth_service);
private:
static Factory* factory_instance_;
@@ -112,7 +106,7 @@ class SecureChannel : public ConnectionObserver {
protected:
SecureChannel(std::unique_ptr<Connection> connection,
- std::unique_ptr<Delegate> delegate);
+ CryptAuthService* cryptauth_service);
Status status_;
@@ -141,7 +135,7 @@ class SecureChannel : public ConnectionObserver {
std::unique_ptr<SecureContext> secure_context);
std::unique_ptr<Connection> connection_;
- std::unique_ptr<Delegate> delegate_;
+ CryptAuthService* cryptauth_service_; // Outlives this instance.
std::unique_ptr<Authenticator> authenticator_;
std::unique_ptr<SecureContext> secure_context_;
std::deque<PendingMessage> queued_messages_;
« no previous file with comments | « components/cryptauth/fake_secure_channel.cc ('k') | components/cryptauth/secure_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698