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

Side by Side Diff: remoting/host/host_extension_session_manager.cc

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
« no previous file with comments | « remoting/host/host_extension_session_manager.h ('k') | remoting/host/host_mock_objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « remoting/host/host_extension_session_manager.h ('k') | remoting/host/host_mock_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698