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

Unified Diff: chrome/browser/plugins/plugin_observer.cc

Issue 860453002: Move OpenProcessHandleWithAccess to Process::OpenWithAccess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ServiceProcessControlBrowserTest.Setup again 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: chrome/browser/plugins/plugin_observer.cc
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc
index b4d472e143737d59d7d9a53654d16e0a95701769..dfd0577432c97e4d78876ee5a6081bce51e39ad8 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -294,14 +294,15 @@ void PluginObserver::PluginCrashed(const base::FilePath& plugin_path,
// process died, |plugin_pid| has been reused by a new process. The
// consequence is that we will display |IDS_PLUGIN_DISCONNECTED_PROMPT| rather
// than |IDS_PLUGIN_CRASHED_PROMPT| to the user, which seems acceptable.
- base::ProcessHandle plugin_handle = base::kNullProcessHandle;
- bool open_result = base::OpenProcessHandleWithAccess(
- plugin_pid, PROCESS_QUERY_INFORMATION | SYNCHRONIZE, &plugin_handle);
+ base::Process plugin_process =
+ base::Process::OpenWithAccess(plugin_pid,
+ PROCESS_QUERY_INFORMATION | SYNCHRONIZE);
bool is_running = false;
- if (open_result) {
- is_running = base::GetTerminationStatus(plugin_handle, NULL) ==
- base::TERMINATION_STATUS_STILL_RUNNING;
- base::CloseProcessHandle(plugin_handle);
+ if (plugin_process.IsValid()) {
+ is_running =
+ base::GetTerminationStatus(plugin_process.Handle(), NULL) ==
+ base::TERMINATION_STATUS_STILL_RUNNING;
+ plugin_process.Close();
}
if (is_running) {

Powered by Google App Engine
This is Rietveld 408576698