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

Side by Side Diff: remoting/host/win/launch_process_with_token.cc

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 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 (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/win/launch_process_with_token.h" 5 #include "remoting/host/win/launch_process_with_token.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <winternl.h> 8 #include <winternl.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 sizeof(name), 80 sizeof(name),
81 &name_length)) { 81 &name_length)) {
82 pipe_name.assign(name); 82 pipe_name.assign(name);
83 } 83 }
84 } 84 }
85 } 85 }
86 86
87 // Use the default pipe name if we couldn't query its name. 87 // Use the default pipe name if we couldn't query its name.
88 if (pipe_name.empty()) { 88 if (pipe_name.empty()) {
89 pipe_name = UTF8ToUTF16( 89 pipe_name = UTF8ToUTF16(
90 StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id)); 90 base::StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id));
91 } 91 }
92 92
93 // Try to connect to the named pipe. 93 // Try to connect to the named pipe.
94 base::win::ScopedHandle pipe; 94 base::win::ScopedHandle pipe;
95 for (int i = 0; i < kPipeConnectMaxAttempts; ++i) { 95 for (int i = 0; i < kPipeConnectMaxAttempts; ++i) {
96 pipe.Set(CreateFile(pipe_name.c_str(), 96 pipe.Set(CreateFile(pipe_name.c_str(),
97 GENERIC_READ | GENERIC_WRITE, 97 GENERIC_READ | GENERIC_WRITE,
98 0, 98 0,
99 NULL, 99 NULL,
100 OPEN_EXISTING, 100 OPEN_EXISTING,
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 return false; 619 return false;
620 } 620 }
621 621
622 CHECK(process_info.IsValid()); 622 CHECK(process_info.IsValid());
623 process_out->Set(process_info.TakeProcessHandle()); 623 process_out->Set(process_info.TakeProcessHandle());
624 thread_out->Set(process_info.TakeThreadHandle()); 624 thread_out->Set(process_info.TakeThreadHandle());
625 return true; 625 return true;
626 } 626 }
627 627
628 } // namespace remoting 628 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698