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

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

Issue 2170563002: Revert of Renaming Gnubby and RemoteSecurityKey files/classes/members (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_message_writer.cc
diff --git a/remoting/host/security_key/fake_remote_security_key_message_writer.cc b/remoting/host/security_key/fake_remote_security_key_message_writer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ccfd05bc0629fe56d64bb34f977a9ec366fff1e7
--- /dev/null
+++ b/remoting/host/security_key/fake_remote_security_key_message_writer.cc
@@ -0,0 +1,53 @@
+// Copyright 2016 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/security_key/fake_remote_security_key_message_writer.h"
+
+#include <string>
+#include <utility>
+
+#include "base/callback.h"
+#include "base/location.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "remoting/host/security_key/security_key_message.h"
+
+namespace remoting {
+
+FakeRemoteSecurityKeyMessageWriter::FakeRemoteSecurityKeyMessageWriter(
+ const base::Closure& write_callback)
+ : write_callback_(write_callback), weak_factory_(this) {
+ DCHECK(!write_callback_.is_null());
+}
+
+FakeRemoteSecurityKeyMessageWriter::~FakeRemoteSecurityKeyMessageWriter() {}
+
+base::WeakPtr<FakeRemoteSecurityKeyMessageWriter>
+FakeRemoteSecurityKeyMessageWriter::AsWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
+bool FakeRemoteSecurityKeyMessageWriter::WriteMessage(
+ RemoteSecurityKeyMessageType message_type) {
+ last_message_type_ = message_type;
+ last_message_payload_.clear();
+
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, write_callback_);
+
+ return write_request_succeeded_;
+}
+
+bool FakeRemoteSecurityKeyMessageWriter::WriteMessageWithPayload(
+ RemoteSecurityKeyMessageType message_type,
+ const std::string& message_payload) {
+ last_message_type_ = message_type;
+ last_message_payload_ = message_payload;
+
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, write_callback_);
+
+ return write_request_succeeded_;
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698