Commit ce78c5ba authored by valenting's avatar valenting
Browse files

Bug 1714307 - Run modernize-use-default-member-init --fix check on...

Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk/protocol/http/ r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D117503
parent 60630b7e
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -219,11 +219,8 @@ AltSvcMapping::AltSvcMapping(DataStorage* storage, int32_t epoch,
      mUsername(username),
      mPrivate(privateBrowsing),
      mExpiresAt(expiresAt),
      mValidated(false),
      mMixedScheme(false),
      mNPNToken(npnToken),
      mOriginAttributes(originAttributes),
      mSyncOnlyOnSuccess(false),
      mIsHttp3(aIsHttp3) {
  MOZ_ASSERT(NS_IsMainThread());

@@ -408,10 +405,7 @@ void AltSvcMapping::Serialize(nsCString& out) {

AltSvcMapping::AltSvcMapping(DataStorage* storage, int32_t epoch,
                             const nsCString& str)
    : mStorage(storage),
      mStorageEpoch(epoch),
      mSyncOnlyOnSuccess(false),
      mIsHttp3(false) {
    : mStorage(storage), mStorageEpoch(epoch) {
  mValidated = false;
  nsresult code;
  char separator = ':';
+14 −12
Original line number Diff line number Diff line
@@ -115,27 +115,29 @@ class AltSvcMapping {

  // If you change any of these members, update Serialize()
  nsCString mAlternateHost;
  MOZ_INIT_OUTSIDE_CTOR int32_t mAlternatePort;
  int32_t mAlternatePort{-1};

  nsCString mOriginHost;
  MOZ_INIT_OUTSIDE_CTOR int32_t mOriginPort;
  int32_t mOriginPort{-1};

  nsCString mUsername;
  MOZ_INIT_OUTSIDE_CTOR bool mPrivate;
  bool mPrivate{false};

  MOZ_INIT_OUTSIDE_CTOR uint32_t mExpiresAt;  // alt-svc mappping
  // alt-svc mappping
  uint32_t mExpiresAt{0};

  MOZ_INIT_OUTSIDE_CTOR bool mValidated;
  MOZ_INIT_OUTSIDE_CTOR bool mHttps{};  // origin is https://
  MOZ_INIT_OUTSIDE_CTOR bool
      mMixedScheme;  // .wk allows http and https on same con
  bool mValidated{false};
  // origin is https://
  MOZ_INIT_OUTSIDE_CTOR bool mHttps{false};
  // .wk allows http and https on same con
  MOZ_INIT_OUTSIDE_CTOR bool mMixedScheme{false};

  nsCString mNPNToken;

  OriginAttributes mOriginAttributes;

  bool mSyncOnlyOnSuccess;
  bool mIsHttp3;
  bool mSyncOnlyOnSuccess{false};
  bool mIsHttp3{false};
};

class AltSvcOverride : public nsIInterfaceRequestor,
@@ -180,7 +182,7 @@ class TransactionObserver final : public nsIStreamListener {

class AltSvcCache {
 public:
  AltSvcCache() : mStorageEpoch(0) {}
  AltSvcCache() = default;
  virtual ~AltSvcCache() = default;
  void UpdateAltServiceMapping(
      AltSvcMapping* map, nsProxyInfo* pi, nsIInterfaceRequestor*,
@@ -207,7 +209,7 @@ class AltSvcCache {
  already_AddRefed<AltSvcMapping> LookupMapping(const nsCString& key,
                                                bool privateBrowsing);
  RefPtr<DataStorage> mStorage;
  int32_t mStorageEpoch;
  int32_t mStorageEpoch{0};
};

// This class is used to write the validated result to AltSvcMapping when the
+0 −5
Original line number Diff line number Diff line
@@ -52,11 +52,6 @@ bool ClassifierDummyChannelChild::Create(
  return true;
}

ClassifierDummyChannelChild::ClassifierDummyChannelChild()
    : mIsThirdParty(false) {}

ClassifierDummyChannelChild::~ClassifierDummyChannelChild() = default;

void ClassifierDummyChannelChild::Initialize(
    nsIHttpChannel* aChannel, nsIURI* aURI, bool aIsThirdParty,
    const std::function<void(bool)>& aCallback) {
+3 −3
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ class ClassifierDummyChannelChild final : public PClassifierDummyChannelChild {
                     const std::function<void(bool)>& aCallback);

  // Used by PNeckoChild only!
  ClassifierDummyChannelChild();
  ~ClassifierDummyChannelChild();
  ClassifierDummyChannelChild() = default;
  ~ClassifierDummyChannelChild() = default;

 private:
  void Initialize(nsIHttpChannel* aChannel, nsIURI* aURI, bool aIsThirdParty,
@@ -38,7 +38,7 @@ class ClassifierDummyChannelChild final : public PClassifierDummyChannelChild {
  nsCOMPtr<nsIHttpChannel> mChannel;
  nsCOMPtr<nsIURI> mURI;
  std::function<void(bool)> mCallback;
  bool mIsThirdParty;
  bool mIsThirdParty{false};
};

}  // namespace net
+0 −5
Original line number Diff line number Diff line
@@ -14,11 +14,6 @@
namespace mozilla {
namespace net {

ClassifierDummyChannelParent::ClassifierDummyChannelParent()
    : mIPCActive(true) {}

ClassifierDummyChannelParent::~ClassifierDummyChannelParent() = default;

void ClassifierDummyChannelParent::Init(nsIURI* aURI, nsIURI* aTopWindowURI,
                                        nsresult aTopWindowURIResult,
                                        nsILoadInfo* aLoadInfo) {
Loading