Bug 1507540 part 3. Use more notxpcom attributes in netwerk/. r=valentin
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 19 Nov 2018 20:17:53 -0500
changeset 503589 52d07c32fa7c1f4114be113fc857484ed20a1630
parent 503588 a1e826769668287bd7250e85fa529a6c66bfb495
child 503590 5cdbce9b4a51adadd43a80440cc451cf4b9b85a5
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1507540
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507540 part 3. Use more notxpcom attributes in netwerk/. r=valentin
caps/nsScriptSecurityManager.cpp
ipc/glue/BackgroundUtils.cpp
netwerk/base/LoadInfo.cpp
netwerk/base/RequestContextService.cpp
netwerk/base/nsILoadInfo.idl
netwerk/base/nsIProtocolProxyService.idl
netwerk/base/nsIRequestContext.idl
netwerk/base/nsLoadGroup.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/socket/nsISSLSocketControl.idl
security/manager/ssl/nsNSSCallbacks.cpp
security/manager/ssl/nsNSSIOLayer.cpp
security/manager/ssl/nsNSSIOLayer.h
toolkit/components/antitracking/AntiTrackingCommon.cpp
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -345,22 +345,24 @@ nsScriptSecurityManager::GetChannelResul
   if (owner) {
     CallQueryInterface(owner, aPrincipal);
     if (*aPrincipal) {
       return NS_OK;
     }
   }
 
   if (loadInfo) {
-        if (!aIgnoreSandboxing && loadInfo->GetLoadingSandboxed()) {
-          MOZ_ALWAYS_TRUE(NS_SUCCEEDED(loadInfo->GetSandboxedLoadingPrincipal(aPrincipal)));
-          MOZ_ASSERT(*aPrincipal);
-          InheritAndSetCSPOnPrincipalIfNeeded(aChannel, *aPrincipal);
-          return NS_OK;
-        }
+    if (!aIgnoreSandboxing && loadInfo->GetLoadingSandboxed()) {
+      nsCOMPtr<nsIPrincipal> sandboxedLoadingPrincipal =
+        loadInfo->GetSandboxedLoadingPrincipal();
+      MOZ_ASSERT(sandboxedLoadingPrincipal);
+      InheritAndSetCSPOnPrincipalIfNeeded(aChannel, sandboxedLoadingPrincipal);
+      sandboxedLoadingPrincipal.forget(aPrincipal);
+      return NS_OK;
+    }
 
     bool forceInherit = loadInfo->GetForceInheritPrincipal();
     if (aIgnoreSandboxing && !forceInherit) {
       // Check if SEC_FORCE_INHERIT_PRINCIPAL was dropped because of
       // sandboxing:
       if (loadInfo->GetLoadingSandboxed() &&
         loadInfo->GetForceInheritPrincipalDropped()) {
         forceInherit = true;
--- a/ipc/glue/BackgroundUtils.cpp
+++ b/ipc/glue/BackgroundUtils.cpp
@@ -324,39 +324,35 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoa
                                   &principalToInheritInfoTemp);
     NS_ENSURE_SUCCESS(rv, rv);
     principalToInheritInfo = principalToInheritInfoTemp;
   }
 
   OptionalPrincipalInfo sandboxedLoadingPrincipalInfo = mozilla::void_t();
   if (aLoadInfo->GetLoadingSandboxed()) {
     PrincipalInfo sandboxedLoadingPrincipalInfoTemp;
-    nsCOMPtr<nsIPrincipal> sandboxedLoadingPrincipal;
-    rv = aLoadInfo->GetSandboxedLoadingPrincipal(
-        getter_AddRefs(sandboxedLoadingPrincipal));
-    NS_ENSURE_SUCCESS(rv, rv);
-    rv = PrincipalToPrincipalInfo(sandboxedLoadingPrincipal,
+    rv = PrincipalToPrincipalInfo(aLoadInfo->GetSandboxedLoadingPrincipal(),
                                   &sandboxedLoadingPrincipalInfoTemp);
     NS_ENSURE_SUCCESS(rv, rv);
     sandboxedLoadingPrincipalInfo = sandboxedLoadingPrincipalInfoTemp;
   }
 
   OptionalPrincipalInfo topLevelPrincipalInfo = mozilla::void_t();
-  if (aLoadInfo->TopLevelPrincipal()) {
+  if (aLoadInfo->GetTopLevelPrincipal()) {
     PrincipalInfo topLevelPrincipalInfoTemp;
-    rv = PrincipalToPrincipalInfo(aLoadInfo->TopLevelPrincipal(),
+    rv = PrincipalToPrincipalInfo(aLoadInfo->GetTopLevelPrincipal(),
                                   &topLevelPrincipalInfoTemp);
     NS_ENSURE_SUCCESS(rv, rv);
     topLevelPrincipalInfo = topLevelPrincipalInfoTemp;
   }
 
   OptionalPrincipalInfo topLevelStorageAreaPrincipalInfo = mozilla::void_t();
-  if (aLoadInfo->TopLevelStorageAreaPrincipal()) {
+  if (aLoadInfo->GetTopLevelStorageAreaPrincipal()) {
     PrincipalInfo topLevelStorageAreaPrincipalInfoTemp;
-    rv = PrincipalToPrincipalInfo(aLoadInfo->TopLevelStorageAreaPrincipal(),
+    rv = PrincipalToPrincipalInfo(aLoadInfo->GetTopLevelStorageAreaPrincipal(),
                                   &topLevelStorageAreaPrincipalInfoTemp);
     NS_ENSURE_SUCCESS(rv, rv);
     topLevelStorageAreaPrincipalInfo = topLevelStorageAreaPrincipalInfoTemp;
   }
 
   OptionalURIParams optionalResultPrincipalURI = mozilla::void_t();
   nsCOMPtr<nsIURI> resultPrincipalURI;
   Unused << aLoadInfo->GetResultPrincipalURI(getter_AddRefs(resultPrincipalURI));
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -679,62 +679,45 @@ LoadInfo::FindPrincipalToInherit(nsIChan
   if (!uri) {
     Unused << aChannel->GetOriginalURI(getter_AddRefs(uri));
   }
 
   auto prin = BasePrincipal::Cast(mTriggeringPrincipal);
   return prin->PrincipalToInherit(uri);
 }
 
-NS_IMETHODIMP
-LoadInfo::GetSandboxedLoadingPrincipal(nsIPrincipal** aPrincipal)
+nsIPrincipal*
+LoadInfo::GetSandboxedLoadingPrincipal()
 {
   if (!(mSecurityFlags & nsILoadInfo::SEC_SANDBOXED)) {
-    *aPrincipal = nullptr;
-    return NS_OK;
+    return nullptr;
   }
 
   if (!mSandboxedLoadingPrincipal) {
     if (mLoadingPrincipal) {
       mSandboxedLoadingPrincipal =
         NullPrincipal::CreateWithInheritedAttributes(mLoadingPrincipal);
     } else {
       OriginAttributes attrs(mOriginAttributes);
       mSandboxedLoadingPrincipal = NullPrincipal::Create(attrs);
     }
   }
   MOZ_ASSERT(mSandboxedLoadingPrincipal);
 
-  nsCOMPtr<nsIPrincipal> copy(mSandboxedLoadingPrincipal);
-  copy.forget(aPrincipal);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-LoadInfo::GetTopLevelPrincipal(nsIPrincipal** aTopLevelPrincipal)
-{
-  NS_IF_ADDREF(*aTopLevelPrincipal = mTopLevelPrincipal);
-  return NS_OK;
+  return mSandboxedLoadingPrincipal;
 }
 
 nsIPrincipal*
-LoadInfo::TopLevelPrincipal()
+LoadInfo::GetTopLevelPrincipal()
 {
   return mTopLevelPrincipal;
 }
 
-NS_IMETHODIMP
-LoadInfo::GetTopLevelStorageAreaPrincipal(nsIPrincipal** aTopLevelStorageAreaPrincipal)
-{
-  NS_IF_ADDREF(*aTopLevelStorageAreaPrincipal = mTopLevelStorageAreaPrincipal);
-  return NS_OK;
-}
-
 nsIPrincipal*
-LoadInfo::TopLevelStorageAreaPrincipal()
+LoadInfo::GetTopLevelStorageAreaPrincipal()
 {
   return mTopLevelStorageAreaPrincipal;
 }
 
 NS_IMETHODIMP
 LoadInfo::GetLoadingDocument(nsIDocument** aResult)
 {
   nsCOMPtr<nsINode> node = do_QueryReferent(mLoadingContext);
--- a/netwerk/base/RequestContextService.cpp
+++ b/netwerk/base/RequestContextService.cpp
@@ -181,50 +181,44 @@ RequestContext::RemoveBlockingTransactio
   NS_ENSURE_ARG_POINTER(outval);
   mBlockingTransactionCount--;
   LOG(("RequestContext::RemoveBlockingTransaction this=%p blockers=%u",
        this, static_cast<uint32_t>(mBlockingTransactionCount)));
   *outval = mBlockingTransactionCount;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-RequestContext::GetSpdyPushCache(mozilla::net::SpdyPushCache **aSpdyPushCache)
+SpdyPushCache*
+RequestContext::GetSpdyPushCache()
 {
-  *aSpdyPushCache = mSpdyCache.get();
-  return NS_OK;
+  return mSpdyCache;
 }
 
-NS_IMETHODIMP
-RequestContext::SetSpdyPushCache(mozilla::net::SpdyPushCache *aSpdyPushCache)
+void
+RequestContext::SetSpdyPushCache(SpdyPushCache *aSpdyPushCache)
 {
   mSpdyCache = aSpdyPushCache;
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-RequestContext::GetID(uint64_t *outval)
+uint64_t
+RequestContext::GetID()
 {
-  NS_ENSURE_ARG_POINTER(outval);
-  *outval = mID;
-  return NS_OK;
+  return mID;
 }
 
-NS_IMETHODIMP
-RequestContext::GetUserAgentOverride(nsACString& aUserAgentOverride)
+const nsACString&
+RequestContext::GetUserAgentOverride()
 {
-  aUserAgentOverride = mUserAgentOverride;
-  return NS_OK;
+  return mUserAgentOverride;
 }
 
-NS_IMETHODIMP
+void
 RequestContext::SetUserAgentOverride(const nsACString& aUserAgentOverride)
 {
   mUserAgentOverride = aUserAgentOverride;
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 RequestContext::AddNonTailRequest()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ++mNonTailRequests;
--- a/netwerk/base/nsILoadInfo.idl
+++ b/netwerk/base/nsILoadInfo.idl
@@ -879,42 +879,30 @@ interface nsILoadInfo : nsISupports
   attribute nsIURI resultPrincipalURI;
 
   /**
    * Returns the null principal of the resulting resource if the SEC_SANDBOXED
    * flag is set.  Otherwise returns null.  This is used by
    * GetChannelResultPrincipal() to ensure that the same null principal object
    * is returned every time.
    */
-  [noscript] readonly attribute nsIPrincipal sandboxedLoadingPrincipal;
+  [notxpcom, nostdcall] readonly attribute nsIPrincipal sandboxedLoadingPrincipal;
 
   /**
    * Return the top-level principal, which is the principal of the top-level
    * window.
    */
-  [noscript] readonly attribute nsIPrincipal topLevelPrincipal;
-
-  /**
-   * A C++-friendly version of topLevelPrincipal.
-   */
-  [noscript, notxpcom, nostdcall, binaryname(TopLevelPrincipal)]
-  nsIPrincipal binaryTopLevelPrincipal();
+  [notxpcom, nostdcall] readonly attribute nsIPrincipal topLevelPrincipal;
 
   /**
    * Return the top-level storage area principal, which is the principal of
    * the top-level window if it's not a 3rd party context, non tracking
    * resource.
    */
-  [noscript] readonly attribute nsIPrincipal topLevelStorageAreaPrincipal;
-
-  /**
-   * A C++-friendly version of topLevelStorageAreaPrincipal.
-   */
-  [noscript, notxpcom, nostdcall, binaryname(TopLevelStorageAreaPrincipal)]
-  nsIPrincipal binaryTopLevelStorageAreaPrincipal();
+  [notxpcom, nostdcall] readonly attribute nsIPrincipal topLevelStorageAreaPrincipal;
 
   /**
    * Note which client (i.e. global) initiated this network request.  All
    * nsGlobalWindow and WorkerPrivate can be converted to a ClientInfo to
    * be set here.  While this is being added to support service worker
    * FetchEvent, it can also be used to communicate other information about
    * the source global context in the future.
    */
--- a/netwerk/base/nsIProtocolProxyService.idl
+++ b/netwerk/base/nsIProtocolProxyService.idl
@@ -281,10 +281,10 @@ interface nsIProtocolProxyService : nsIS
      /**
       * This attribute specifies the current type of proxy configuration.
       */
      readonly attribute unsigned long proxyConfigType;
 
      /**
       * True if there is a PAC download in progress.
       */
-    [noscript] readonly attribute boolean isPACLoading;
+    [notxpcom, nostdcall] readonly attribute boolean isPACLoading;
 };
--- a/netwerk/base/nsIRequestContext.idl
+++ b/netwerk/base/nsIRequestContext.idl
@@ -49,17 +49,17 @@ interface nsIRequestTailUnblockCallback 
  * This used to be known as nsILoadGroupConnectionInfo and nsISchedulingContext.
  */
 [scriptable, uuid(658e3e6e-8633-4b1a-8d66-fa9f72293e63)]
 interface nsIRequestContext : nsISupports
 {
   /**
    * A unique identifier for this request context
    */
-  [noscript] readonly attribute unsigned long long ID;
+  [notxpcom, nostdcall] readonly attribute unsigned long long ID;
 
   /**
    * Called by the associated document when its load starts.  This resets
    * context's internal states.
    */
   void beginLoad();
 
   /**
@@ -86,22 +86,22 @@ interface nsIRequestContext : nsISupport
   unsigned long removeBlockingTransaction();
 
   /**
    * This gives out a weak pointer to the push cache.
    * The nsIRequestContext implementation owns the cache
    * and will destroy it when overwritten or when the context
    * ends.
    */
-  [noscript] attribute SpdyPushCachePtr spdyPushCache;
+  [notxpcom,nostdcall] attribute SpdyPushCachePtr spdyPushCache;
 
   /**
    * This holds a cached value of the user agent override.
    */
-  [noscript] attribute ACString userAgentOverride;
+  [notxpcom,nostdcall] attribute ACString userAgentOverride;
 
   /**
    * Increases/decrease the number of non-tailed requests in this context.
    * If the count drops to zero, all tail-blocked callbacks are notified
    * shortly after that to be unblocked.
    */
   void addNonTailRequest();
   void removeNonTailRequest();
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -121,19 +121,17 @@ nsLoadGroup::nsLoadGroup(nsISupports* ou
 nsLoadGroup::~nsLoadGroup()
 {
     DebugOnly<nsresult> rv = Cancel(NS_BINDING_ABORTED);
     NS_ASSERTION(NS_SUCCEEDED(rv), "Cancel failed");
 
     mDefaultLoadRequest = nullptr;
 
     if (mRequestContext) {
-        uint64_t rcid;
-        mRequestContext->GetID(&rcid);
-        mRequestContextService->RemoveRequestContext(rcid);
+        mRequestContextService->RemoveRequestContext(mRequestContext->GetID());
     }
 
     LOG(("LOADGROUP [%p]: Destroyed.\n", this));
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports methods:
@@ -698,17 +696,18 @@ nsLoadGroup::SetNotificationCallbacks(ns
 }
 
 NS_IMETHODIMP
 nsLoadGroup::GetRequestContextID(uint64_t *aRCID)
 {
     if (!mRequestContext) {
         return NS_ERROR_NOT_AVAILABLE;
     }
-    return mRequestContext->GetID(aRCID);
+    *aRCID = mRequestContext->GetID();
+    return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsILoadGroupChild methods:
 
 NS_IMETHODIMP
 nsLoadGroup::GetParentLoadGroup(nsILoadGroup * *aParentLoadGroup)
 {
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -2542,22 +2542,16 @@ nsProtocolProxyService::PruneProxyInfo(c
     if (head && !head->mNext && head->mType == kProxyType_DIRECT)
         NS_RELEASE(head);
 
     *list = head;  // Transfer ownership
 
     LOG(("nsProtocolProxyService::PruneProxyInfo LEAVE list=%p", *list));
 }
 
-NS_IMETHODIMP
-nsProtocolProxyService::GetIsPACLoading(bool *aResult)
+bool
+nsProtocolProxyService::GetIsPACLoading()
 {
-    NS_ENSURE_ARG_POINTER(aResult);
-
-    *aResult = false;
-    if (mPACMan && mPACMan->IsLoading()) {
-        *aResult = true;
-    }
-    return NS_OK;
+    return mPACMan && mPACMan->IsLoading();
 }
 
 } // namespace net
-} // namespace mozilla
\ No newline at end of file
+} // namespace mozilla
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -1261,18 +1261,17 @@ Http2Session::CleanupStream(Http2Stream 
     if (!(id & 1)) {
       mPushedStreams.RemoveElement(aStream);
       Http2PushedStream *pushStream = static_cast<Http2PushedStream *>(aStream);
       nsAutoCString hashKey;
       DebugOnly<bool> rv = pushStream->GetHashKey(hashKey);
       MOZ_ASSERT(rv);
       nsIRequestContext *requestContext = aStream->RequestContext();
       if (requestContext) {
-        SpdyPushCache *cache = nullptr;
-        requestContext->GetSpdyPushCache(&cache);
+        SpdyPushCache *cache = requestContext->GetSpdyPushCache();
         if (cache) {
           // Make sure the id of the stream in the push cache is the same
           // as the id of the stream we're cleaning up! See bug 1368080.
           Http2PushedStream *trash = cache->RemovePushedStreamHttp2ByID(hashKey, aStream->StreamID());
           LOG3(("Http2Session::CleanupStream %p aStream=%p pushStream=%p trash=%p",
                 this, aStream, pushStream, trash));
         }
       }
@@ -1876,23 +1875,20 @@ Http2Session::RecvPushPromise(Http2Sessi
     LOG3(("Http2Session::RecvPushPromise %p lookup associated ID failed.\n", self));
     self->GenerateRstStream(PROTOCOL_ERROR, promisedID);
   } else if (Http2PushedStream::TestOnPush(associatedStream)) {
     LOG3(("Http2Session::RecvPushPromise %p will be handled by push listener.", self));
     resetStream = false;
   } else {
     nsIRequestContext *requestContext = associatedStream->RequestContext();
     if (requestContext) {
-      requestContext->GetSpdyPushCache(&cache);
+      cache = requestContext->GetSpdyPushCache();
       if (!cache) {
         cache = new SpdyPushCache();
-        if (!cache || NS_FAILED(requestContext->SetSpdyPushCache(cache))) {
-          delete cache;
-          cache = nullptr;
-        }
+        requestContext->SetSpdyPushCache(cache);
       }
     }
     if (!cache) {
       // this is unexpected, but we can handle it just by refusing the push
       LOG3(("Http2Session::RecvPushPromise Push Recevied without push cache\n"));
       self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
     } else {
       resetStream = false;
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -462,17 +462,17 @@ Http2Stream::ParseHttpRequestHeaders(con
                     mOrigin, hashkey);
 
   // check the push cache for GET
   if (head->IsGet()) {
     // from :scheme, :authority, :path
     nsIRequestContext *requestContext = mTransaction->RequestContext();
     SpdyPushCache *cache = nullptr;
     if (requestContext) {
-      requestContext->GetSpdyPushCache(&cache);
+      cache = requestContext->GetSpdyPushCache();
     }
 
     Http2PushedStream *pushedStream = nullptr;
 
     // If a push stream is attached to the transaction via onPush, match only with that
     // one. This occurs when a push was made with in conjunction with a nsIHttpPushListener
     nsHttpTransaction *trans = mTransaction->QueryHttpTransaction();
     if (trans && (pushedStream = trans->TakePushedStream())) {
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -9396,18 +9396,18 @@ nsHttpChannel::SetLoadGroupUserAgentOver
             GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
             rc->SetUserAgentOverride(ua);
         }
     } else {
         GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
         // Don't overwrite the UA if it is already set (eg by an XHR with explicit UA).
         if (ua.IsEmpty()) {
             if (rc) {
-                rc->GetUserAgentOverride(ua);
-                SetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua, false);
+                SetRequestHeader(NS_LITERAL_CSTRING("User-Agent"),
+                                 rc->GetUserAgentOverride(), false);
             } else {
                 gHttpHandler->OnUserAgentRequest(this);
             }
         }
     }
 }
 
 // Step 10 of HTTP-network-or-cache fetch
--- a/netwerk/socket/nsISSLSocketControl.idl
+++ b/netwerk/socket/nsISSLSocketControl.idl
@@ -129,17 +129,17 @@ interface nsISSLSocketControl : nsISuppo
     const short SSL_MAC_AEAD    = 6;
 
     [infallible] readonly attribute short MACAlgorithmUsed;
 
     /**
      * If set to true before the server requests a client cert
      * no cert will be sent.
      */
-    [noscript] attribute boolean denyClientCert;
+    [notxpcom, nostdcall] attribute boolean denyClientCert;
 
     /**
      * If set before the server requests a client cert (assuming it does so at
      * all), then this cert will be presented to the server, instead of asking
      * the user or searching the set of rememebered user cert decisions.
      */
     attribute nsIX509Cert clientCert;
 
--- a/security/manager/ssl/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/nsNSSCallbacks.cpp
@@ -240,23 +240,17 @@ OCSPRequest::Run()
   // See bug 1219935.
   // We should not send OCSP request if the PAC is still loading.
   nsCOMPtr<nsIProtocolProxyService> pps =
     do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     return NotifyDone(rv, lock);
   }
 
-  bool isPACLoading = false;
-  rv = pps->GetIsPACLoading(&isPACLoading);
-  if (NS_FAILED(rv)) {
-    return NotifyDone(rv, lock);
-  }
-
-  if (isPACLoading) {
+  if (pps->GetIsPACLoading()) {
     return NotifyDone(NS_ERROR_FAILURE, lock);
   }
 
   nsCOMPtr<nsIChannel> channel;
   rv = ios->NewChannel2(mAIALocation,
                         nullptr,
                         nullptr,
                         nullptr, // aLoadingNode
--- a/security/manager/ssl/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/nsNSSIOLayer.cpp
@@ -401,28 +401,26 @@ nsNSSSocketInfo::GetEarlyDataAccepted(bo
 }
 
 void
 nsNSSSocketInfo::SetEarlyDataAccepted(bool aAccepted)
 {
   mEarlyDataAccepted = aAccepted;
 }
 
-NS_IMETHODIMP
-nsNSSSocketInfo::GetDenyClientCert(bool* aDenyClientCert)
+bool
+nsNSSSocketInfo::GetDenyClientCert()
 {
-  *aDenyClientCert = mDenyClientCert;
-  return NS_OK;
+  return  mDenyClientCert;
 }
 
-NS_IMETHODIMP
+void
 nsNSSSocketInfo::SetDenyClientCert(bool aDenyClientCert)
 {
   mDenyClientCert = aDenyClientCert;
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSSocketInfo::DriveHandshake()
 {
   if (!mFd) {
     return NS_ERROR_FAILURE;
   }
--- a/security/manager/ssl/nsNSSIOLayer.h
+++ b/security/manager/ssl/nsNSSIOLayer.h
@@ -69,17 +69,16 @@ public:
   void SetFalseStarted() { mFalseStarted = true; }
 
   // Note that this is only valid *during* a handshake; at the end of the handshake,
   // it gets reset back to false.
   void SetFullHandshake() { mIsFullHandshake = true; }
   bool IsFullHandshake() const { return mIsFullHandshake; }
 
   bool GetJoined() { return mJoined; }
-  bool GetDenyClientCert() { return mDenyClientCert; }
   void SetSentClientCert() { mSentClientCert = true; }
 
   uint32_t GetProviderFlags() const { return mProviderFlags; }
   uint32_t GetProviderTlsFlags() const { return mProviderTlsFlags; }
 
   mozilla::psm::SharedSSLState& SharedState();
 
   // XXX: These are only used on for diagnostic purposes
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -876,17 +876,17 @@ AntiTrackingCommon::IsFirstPartyStorageA
   if (!loadInfo) {
     LOG(("No loadInfo, bail out early"));
     return true;
   }
 
   // We need to find the correct principal to check the cookie permission. For
   // third-party contexts, we want to check if the top-level window has a custom
   // cookie permission.
-  nsIPrincipal* toplevelPrincipal = loadInfo->TopLevelPrincipal();
+  nsIPrincipal* toplevelPrincipal = loadInfo->GetTopLevelPrincipal();
 
   // If this is already the top-level window, we should use the loading
   // principal.
   if (!toplevelPrincipal) {
     LOG(("Our loadInfo lacks a top-level principal, use the loadInfo's loading principal instead"));
     toplevelPrincipal = loadInfo->LoadingPrincipal();
   }
 
@@ -1001,23 +1001,23 @@ AntiTrackingCommon::IsFirstPartyStorageA
   MOZ_ASSERT(behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER);
 
   // Not a tracker.
   if (!aChannel->GetIsTrackingResource()) {
     LOG(("Our channel isn't a tracking channel"));
     return true;
   }
 
-  nsIPrincipal* parentPrincipal = loadInfo->TopLevelStorageAreaPrincipal();
+  nsIPrincipal* parentPrincipal = loadInfo->GetTopLevelStorageAreaPrincipal();
   if (!parentPrincipal) {
     LOG(("No top-level storage area principal at hand"));
 
     // parentPrincipal can be null if the parent window is not the top-level
     // window.
-    if (loadInfo->TopLevelPrincipal()) {
+    if (loadInfo->GetTopLevelPrincipal()) {
       LOG(("Parent window is the top-level window, bail out early"));
       return false;
     }
 
     parentPrincipal = toplevelPrincipal;
     if (NS_WARN_IF(!parentPrincipal)) {
       LOG(("No triggering principal, this shouldn't be happening! Bail out early"));
       // Why we are here?!?