| OLD | NEW |
| 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 "components/browser_watcher/exit_code_watcher_win.h" | 5 #include "components/browser_watcher/exit_code_watcher_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
| 11 | 11 |
| 12 namespace browser_watcher { | 12 namespace browser_watcher { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 base::string16 GetValueName(const base::Time creation_time, | 16 base::string16 GetValueName(const base::Time creation_time, |
| 17 base::ProcessId pid) { | 17 base::ProcessId pid) { |
| 18 // Convert the PID and creation time to a string value unique to this | 18 // Convert the PID and creation time to a string value unique to this |
| 19 // process instance. | 19 // process instance. |
| 20 return base::StringPrintf(L"%d-%lld", pid, creation_time.ToInternalValue()); | 20 return L"";// base::StringPrintf(L"%d-%lld", pid, creation_time.ToInternalValu
e()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 ExitCodeWatcher::ExitCodeWatcher(const base::char16* registry_path) : | 25 ExitCodeWatcher::ExitCodeWatcher(const base::char16* registry_path) : |
| 26 registry_path_(registry_path), exit_code_(STILL_ACTIVE) { | 26 registry_path_(registry_path), exit_code_(STILL_ACTIVE) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 ExitCodeWatcher::~ExitCodeWatcher() { | 29 ExitCodeWatcher::~ExitCodeWatcher() { |
| 30 } | 30 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ULONG result = key.WriteValue(value_name.c_str(), exit_code); | 78 ULONG result = key.WriteValue(value_name.c_str(), exit_code); |
| 79 if (result != ERROR_SUCCESS) { | 79 if (result != ERROR_SUCCESS) { |
| 80 LOG(ERROR) << "Unable to write to registry, error " << result; | 80 LOG(ERROR) << "Unable to write to registry, error " << result; |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 | 83 |
| 84 return true; | 84 return true; |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace browser_watcher | 87 } // namespace browser_watcher |
| OLD | NEW |