toolkit/xre/UIKitDirProvider.mm
author Boris Zbarsky <bzbarsky@mit.edu>
Wed, 31 Oct 2018 14:34:12 -0400
changeset 498273 0a7792cc133f00007c69cd8e5200a977f801d876
parent 282673 783903e5da3b3e33a52458be4d44d5359e3d013e
child 512031 0e3b5fe32d113a4a857bf7b948921f531cca8a8e
permissions -rw-r--r--
Bug 1503659 - Back out some debugging instrumentation from Firefox 64, now that it's in beta. r=mccr8, a=RyanVM

/* -*- 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>

#include "UIKitDirProvider.h"

bool GetUIKitDirectory(bool aLocal, nsACString& aUserDir)
{
  NSSearchPathDirectory directory = aLocal ? NSCachesDirectory : NSApplicationSupportDirectory;
  NSArray* paths = NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
  if ([paths count] == 0) {
    return false;
  }
  aUserDir = [[paths objectAtIndex:0] UTF8String];
  return true;
}