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 #include "remoting/host/host_extension_session_manager.h" | 5 #include "remoting/host/host_extension_session_manager.h" |
6 | 6 |
7 #include "remoting/base/capabilities.h" | 7 #include "remoting/base/capabilities.h" |
8 #include "remoting/codec/video_encoder.h" | 8 #include "remoting/codec/video_encoder.h" |
9 #include "remoting/host/client_session_control.h" | 9 #include "remoting/host/client_session_control.h" |
10 #include "remoting/host/host_extension.h" | 10 #include "remoting/host/host_extension.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 for (HostExtensions::const_iterator extension = extensions_.begin(); | 49 for (HostExtensions::const_iterator extension = extensions_.begin(); |
50 extension != extensions_.end(); ++extension) { | 50 extension != extensions_.end(); ++extension) { |
51 // If the extension requires a capability that was not negotiated then do | 51 // If the extension requires a capability that was not negotiated then do |
52 // not instantiate it. | 52 // not instantiate it. |
53 if (!(*extension)->capability().empty() && | 53 if (!(*extension)->capability().empty() && |
54 !HasCapability(capabilities, (*extension)->capability())) { | 54 !HasCapability(capabilities, (*extension)->capability())) { |
55 continue; | 55 continue; |
56 } | 56 } |
57 | 57 |
58 scoped_ptr<HostExtensionSession> extension_session = | 58 std::unique_ptr<HostExtensionSession> extension_session = |
59 (*extension) | 59 (*extension) |
60 ->CreateExtensionSession(client_session_control_, client_stub_); | 60 ->CreateExtensionSession(client_session_control_, client_stub_); |
61 DCHECK(extension_session); | 61 DCHECK(extension_session); |
62 | 62 |
63 extension_sessions_.push_back(extension_session.release()); | 63 extension_sessions_.push_back(extension_session.release()); |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 bool HostExtensionSessionManager::OnExtensionMessage( | 67 bool HostExtensionSessionManager::OnExtensionMessage( |
68 const protocol::ExtensionMessage& message) { | 68 const protocol::ExtensionMessage& message) { |
69 for(HostExtensionSessions::const_iterator it = extension_sessions_.begin(); | 69 for(HostExtensionSessions::const_iterator it = extension_sessions_.begin(); |
70 it != extension_sessions_.end(); ++it) { | 70 it != extension_sessions_.end(); ++it) { |
71 if ((*it)->OnExtensionMessage(client_session_control_, client_stub_, | 71 if ((*it)->OnExtensionMessage(client_session_control_, client_stub_, |
72 message)) { | 72 message)) { |
73 return true; | 73 return true; |
74 } | 74 } |
75 } | 75 } |
76 return false; | 76 return false; |
77 } | 77 } |
78 | 78 |
79 } // namespace remoting | 79 } // namespace remoting |
OLD | NEW |