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

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

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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
« no previous file with comments | « printing/printing_context_mac.mm ('k') | remoting/host/desktop_resizer_mac.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/curtain_mode.h" 5 #include "remoting/host/curtain_mode.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 #include <Carbon/Carbon.h> 8 #include <Carbon/Carbon.h>
9 #include <Security/Security.h> 9 #include <Security/Security.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 // Try to install the switch-in handler. Do this before switching out the 129 // Try to install the switch-in handler. Do this before switching out the
130 // current session so that the console session is not affected if it fails. 130 // current session so that the console session is not affected if it fails.
131 if (!InstallEventHandler()) { 131 if (!InstallEventHandler()) {
132 LOG(ERROR) << "Failed to install the switch-in handler."; 132 LOG(ERROR) << "Failed to install the switch-in handler.";
133 DisconnectSession(); 133 DisconnectSession();
134 return; 134 return;
135 } 135 }
136 136
137 base::mac::ScopedCFTypeRef<CFDictionaryRef> session( 137 base::ScopedCFTypeRef<CFDictionaryRef> session(
138 CGSessionCopyCurrentDictionary()); 138 CGSessionCopyCurrentDictionary());
139 139
140 // CGSessionCopyCurrentDictionary has been observed to return NULL in some 140 // CGSessionCopyCurrentDictionary has been observed to return NULL in some
141 // cases. Once the system is in this state, curtain mode will fail as the 141 // cases. Once the system is in this state, curtain mode will fail as the
142 // CGSession command thinks the session is not attached to the console. The 142 // CGSession command thinks the session is not attached to the console. The
143 // only known remedy is logout or reboot. Since we're not sure what causes 143 // only known remedy is logout or reboot. Since we're not sure what causes
144 // this, or how common it is, a crash report is useful in this case (note 144 // this, or how common it is, a crash report is useful in this case (note
145 // that the connection would have to be refused in any case, so this is no 145 // that the connection would have to be refused in any case, so this is no
146 // loss of functionality). 146 // loss of functionality).
147 CHECK(session != NULL); 147 CHECK(session != NULL);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 scoped_ptr<CurtainMode> CurtainMode::Create( 259 scoped_ptr<CurtainMode> CurtainMode::Create(
260 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 260 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
261 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 261 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
262 base::WeakPtr<ClientSessionControl> client_session_control) { 262 base::WeakPtr<ClientSessionControl> client_session_control) {
263 return scoped_ptr<CurtainMode>(new CurtainModeMac(caller_task_runner, 263 return scoped_ptr<CurtainMode>(new CurtainModeMac(caller_task_runner,
264 ui_task_runner, 264 ui_task_runner,
265 client_session_control)); 265 client_session_control));
266 } 266 }
267 267
268 } // namespace remoting 268 } // namespace remoting
OLDNEW
« no previous file with comments | « printing/printing_context_mac.mm ('k') | remoting/host/desktop_resizer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698