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

Unified Diff: base/mac/mac_util.mm

Issue 2433773008: Suppress a declarated-declaration warning for GetProcessInformation. (Closed)
Patch Set: remove whitespace. Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mac_util.mm
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 930a280ee3cb08fb491bfa64e45371bd3abcca1a..9615f9d2eeb1ae88ef29d025bb0f56289d6e0716 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -296,11 +296,21 @@ bool WasLaunchedAsLoginOrResumeItem() {
ProcessInfoRec info = {};
info.processInfoLength = sizeof(info);
+// GetProcessInformation has been deprecated since macOS 10.9, but there is no
+// replacement that provides the information we need. See
+// https://crbug.com/650854.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (GetProcessInformation(&psn, &info) == noErr) {
+#pragma clang diagnostic pop
ProcessInfoRec parent_info = {};
parent_info.processInfoLength = sizeof(parent_info);
- if (GetProcessInformation(&info.processLauncher, &parent_info) == noErr)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ if (GetProcessInformation(&info.processLauncher, &parent_info) == noErr) {
+#pragma clang diagnostic pop
return parent_info.processSignature == 'lgnw';
+ }
}
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698