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

Side by Side Diff: chrome/app/chrome_watcher_command_line_win.cc

Issue 1422773008: Fixing remaining VC++ 2015 64-bit build breaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unneeded include Created 5 years 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
« no previous file with comments | « chrome/app/chrome_watcher_client_unittest_win.cc ('k') | chrome/app/close_handle_hook_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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/app/chrome_watcher_command_line_win.h" 5 #include "chrome/app/chrome_watcher_command_line_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/win/win_util.h"
14 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
15 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
16 17
17 namespace { 18 namespace {
18 19
19 const char kOnIninitializedEventHandleSwitch[] = "on-initialized-event-handle"; 20 const char kOnIninitializedEventHandleSwitch[] = "on-initialized-event-handle";
20 const char kParentHandleSwitch[] = "parent-handle"; 21 const char kParentHandleSwitch[] = "parent-handle";
21 const char kMainThreadIdSwitch[] = "main-thread-id"; 22 const char kMainThreadIdSwitch[] = "main-thread-id";
22 23
23 void AppendHandleSwitch(const std::string& switch_name, 24 void AppendHandleSwitch(const std::string& switch_name,
24 HANDLE handle, 25 HANDLE handle,
25 base::CommandLine* command_line) { 26 base::CommandLine* command_line) {
26 command_line->AppendSwitchASCII( 27 command_line->AppendSwitchASCII(
27 switch_name, base::UintToString(reinterpret_cast<uint32_t>(handle))); 28 switch_name, base::UintToString(base::win::HandleToUint32(handle)));
28 } 29 }
29 30
30 uint32_t ReadUintSwitch(const base::CommandLine& command_line, 31 uint32_t ReadUintSwitch(const base::CommandLine& command_line,
31 const std::string& switch_name) { 32 const std::string& switch_name) {
32 std::string switch_string = command_line.GetSwitchValueASCII(switch_name); 33 std::string switch_string = command_line.GetSwitchValueASCII(switch_name);
33 unsigned int switch_uint = 0; 34 unsigned int switch_uint = 0;
34 if (switch_string.empty() || 35 if (switch_string.empty() ||
35 !base::StringToUint(switch_string, &switch_uint)) { 36 !base::StringToUint(switch_string, &switch_uint)) {
36 DLOG(ERROR) << "Missing or invalid " << switch_name << " argument."; 37 DLOG(ERROR) << "Missing or invalid " << switch_name << " argument.";
37 return 0; 38 return 0;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 !parent_process->IsValid()) { 110 !parent_process->IsValid()) {
110 // If one was valid and not the other, free the valid one. 111 // If one was valid and not the other, free the valid one.
111 on_initialized_event->Close(); 112 on_initialized_event->Close();
112 parent_process->Close(); 113 parent_process->Close();
113 *main_thread_id = 0; 114 *main_thread_id = 0;
114 return false; 115 return false;
115 } 116 }
116 117
117 return true; 118 return true;
118 } 119 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_watcher_client_unittest_win.cc ('k') | chrome/app/close_handle_hook_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698