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

Unified Diff: chrome/browser/chrome_process_finder_win.cc

Issue 860453002: Move OpenProcessHandleWithAccess to Process::OpenWithAccess. (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: chrome/browser/chrome_process_finder_win.cc
diff --git a/chrome/browser/chrome_process_finder_win.cc b/chrome/browser/chrome_process_finder_win.cc
index 52efec5c464e1765650e7f8f11d713e9ed4326a2..9bae7d42640fd289a4397d71ddcb79ba5dd66f04 100644
--- a/chrome/browser/chrome_process_finder_win.cc
+++ b/chrome/browser/chrome_process_finder_win.cc
@@ -11,7 +11,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/process/process_handle.h"
+#include "base/process/process.h"
#include "base/process/process_info.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -137,16 +137,10 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window,
return NOTIFY_SUCCESS;
}
- base::win::ScopedHandle process_handle;
- if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
- base::OpenProcessHandleWithAccess(
- process_id, PROCESS_QUERY_INFORMATION,
- process_handle.Receive())) {
- // Receive() causes the process handle to be set in the destructor of the
- // temporary receiver object, which does not happen until after the if
- // statement is complete. So IsProcessImmersive() should only be checked
- // as part of a separate if statement.
- if (base::win::IsProcessImmersive(process_handle.Get()))
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ base::Process process =
+ base::Process::OpenWithAccess(process_id, PROCESS_QUERY_INFORMATION);
+ if (process.IsValid() && base::win::IsProcessImmersive(process.Handle()))
chrome::ActivateMetroChrome();
}
#endif

Powered by Google App Engine
This is Rietveld 408576698