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

Side by Side Diff: remoting/host/security_key/fake_remote_security_key_message_writer.cc

Issue 2162083003: Renaming Gnubby and RemoteSecurityKey files/classes/members (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing a GYP build error 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/host/security_key/fake_remote_security_key_message_writer.h"
6
7 #include <string>
8 #include <utility>
9
10 #include "base/callback.h"
11 #include "base/location.h"
12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h"
14 #include "base/threading/thread_task_runner_handle.h"
15 #include "remoting/host/security_key/security_key_message.h"
16
17 namespace remoting {
18
19 FakeRemoteSecurityKeyMessageWriter::FakeRemoteSecurityKeyMessageWriter(
20 const base::Closure& write_callback)
21 : write_callback_(write_callback), weak_factory_(this) {
22 DCHECK(!write_callback_.is_null());
23 }
24
25 FakeRemoteSecurityKeyMessageWriter::~FakeRemoteSecurityKeyMessageWriter() {}
26
27 base::WeakPtr<FakeRemoteSecurityKeyMessageWriter>
28 FakeRemoteSecurityKeyMessageWriter::AsWeakPtr() {
29 return weak_factory_.GetWeakPtr();
30 }
31
32 bool FakeRemoteSecurityKeyMessageWriter::WriteMessage(
33 RemoteSecurityKeyMessageType message_type) {
34 last_message_type_ = message_type;
35 last_message_payload_.clear();
36
37 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, write_callback_);
38
39 return write_request_succeeded_;
40 }
41
42 bool FakeRemoteSecurityKeyMessageWriter::WriteMessageWithPayload(
43 RemoteSecurityKeyMessageType message_type,
44 const std::string& message_payload) {
45 last_message_type_ = message_type;
46 last_message_payload_ = message_payload;
47
48 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, write_callback_);
49
50 return write_request_succeeded_;
51 }
52
53 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698