Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/components/aboutthirdparty/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 3 kB image not shown  

Quelle  AboutThirdParty.h

  Sprache: C
 

/* 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 AboutThirdParty_h_
#define AboutThirdParty_h_

#include "mozilla/CompactPair.h"
#include "mozilla/MozPromise.h"
#include "nsIAboutThirdParty.h"
#include "nsInterfaceHashtable.h"
#include "nsTArray.h"
#include "nsTHashMap.h"
#include "nsTHashSet.h"

namespace mozilla {

class DynamicBlocklistWriter;

using InstallLocationT =
    CompactPair<nsString, nsCOMPtr<nsIInstalledApplication>>;
using ComponentPathMapT = nsInterfaceHashtable<nsStringCaseInsensitiveHashKey,
                                               nsIInstalledApplication>;

enum class KnownModuleType : uint32_t {
  Ime = 0,
  IconOverlay,
  ContextMenuHandler,
  CopyHookHandler,
  DragDropHandler,
  PropertySheetHandler,
  DataHandler,
  DropHandler,
  IconHandler,
  InfotipHandler,
  PropertyHandler,

  Last,
};

struct InstallLocationComparator {
  const nsAString& mFilePath;

  explicit InstallLocationComparator(const nsAString& aFilePath);
  int operator()(const InstallLocationT& aLocation) const;
};

class InstalledApplication final : public nsIInstalledApplication {
  nsString mName;
  nsString mPublisher;

  ~InstalledApplication() = default;

 public:
  InstalledApplication() = default;
  InstalledApplication(nsString&& aAppName, nsString&& aPublisher);

  InstalledApplication(InstalledApplication&&) = delete;
  InstalledApplication& operator=(InstalledApplication&&) = delete;
  InstalledApplication(const InstalledApplication&) = delete;
  InstalledApplication& operator=(const InstalledApplication&) = delete;

  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIINSTALLEDAPPLICATION
};

using BackgroundThreadPromise =
    MozPromise<bool /* aIgnored */, nsresult, /* IsExclusive */ false>;

class AboutThirdParty final : public nsIAboutThirdParty {
  // Atomic only supports 32-bit or 64-bit types.
  enum class WorkerState : uint32_t {
    Init,
    Running,
    Done,
  };
  Atomic<WorkerState, SequentiallyConsistent> mWorkerState;
  RefPtr<BackgroundThreadPromise::Private> mPromise;
  nsTHashMap<nsStringCaseInsensitiveHashKey, uint32_t> mKnownModules;
  ComponentPathMapT mComponentPaths;
  nsTArray<InstallLocationT> mLocations;

#if defined(MOZ_LAUNCHER_PROCESS)
  Atomic<DynamicBlocklistWriter*> mPendingWriter;
  // The current blocklist. May differ from mDynamicBlocklistAtLaunch
  // if the user has blocked/unblocked modules. Note that this does not
  // take effect until restart.
  nsTHashSet<nsStringCaseInsensitiveHashKey> mDynamicBlocklist;
  // The blocklist that was used at launch, which is currently in effect.
  nsTHashSet<nsStringCaseInsensitiveHashKey> mDynamicBlocklistAtLaunch;
#endif

  ~AboutThirdParty() = default;
  void BackgroundThread();
  void AddKnownModule(const nsString& aPath, KnownModuleType aType);

 public:
  static already_AddRefed<AboutThirdParty> GetSingleton();

  AboutThirdParty();

  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIABOUTTHIRDPARTY

  // Have a function separated from dom::Promise so that
  // both JS method and GTest can use.
  RefPtr<BackgroundThreadPromise> CollectSystemInfoAsync();
};

}  // namespace mozilla

#endif  // AboutThirdParty_h_

Messung V0.5 in Prozent
C=95 H=99 G=96

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.