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

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

Issue 1855613002: Adding the RemoteSecurityKeyMessageHandler class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing feedback Created 4 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
Index: remoting/host/security_key/fake_remote_security_key_ipc_client.cc
diff --git a/remoting/host/security_key/fake_remote_security_key_ipc_client.cc b/remoting/host/security_key/fake_remote_security_key_ipc_client.cc
index fc655ddf3d784b59d8d63a7ee5e7ede6024c087e..6c70737f59ce933fa62302e244799d94259b3bb2 100644
--- a/remoting/host/security_key/fake_remote_security_key_ipc_client.cc
+++ b/remoting/host/security_key/fake_remote_security_key_ipc_client.cc
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/thread_task_runner_handle.h"
#include "ipc/ipc_channel.h"
@@ -18,12 +19,17 @@ namespace remoting {
FakeRemoteSecurityKeyIpcClient::FakeRemoteSecurityKeyIpcClient(
const base::Closure& channel_event_callback)
- : channel_event_callback_(channel_event_callback) {
+ : channel_event_callback_(channel_event_callback), weak_factory_(this) {
DCHECK(!channel_event_callback_.is_null());
}
FakeRemoteSecurityKeyIpcClient::~FakeRemoteSecurityKeyIpcClient() {}
+base::WeakPtr<FakeRemoteSecurityKeyIpcClient>
+FakeRemoteSecurityKeyIpcClient::AsWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
bool FakeRemoteSecurityKeyIpcClient::WaitForSecurityKeyIpcServerChannel() {
return wait_for_ipc_channel_return_value_;
}

Powered by Google App Engine
This is Rietveld 408576698