diff options
author | Brian Smith <brian@dbsoft.org> | 2022-04-26 09:34:34 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2022-04-26 10:19:00 -0500 |
commit | 378738aaa9924d0b95e2c57f27cbad2b2e644282 (patch) | |
tree | 34ce9c4ce3995576604fb4bc47d9405e661daf39 /js/xpconnect | |
parent | 82f11ad8aaeff395629c3a3f72ece43712fd8e72 (diff) | |
download | uxp-378738aaa9924d0b95e2c57f27cbad2b2e644282.tar.gz |
Issue #1829 - Revert “Issue #1751 - Remove Mac code behind MOZ_WIDGET_TOOLKIT == 'cocoa’”
This reverts commit 1fe9c19305dadf2d5bcaa0e589fcd250389dfa8a.
Diffstat (limited to 'js/xpconnect')
-rw-r--r-- | js/xpconnect/shell/moz.build | 5 | ||||
-rw-r--r-- | js/xpconnect/shell/xpcshellMacUtils.h | 8 | ||||
-rw-r--r-- | js/xpconnect/shell/xpcshellMacUtils.mm | 18 |
3 files changed, 31 insertions, 0 deletions
diff --git a/js/xpconnect/shell/moz.build b/js/xpconnect/shell/moz.build index 3361b7d810..c1789fdc71 100644 --- a/js/xpconnect/shell/moz.build +++ b/js/xpconnect/shell/moz.build @@ -14,6 +14,11 @@ SOURCES += [ 'xpcshell.cpp', ] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + SOURCES += [ + 'xpcshellMacUtils.mm', + ] + include('/ipc/chromium/chromium-config.mozbuild') LOCAL_INCLUDES += [ diff --git a/js/xpconnect/shell/xpcshellMacUtils.h b/js/xpconnect/shell/xpcshellMacUtils.h new file mode 100644 index 0000000000..2e6b5cb359 --- /dev/null +++ b/js/xpconnect/shell/xpcshellMacUtils.h @@ -0,0 +1,8 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Functions to setup and release the Mac memory pool +void InitAutoreleasePool(); +void FinishAutoreleasePool(); diff --git a/js/xpconnect/shell/xpcshellMacUtils.mm b/js/xpconnect/shell/xpcshellMacUtils.mm new file mode 100644 index 0000000000..61d6a9ea9a --- /dev/null +++ b/js/xpconnect/shell/xpcshellMacUtils.mm @@ -0,0 +1,18 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include <Foundation/Foundation.h> + +static NSAutoreleasePool *pool = NULL; + +void InitAutoreleasePool() +{ + pool = [[NSAutoreleasePool alloc] init]; +} + +void FinishAutoreleasePool() +{ + [pool release]; +} |