Commit 03112541 authored by Niels Möller's avatar Niels Möller Committed by Commit Bot

Fix missing link dependencies on MacOS

Bug: chromium:997148
Change-Id: I1d02c0b9d8ba61f0f99457b87b5e65c0efafaad8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768637Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Niels Möller <nisse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691065}
parent f1d20974
......@@ -377,6 +377,7 @@ jumbo_component("base") {
"mac/os_crash_dumps.h",
"mac/scoped_aedesc.h",
"mac/scoped_authorizationref.h",
"mac/scoped_authorizationref.mm",
"mac/scoped_block.h",
"mac/scoped_cffiledescriptorref.h",
"mac/scoped_cftyperef.h",
......
......@@ -7,6 +7,7 @@
#include <Security/Authorization.h>
#include "base/base_export.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
......@@ -16,7 +17,7 @@
namespace base {
namespace mac {
class ScopedAuthorizationRef {
class BASE_EXPORT ScopedAuthorizationRef {
public:
explicit ScopedAuthorizationRef(AuthorizationRef authorization = NULL)
: authorization_(authorization) {
......@@ -24,14 +25,14 @@ class ScopedAuthorizationRef {
~ScopedAuthorizationRef() {
if (authorization_) {
AuthorizationFree(authorization_, kAuthorizationFlagDestroyRights);
FreeInternal();
}
}
void reset(AuthorizationRef authorization = NULL) {
if (authorization_ != authorization) {
if (authorization_) {
AuthorizationFree(authorization_, kAuthorizationFlagDestroyRights);
FreeInternal();
}
authorization_ = authorization;
}
......@@ -71,6 +72,13 @@ class ScopedAuthorizationRef {
}
private:
// Calling AuthorizationFree, defined in Security.framework, from an inline
// function, results in link errors when linking dynamically with
// libbase.dylib. So wrap the call in an un-inlined method. This method
// doesn't check if |authorization_| is null; that check should be in the
// inlined callers.
void FreeInternal();
AuthorizationRef authorization_;
DISALLOW_COPY_AND_ASSIGN(ScopedAuthorizationRef);
......
// Copyright (c) 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/mac/scoped_authorizationref.h"
namespace base {
namespace mac {
void ScopedAuthorizationRef::FreeInternal() {
AuthorizationFree(authorization_, kAuthorizationFlagDestroyRights);
}
} // namespace mac
} // namespace base
......@@ -414,6 +414,11 @@ jumbo_source_set("browser_sources") {
"//ipc",
]
if (is_mac) {
# For LSCopyDisplayNameForURL, path_util.cc.
libs = [ "CoreServices.framework" ]
}
configs += [
"//build/config:precompiled_headers",
......
......@@ -503,6 +503,10 @@ jumbo_component("headless_non_renderer") {
if (is_mac) {
deps += [ ":mac_helpers" ]
libs = [
"AppKit.framework",
"CoreFoundation.framework",
]
} else {
deps += [ "//ui/aura" ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment