tor-browser

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

CDMStorageIdProvider.h (1353B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef CDMStorageIdProvider_h_
      7 #define CDMStorageIdProvider_h_
      8 
      9 /**
     10 * CDM will try to request a latest version(0) of storage id.
     11 * If the storage id computation algorithm changed, we should increase the
     12 * kCurrentVersion.
     13 */
     14 
     15 #include "nsString.h"
     16 
     17 namespace mozilla {
     18 
     19 class CDMStorageIdProvider {
     20  static constexpr const char* kBrowserIdentifier = "mozilla_firefox_gecko";
     21 
     22 public:
     23  // Should increase the value when the storage id algorithm changed.
     24  static constexpr int kCurrentVersion = 1;
     25  static constexpr int kCDMRequestLatestVersion = 0;
     26 
     27  // Return empty string when
     28  // 1. Call on unsupported storageid platform.
     29  // 2. Failed to compute the storage id.
     30  // This function only provide the storage id for kCurrentVersion=1.
     31  // If you want to change the algorithm or output of storageid,
     32  // you should keep the version 1 storage id and consider to provide
     33  // higher version storage id in another function.
     34  static nsCString ComputeStorageId(const nsCString& aOriginSalt);
     35 };
     36 
     37 }  // namespace mozilla
     38 
     39 #endif  // CDMStorageIdProvider_h_