Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SpeculativeTransaction.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 SpeculativeTransaction_h_
#define SpeculativeTransaction_h_

#include "mozilla/Maybe.h"
#include "NullHttpTransaction.h"

namespace mozilla {
namespace net {

class HTTPSRecordResolver;

class SpeculativeTransaction : public NullHttpTransaction {
 public:
  SpeculativeTransaction(nsHttpConnectionInfo* aConnInfo,
                         nsIInterfaceRequestor* aCallbacks, uint32_t aCaps,
                         std::function<void(nsresult)>&& aCallback = nullptr,
                         bool reportActivity = true);

  already_AddRefed<SpeculativeTransaction> CreateWithNewConnInfo(
      nsHttpConnectionInfo* aConnInfo);

  virtual nsresult FetchHTTPSRR() override;

  virtual nsresult OnHTTPSRRAvailable(nsIDNSHTTPSSVCRecord* aHTTPSSVCRecord,
                                      nsISVCBRecord* aHighestPriorityRecord,
                                      const nsACString& aCname) override;

  void SetParallelSpeculativeConnectLimit(uint32_t aLimit) {
    mParallelSpeculativeConnectLimit.emplace(aLimit);
  }
  void SetIgnoreIdle(bool aIgnoreIdle) { mIgnoreIdle.emplace(aIgnoreIdle); }
  void SetAllow1918(bool aAllow1918) { mAllow1918.emplace(aAllow1918); }

  const Maybe<uint32_t>& ParallelSpeculativeConnectLimit() {
    return mParallelSpeculativeConnectLimit;
  }
  const Maybe<bool>& IgnoreIdle() { return mIgnoreIdle; }
  const Maybe<bool>& Allow1918() { return mAllow1918; }

  void Close(nsresult aReason) override;
  nsresult ReadSegments(nsAHttpSegmentReader* aReader, uint32_t aCount,
                        uint32_t* aCountRead) override;
  void InvokeCallback() override;

 protected:
  virtual ~SpeculativeTransaction();

  Maybe<uint32_t> mParallelSpeculativeConnectLimit;
  Maybe<bool> mIgnoreIdle;
  Maybe<bool> mAllow1918;

  bool mTriedToWrite = false;
  std::function<void(nsresult)> mCloseCallback;
  RefPtr<HTTPSRecordResolver> mResolver;
};

class FallbackTransaction : public SpeculativeTransaction {
 public:
  FallbackTransaction(nsHttpConnectionInfo* aConnInfo,
                      nsIInterfaceRequestor* aCallbacks, uint32_t aCaps,
                      std::function<void(nsresult)>&& aCallback)
      : SpeculativeTransaction(aConnInfo, aCallbacks, aCaps,
                               std::move(aCallback)) {}

  bool IsForFallback() override { return true; }

 private:
  virtual ~FallbackTransaction() = default;
};

}  // namespace net
}  // namespace mozilla

#endif  // SpeculativeTransaction_h_

Messung V0.5 in Prozent
C=95 H=94 G=94

¤ 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002