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

Unified Diff: components/browser_watcher/exit_code_watcher_win.cc

Issue 864163003: Rename base::Process::pid() to Pid() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/browser_watcher/exit_code_watcher_win.cc
diff --git a/components/browser_watcher/exit_code_watcher_win.cc b/components/browser_watcher/exit_code_watcher_win.cc
index 218978c700e4805220ecbf6c3bd014dd31c88e77..0e2318472f455a2c9f40b4b2b12622aa9eca7e68 100644
--- a/components/browser_watcher/exit_code_watcher_win.cc
+++ b/components/browser_watcher/exit_code_watcher_win.cc
@@ -30,7 +30,12 @@ ExitCodeWatcher::~ExitCodeWatcher() {
}
bool ExitCodeWatcher::Initialize(base::Process process) {
- DWORD process_pid = process.pid();
+ if (!process.IsValid()) {
+ LOG(ERROR) << "Invalid parent handle, can't get parent process ID.";
+ return false;
+ }
+
+ DWORD process_pid = process.Pid();
if (process_pid == 0) {
Lei Zhang 2015/01/23 23:53:44 Is this possible when |process| is valid?
rvargas (doing something else) 2015/01/23 23:55:55 I thought it was not, but there are two unit tests
LOG(ERROR) << "Invalid parent handle, can't get parent process ID.";
return false;
@@ -44,7 +49,7 @@ bool ExitCodeWatcher::Initialize(base::Process process) {
return false;
}
- // Success, take ownership of the process handle.
+ // Success, take ownership of the process.
process_ = process.Pass();
process_creation_time_ = base::Time::FromFileTime(creation_time);
@@ -68,7 +73,7 @@ bool ExitCodeWatcher::WriteProcessExitCode(int exit_code) {
registry_path_.c_str(),
KEY_WRITE);
base::string16 value_name(
- GetValueName(process_creation_time_, process_.pid()));
+ GetValueName(process_creation_time_, process_.Pid()));
ULONG result = key.WriteValue(value_name.c_str(), exit_code);
if (result != ERROR_SUCCESS) {
« no previous file with comments | « chromeos/process_proxy/process_proxy.cc ('k') | components/browser_watcher/exit_code_watcher_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698