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

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

Issue 4971003: Inject MessageLoop into Capturer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/capturer_mac.h" 5 #include "remoting/host/capturer_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <OpenGL/CGLMacro.h> 9 #include <OpenGL/CGLMacro.h>
10 10
11 namespace remoting { 11 namespace remoting {
12 12
13 CapturerMac::CapturerMac() : cgl_context_(NULL) { 13 CapturerMac::CapturerMac(MessageLoop* message_loop)
14 : Capturer(message_loop),
15 cgl_context_(NULL) {
14 // TODO(dmaclach): move this initialization out into session_manager, 16 // TODO(dmaclach): move this initialization out into session_manager,
15 // or at least have session_manager call into here to initialize it. 17 // or at least have session_manager call into here to initialize it.
16 CGError err = 18 CGError err =
17 CGRegisterScreenRefreshCallback(CapturerMac::ScreenRefreshCallback, 19 CGRegisterScreenRefreshCallback(CapturerMac::ScreenRefreshCallback,
18 this); 20 this);
19 DCHECK_EQ(err, kCGErrorSuccess); 21 DCHECK_EQ(err, kCGErrorSuccess);
20 err = CGScreenRegisterMoveCallback(CapturerMac::ScreenUpdateMoveCallback, 22 err = CGScreenRegisterMoveCallback(CapturerMac::ScreenUpdateMoveCallback,
21 this); 23 this);
22 DCHECK_EQ(err, kCGErrorSuccess); 24 DCHECK_EQ(err, kCGErrorSuccess);
23 err = CGDisplayRegisterReconfigurationCallback( 25 err = CGDisplayRegisterReconfigurationCallback(
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 CGDisplayChangeSummaryFlags flags, 157 CGDisplayChangeSummaryFlags flags,
156 void *user_parameter) { 158 void *user_parameter) {
157 if ((display == CGMainDisplayID()) && 159 if ((display == CGMainDisplayID()) &&
158 !(flags & kCGDisplayBeginConfigurationFlag)) { 160 !(flags & kCGDisplayBeginConfigurationFlag)) {
159 CapturerMac *capturer = reinterpret_cast<CapturerMac *>(user_parameter); 161 CapturerMac *capturer = reinterpret_cast<CapturerMac *>(user_parameter);
160 capturer->ScreenConfigurationChanged(); 162 capturer->ScreenConfigurationChanged();
161 } 163 }
162 } 164 }
163 165
164 } // namespace remoting 166 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698