OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_HOST_FAKE_HOST_EXTENSION_H_ | 5 #ifndef REMOTING_HOST_FAKE_HOST_EXTENSION_H_ |
6 #define REMOTING_HOST_FAKE_HOST_EXTENSION_H_ | 6 #define REMOTING_HOST_FAKE_HOST_EXTENSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "remoting/host/host_extension.h" | 10 #include "remoting/host/host_extension.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 const std::string& capability); | 26 const std::string& capability); |
27 virtual ~FakeExtension(); | 27 virtual ~FakeExtension(); |
28 | 28 |
29 // HostExtension interface. | 29 // HostExtension interface. |
30 virtual std::string capability() const OVERRIDE; | 30 virtual std::string capability() const OVERRIDE; |
31 virtual scoped_ptr<HostExtensionSession> CreateExtensionSession( | 31 virtual scoped_ptr<HostExtensionSession> CreateExtensionSession( |
32 ClientSessionControl* client_session_control, | 32 ClientSessionControl* client_session_control, |
33 protocol::ClientStub* client_stub) OVERRIDE; | 33 protocol::ClientStub* client_stub) OVERRIDE; |
34 | 34 |
35 // Controls for testing. | 35 // Controls for testing. |
36 void set_steal_video_capturer(bool steal_video_capturer); | 36 void set_steal_video_capturer(bool steal_video_capturer) { |
37 steal_video_capturer_ = steal_video_capturer; | |
38 } | |
37 | 39 |
38 // Accessors for testing. | 40 // Accessors for testing. |
39 bool has_handled_message(); | 41 bool has_handled_message() const { return has_handled_message_; } |
40 bool has_wrapped_video_encoder(); | 42 bool has_wrapped_video_encoder() const { return has_wrapped_video_encoder_; } |
41 bool has_wrapped_video_capturer(); | 43 bool has_wrapped_video_capturer() const { |
42 bool was_instantiated() { return was_instantiated_; } | 44 return has_wrapped_video_capturer_; |
45 } | |
46 bool was_instantiated() const { return was_instantiated_; } | |
43 | 47 |
44 private: | 48 private: |
45 class Session; | 49 class Session; |
46 friend class Session; | 50 friend class Session; |
47 | 51 |
52 // The type name of extension messages that this fake consumes. | |
48 std::string message_type_; | 53 std::string message_type_; |
54 | |
55 // The capability this fake reports, and requires clients to support, if any. | |
49 std::string capability_; | 56 std::string capability_; |
50 | 57 |
58 // True if this extension should intercept creation of the session's video | |
59 // capturer and consume it, preventing the video pipeline being created. | |
51 bool steal_video_capturer_; | 60 bool steal_video_capturer_; |
52 | 61 |
62 // True if a message of |message_type_| has been processed by this extension. | |
53 bool has_handled_message_; | 63 bool has_handled_message_; |
64 | |
65 // True if this extension had the opportunity to modify the video pipeline. | |
54 bool has_wrapped_video_encoder_; | 66 bool has_wrapped_video_encoder_; |
55 bool has_wrapped_video_capturer_; | 67 bool has_wrapped_video_capturer_; |
68 | |
69 // True if |CreateExtensionSession| was called on this extension. | |
Peter Kasting
2014/08/26 20:58:15
Nit: For function names, I think it's more typical
Wez
2014/08/28 00:13:20
Done.
| |
56 bool was_instantiated_; | 70 bool was_instantiated_; |
57 | 71 |
58 DISALLOW_COPY_AND_ASSIGN(FakeExtension); | 72 DISALLOW_COPY_AND_ASSIGN(FakeExtension); |
59 }; | 73 }; |
60 | 74 |
61 } // namespace remoting | 75 } // namespace remoting |
62 | 76 |
63 #endif // REMOTING_HOST_FAKE_HOST_EXTENSION_H_ | 77 #endif // REMOTING_HOST_FAKE_HOST_EXTENSION_H_ |
OLD | NEW |