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

Side by Side Diff: remoting/protocol/fake_connection_to_host.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ 5 #ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ 6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "remoting/protocol/connection_to_host.h" 11 #include "remoting/protocol/connection_to_host.h"
12 #include "remoting/protocol/protocol_mock_objects.h" 12 #include "remoting/protocol/protocol_mock_objects.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 namespace test { 15 namespace test {
16 16
17 class FakeConnectionToHost : public protocol::ConnectionToHost { 17 class FakeConnectionToHost : public protocol::ConnectionToHost {
18 public: 18 public:
19 FakeConnectionToHost(); 19 FakeConnectionToHost();
20 ~FakeConnectionToHost() override; 20 ~FakeConnectionToHost() override;
21 21
22 // ConnectionToHost interface. 22 // ConnectionToHost interface.
23 void set_client_stub(protocol::ClientStub* client_stub) override; 23 void set_client_stub(protocol::ClientStub* client_stub) override;
24 void set_clipboard_stub(protocol::ClipboardStub* clipboard_stub) override; 24 void set_clipboard_stub(protocol::ClipboardStub* clipboard_stub) override;
25 void set_video_renderer(protocol::VideoRenderer* video_renderer) override; 25 void set_video_renderer(protocol::VideoRenderer* video_renderer) override;
26 void set_audio_stub(protocol::AudioStub* audio_stub) override; 26 void set_audio_stub(protocol::AudioStub* audio_stub) override;
27 void Connect(scoped_ptr<protocol::Session> session, 27 void Connect(std::unique_ptr<protocol::Session> session,
28 scoped_refptr<protocol::TransportContext> transport_context, 28 scoped_refptr<protocol::TransportContext> transport_context,
29 HostEventCallback* event_callback) override; 29 HostEventCallback* event_callback) override;
30 const protocol::SessionConfig& config() override; 30 const protocol::SessionConfig& config() override;
31 protocol::ClipboardStub* clipboard_forwarder() override; 31 protocol::ClipboardStub* clipboard_forwarder() override;
32 protocol::HostStub* host_stub() override; 32 protocol::HostStub* host_stub() override;
33 protocol::InputStub* input_stub() override; 33 protocol::InputStub* input_stub() override;
34 State state() const override; 34 State state() const override;
35 35
36 // Calls OnConnectionState on the |event_callback_| with the supplied state 36 // Calls OnConnectionState on the |event_callback_| with the supplied state
37 // and error. 37 // and error.
38 void SignalStateChange(protocol::Session::State state, 38 void SignalStateChange(protocol::Session::State state,
39 protocol::ErrorCode error); 39 protocol::ErrorCode error);
40 40
41 // Calls OnConnectionReady on the |event_callback_| with the supplied bool. 41 // Calls OnConnectionReady on the |event_callback_| with the supplied bool.
42 void SignalConnectionReady(bool ready); 42 void SignalConnectionReady(bool ready);
43 43
44 private: 44 private:
45 void SetState(State state, protocol::ErrorCode error); 45 void SetState(State state, protocol::ErrorCode error);
46 46
47 State state_ = INITIALIZING; 47 State state_ = INITIALIZING;
48 48
49 HostEventCallback* event_callback_; 49 HostEventCallback* event_callback_;
50 50
51 testing::NiceMock<protocol::MockClipboardStub> mock_clipboard_stub_; 51 testing::NiceMock<protocol::MockClipboardStub> mock_clipboard_stub_;
52 testing::NiceMock<protocol::MockHostStub> mock_host_stub_; 52 testing::NiceMock<protocol::MockHostStub> mock_host_stub_;
53 testing::NiceMock<protocol::MockInputStub> mock_input_stub_; 53 testing::NiceMock<protocol::MockInputStub> mock_input_stub_;
54 scoped_ptr<protocol::SessionConfig> session_config_; 54 std::unique_ptr<protocol::SessionConfig> session_config_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToHost); 56 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToHost);
57 }; 57 };
58 58
59 } // namespace test 59 } // namespace test
60 } // namespace remoting 60 } // namespace remoting
61 61
62 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ 62 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
OLDNEW
« no previous file with comments | « remoting/protocol/fake_connection_to_client.cc ('k') | remoting/protocol/fake_connection_to_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698