Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/netwerk/protocol/http/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  BackgroundChannelRegistrar.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 mozilla_net_BackgroundChannelRegistrar_h_
#define mozilla_net_BackgroundChannelRegistrar_h_

#include "nsIBackgroundChannelRegistrar.h"
#include "nsRefPtrHashtable.h"
#include "mozilla/AlreadyAddRefed.h"

namespace mozilla {
namespace net {

class HttpBackgroundChannelParent;
class HttpChannelParent;

class BackgroundChannelRegistrar final : public nsIBackgroundChannelRegistrar {
  using ChannelHashtable =
      nsRefPtrHashtable<nsUint64HashKey, HttpChannelParent>;
  using BackgroundChannelHashtable =
      nsRefPtrHashtable<nsUint64HashKey, HttpBackgroundChannelParent>;

 public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIBACKGROUNDCHANNELREGISTRAR

  explicit BackgroundChannelRegistrar();

  // Singleton accessors
  static already_AddRefed<BackgroundChannelRegistrar> GetOrCreate();

 private:
  virtual ~BackgroundChannelRegistrar();

  // Like DeleteChannel, but only removes the mChannels entry if it matches
  // aExpected. Use this in preference to DeleteChannel when the caller knows
  // which HttpChannelParent it registered, to avoid accidentally removing an
  // entry belonging to a different object that shares the same channel Id.
  void DeleteChannelIfMatches(uint64_t aKey, HttpChannelParent* aExpected);
  friend class HttpChannelParent;

  // A helper function for BackgroundChannelRegistrar itself to callback
  // HttpChannelParent and HttpBackgroundChannelParent when both objects are
  // ready. aChannelParent and aBgParent is the pair of HttpChannelParent and
  // HttpBackgroundChannelParent that should be linked together.
  void NotifyChannelLinked(HttpChannelParent* aChannelParent,
                           HttpBackgroundChannelParent* aBgParent);

  // Store unlinked HttpChannelParent objects.
  ChannelHashtable mChannels;

  // Store unlinked HttpBackgroundChannelParent objects.
  BackgroundChannelHashtable mBgChannels;
};

}  // namespace net
}  // namespace mozilla

#endif  // mozilla_net_BackgroundChannelRegistrar_h_

Messung V0.5 in Prozent
C=87 H=97 G=91

¤ Dauer der Verarbeitung: 0.3 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.