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

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

Issue 609923004: Cleanup usage of scoped_ptr<> in remoting for C++11 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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/single_window_desktop_environment.h" 5 #include "remoting/host/single_window_desktop_environment.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "remoting/host/single_window_input_injector.h" 9 #include "remoting/host/single_window_input_injector.h"
10 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" 10 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 44 DCHECK(caller_task_runner()->BelongsToCurrentThread());
45 45
46 webrtc::DesktopCaptureOptions options = 46 webrtc::DesktopCaptureOptions options =
47 webrtc::DesktopCaptureOptions::CreateDefault(); 47 webrtc::DesktopCaptureOptions::CreateDefault();
48 options.set_use_update_notifications(true); 48 options.set_use_update_notifications(true);
49 49
50 scoped_ptr<webrtc::WindowCapturer>window_capturer( 50 scoped_ptr<webrtc::WindowCapturer>window_capturer(
51 webrtc::WindowCapturer::Create(options)); 51 webrtc::WindowCapturer::Create(options));
52 window_capturer->SelectWindow(window_id_); 52 window_capturer->SelectWindow(window_id_);
53 53
54 return window_capturer.PassAs<webrtc::DesktopCapturer>(); 54 return window_capturer.Pass();
55 } 55 }
56 56
57 scoped_ptr<InputInjector> 57 scoped_ptr<InputInjector>
58 SingleWindowDesktopEnvironment::CreateInputInjector() { 58 SingleWindowDesktopEnvironment::CreateInputInjector() {
59 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 59 DCHECK(caller_task_runner()->BelongsToCurrentThread());
60 60
61 scoped_ptr<InputInjector> input_injector( 61 scoped_ptr<InputInjector> input_injector(
62 InputInjector::Create(input_task_runner(), 62 InputInjector::Create(input_task_runner(),
63 ui_task_runner())); 63 ui_task_runner()));
64 return SingleWindowInputInjector::CreateForWindow( 64 return SingleWindowInputInjector::CreateForWindow(
65 window_id_, input_injector.Pass()).PassAs<InputInjector>(); 65 window_id_, input_injector.Pass()).Pass();
66 } 66 }
67 67
68 SingleWindowDesktopEnvironment::SingleWindowDesktopEnvironment( 68 SingleWindowDesktopEnvironment::SingleWindowDesktopEnvironment(
69 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 69 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
70 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 70 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
71 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 71 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
72 webrtc::WindowId window_id) 72 webrtc::WindowId window_id)
73 : BasicDesktopEnvironment(caller_task_runner, 73 : BasicDesktopEnvironment(caller_task_runner,
74 input_task_runner, 74 input_task_runner,
75 ui_task_runner), 75 ui_task_runner),
(...skipping 17 matching lines...) Expand all
93 93
94 scoped_ptr<DesktopEnvironment> SingleWindowDesktopEnvironmentFactory::Create( 94 scoped_ptr<DesktopEnvironment> SingleWindowDesktopEnvironmentFactory::Create(
95 base::WeakPtr<ClientSessionControl> client_session_control) { 95 base::WeakPtr<ClientSessionControl> client_session_control) {
96 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 96 DCHECK(caller_task_runner()->BelongsToCurrentThread());
97 97
98 scoped_ptr<SingleWindowDesktopEnvironment> desktop_environment( 98 scoped_ptr<SingleWindowDesktopEnvironment> desktop_environment(
99 new SingleWindowDesktopEnvironment(caller_task_runner(), 99 new SingleWindowDesktopEnvironment(caller_task_runner(),
100 input_task_runner(), 100 input_task_runner(),
101 ui_task_runner(), 101 ui_task_runner(),
102 window_id_)); 102 window_id_));
103 return desktop_environment.PassAs<DesktopEnvironment>(); 103 return desktop_environment.Pass();
104 } 104 }
105 105
106 } // namespace remoting 106 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698