dom/storage/StorageUtils.h
author Kris Maglione <maglione.k@gmail.com>
Thu, 14 Feb 2019 17:54:00 -0800
changeset 517406 7436c0f5b8b1583d20d5ea2d1d9d3b2c665bdf33
parent 505383 6f3709b3878117466168c40affa7bca0b60cf75b
child 520812 84806a3e88b92aadc6570f59dbe12139f77d92c6
permissions -rw-r--r--
Fix botched backout (bug 1524687). r=bustage

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */

#ifndef mozilla_dom_StorageUtils_h
#define mozilla_dom_StorageUtils_h

class nsIPrincipal;

namespace mozilla {
namespace dom {
namespace StorageUtils {

nsresult GenerateOriginKey(nsIPrincipal* aPrincipal,
                           nsACString& aOriginAttrSuffix,
                           nsACString& aOriginKey);

bool PrincipalsEqual(nsIPrincipal* aObjectPrincipal,
                     nsIPrincipal* aSubjectPrincipal);

void ReverseString(const nsACString& aSource, nsACString& aResult);

nsresult CreateReversedDomain(const nsACString& aAsciiDomain, nsACString& aKey);

nsCString Scheme0Scope(const nsACString& aOriginSuffix,
                       const nsACString& aOriginNoSuffix);

}  // namespace StorageUtils
}  // namespace dom
}  // namespace mozilla

#endif  // mozilla_dom_StorageUtils_h