tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PersistenceScope.cpp (962B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "PersistenceScope.h"
      8 
      9 namespace mozilla::dom::quota {
     10 
     11 bool MatchesPersistentPersistenceScope(
     12    const PersistenceScope& aPersistenceScope) {
     13  static PersistenceScope scope(
     14      PersistenceScope::CreateFromValue(PERSISTENCE_TYPE_PERSISTENT));
     15 
     16  return aPersistenceScope.Matches(scope);
     17 }
     18 
     19 bool MatchesBestEffortPersistenceScope(
     20    const PersistenceScope& aPersistenceScope) {
     21  static PersistenceScope scope(PersistenceScope::CreateFromSet(
     22      PERSISTENCE_TYPE_TEMPORARY, PERSISTENCE_TYPE_DEFAULT,
     23      PERSISTENCE_TYPE_PRIVATE));
     24 
     25  return aPersistenceScope.Matches(scope);
     26 }
     27 
     28 }  // namespace mozilla::dom::quota