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

Side by Side Diff: remoting/host/plugin/daemon_controller_win.cc

Issue 10073028: Avoiding unnecessary conversion to UTF16 in runtime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/host_service_win.cc ('k') | remoting/host/sas_injector_win.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/plugin/daemon_controller.h" 5 #include "remoting/host/plugin/daemon_controller.h"
6 6
7 #include <objbase.h> 7 #include <objbase.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 ::OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASE, 283 ::OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASE,
284 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE)); 284 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE));
285 if (!scmanager.IsValid()) { 285 if (!scmanager.IsValid()) {
286 DWORD error = GetLastError(); 286 DWORD error = GetLastError();
287 LOG_GETLASTERROR(ERROR) 287 LOG_GETLASTERROR(ERROR)
288 << "Failed to connect to the service control manager"; 288 << "Failed to connect to the service control manager";
289 return error; 289 return error;
290 } 290 }
291 291
292 ScopedScHandle service( 292 ScopedScHandle service(
293 ::OpenServiceW(scmanager, UTF8ToUTF16(kWindowsServiceName).c_str(), 293 ::OpenServiceW(scmanager, kWindowsServiceName, SERVICE_QUERY_STATUS));
294 SERVICE_QUERY_STATUS));
295 if (!service.IsValid()) { 294 if (!service.IsValid()) {
296 DWORD error = GetLastError(); 295 DWORD error = GetLastError();
297 if (error != ERROR_SERVICE_DOES_NOT_EXIST) { 296 if (error != ERROR_SERVICE_DOES_NOT_EXIST) {
298 LOG_GETLASTERROR(ERROR) 297 LOG_GETLASTERROR(ERROR)
299 << "Failed to open to the '" << kWindowsServiceName << "' service"; 298 << "Failed to open to the '" << kWindowsServiceName << "' service";
300 } 299 }
301 return error; 300 return error;
302 } 301 }
303 302
304 service_out->Set(service.Take()); 303 service_out->Set(service.Take());
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 done_callback.Run(HResultToAsyncResult(hr)); 419 done_callback.Run(HResultToAsyncResult(hr));
421 } 420 }
422 421
423 } // namespace 422 } // namespace
424 423
425 scoped_ptr<DaemonController> remoting::DaemonController::Create() { 424 scoped_ptr<DaemonController> remoting::DaemonController::Create() {
426 return scoped_ptr<DaemonController>(new DaemonControllerWin()); 425 return scoped_ptr<DaemonController>(new DaemonControllerWin());
427 } 426 }
428 427
429 } // namespace remoting 428 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_service_win.cc ('k') | remoting/host/sas_injector_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698