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

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

Issue 468613002: Readability review. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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"
11 #include "remoting/host/host_extension_session.h" 11 #include "remoting/host/host_extension_session.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
13 namespace remoting { 13 namespace remoting {
Peter Kasting 2014/08/22 06:38:28 Nit: At least one blank line above this
Wez 2014/08/26 19:22:25 Done.
14 14
15 HostExtensionSessionManager::HostExtensionSessionManager( 15 HostExtensionSessionManager::HostExtensionSessionManager(
16 const std::vector<HostExtension*>& extensions, 16 const std::vector<HostExtension*>& extensions,
17 ClientSessionControl* client_session_control) 17 ClientSessionControl* client_session_control)
18 : client_session_control_(client_session_control), 18 : client_session_control_(client_session_control),
19 client_stub_(NULL), 19 client_stub_(NULL),
20 extensions_(extensions) { 20 extensions_(extensions) {
21 } 21 }
22 22
23 HostExtensionSessionManager::~HostExtensionSessionManager() { 23 HostExtensionSessionManager::~HostExtensionSessionManager() {
24 } 24 }
25 25
26 std::string HostExtensionSessionManager::GetCapabilities() { 26 std::string HostExtensionSessionManager::GetCapabilities() {
27 std::string capabilities; 27 std::string capabilities;
28 for (HostExtensionList::const_iterator extension = extensions_.begin(); 28 for (HostExtensionList::const_iterator extension = extensions_.begin();
29 extension != extensions_.end(); ++extension) { 29 extension != extensions_.end(); ++extension) {
30 std::string capability = (*extension)->capability(); 30 std::string capability = (*extension)->capability();
Peter Kasting 2014/08/22 06:38:28 Nit: Could probably be a const std::string& (tiny
Wez 2014/08/25 23:23:10 Making capability() return const std::string& risk
Peter Kasting 2014/08/25 23:39:06 I actually meant that the local variable here coul
Wez 2014/08/26 19:22:25 The std::string returned by capability() will go o
Peter Kasting 2014/08/26 20:58:14 No; if you bind a returned temporary to a const re
Wez 2014/08/28 00:13:20 Done.
31 if (capability.empty()) { 31 if (capability.empty()) {
32 continue; 32 continue;
33 } 33 }
34 if (!capabilities.empty()) { 34 if (!capabilities.empty()) {
35 capabilities.append(" "); 35 capabilities.append(" ");
36 } 36 }
37 capabilities.append(capability); 37 capabilities.append(capability);
38 } 38 }
39 return capabilities; 39 return capabilities;
40 } 40 }
41 41
42 scoped_ptr<webrtc::DesktopCapturer> 42 scoped_ptr<webrtc::DesktopCapturer>
43 HostExtensionSessionManager::OnCreateVideoCapturer( 43 HostExtensionSessionManager::OnCreateVideoCapturer(
Peter Kasting 2014/08/22 06:38:28 Nit: Elsewhere in this CL you don't indent the fun
Wez 2014/08/25 23:23:10 Acknowledged; that was an emacs auto-indentationis
44 scoped_ptr<webrtc::DesktopCapturer> capturer) { 44 scoped_ptr<webrtc::DesktopCapturer> capturer) {
45 for(HostExtensionSessionList::const_iterator it = extension_sessions_.begin(); 45 for(HostExtensionSessionList::const_iterator it = extension_sessions_.begin();
Peter Kasting 2014/08/22 06:38:28 Nit: for ( (2 places)
Wez 2014/08/25 23:23:10 Done.
46 it != extension_sessions_.end(); ++it) { 46 it != extension_sessions_.end(); ++it) {
47 if ((*it)->ModifiesVideoPipeline()) { 47 if ((*it)->ModifiesVideoPipeline()) {
48 capturer = (*it)->OnCreateVideoCapturer(capturer.Pass()); 48 capturer = (*it)->OnCreateVideoCapturer(capturer.Pass());
49 } 49 }
50 } 50 }
51 return capturer.Pass(); 51 return capturer.Pass();
52 } 52 }
53 53
54 scoped_ptr<VideoEncoder> HostExtensionSessionManager::OnCreateVideoEncoder( 54 scoped_ptr<VideoEncoder> HostExtensionSessionManager::OnCreateVideoEncoder(
55 scoped_ptr<VideoEncoder> encoder) { 55 scoped_ptr<VideoEncoder> encoder) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 it != extension_sessions_.end(); ++it) { 105 it != extension_sessions_.end(); ++it) {
106 if ((*it)->OnExtensionMessage( 106 if ((*it)->OnExtensionMessage(
107 client_session_control_, client_stub_, message)) { 107 client_session_control_, client_stub_, message)) {
108 return true; 108 return true;
109 } 109 }
110 } 110 }
111 return false; 111 return false;
112 } 112 }
113 113
114 } // namespace remoting 114 } // namespace remoting
115
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698