Bug 1608599 - Add preloaded status for requests in the Network panel r=valentin
authorsonakshi <sonakshisaxena1@gmail.com>
Wed, 25 Mar 2020 13:04:35 +0000
changeset 520373 0cdc6c8cee2d10b85c5752a66750e1d092d54f5d
parent 520372 6a06f90f4eb65efd5edda5c6f2e6d17a236c382c
child 520374 c5112a7573ac8a9d388e6253e3305061654b123e
push id111039
push uservalentin.gosu@gmail.com
push dateWed, 25 Mar 2020 13:11:06 +0000
treeherderautoland@0cdc6c8cee2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1608599
milestone76.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 1608599 - Add preloaded status for requests in the Network panel r=valentin Differential Revision: https://phabricator.services.mozilla.com/D67764
netwerk/base/LoadInfo.cpp
netwerk/base/TRRLoadInfo.cpp
netwerk/base/nsILoadInfo.idl
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -1642,16 +1642,22 @@ LoadInfo::GetCspEventListener(nsICSPEven
 }
 
 NS_IMETHODIMP
 LoadInfo::SetCspEventListener(nsICSPEventListener* aCSPEventListener) {
   mCSPEventListener = aCSPEventListener;
   return NS_OK;
 }
 
+NS_IMETHODIMP
+LoadInfo::GetInternalContentPolicyType(nsContentPolicyType* aResult) {
+  *aResult = mInternalContentPolicyType;
+  return NS_OK;
+}
+
 already_AddRefed<nsIContentSecurityPolicy> LoadInfo::GetCsp() {
   // Before querying the CSP from the client we have to check if the
   // triggeringPrincipal originates from an addon and potentially
   // overrides the CSP stored within the client.
   if (mLoadingPrincipal && BasePrincipal::Cast(mTriggeringPrincipal)
                                ->OverridesCSP(mLoadingPrincipal)) {
     nsCOMPtr<nsIExpandedPrincipal> ep = do_QueryInterface(mTriggeringPrincipal);
     nsCOMPtr<nsIContentSecurityPolicy> addonCSP;
--- a/netwerk/base/TRRLoadInfo.cpp
+++ b/netwerk/base/TRRLoadInfo.cpp
@@ -591,10 +591,16 @@ TRRLoadInfo::GetHttpsOnlyNoUpgrade(bool*
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 TRRLoadInfo::SetHttpsOnlyNoUpgrade(bool aHttpsOnlyNoUpgrade) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
+NS_IMETHODIMP
+TRRLoadInfo::GetInternalContentPolicyType(nsContentPolicyType* aResult) {
+  *aResult = mInternalContentPolicyType;
+  return NS_OK;
+}
+
 }  // namespace net
 }  // namespace mozilla
--- a/netwerk/base/nsILoadInfo.idl
+++ b/netwerk/base/nsILoadInfo.idl
@@ -552,18 +552,20 @@ interface nsILoadInfo : nsISupports
    * RequestContext values when creating a fetch event for an intercepted
    * channel.
    *
    * This should not be used for the purposes of security checks, since
    * the content policy implementations cannot be expected to deal with
    * _INTERNAL_ values.  Please use the contentPolicyType attribute above
    * for that purpose.
    */
-  [noscript, notxpcom]
-  nsContentPolicyType internalContentPolicyType();
+  [noscript, notxpcom, nostdcall, binaryname(InternalContentPolicyType)]
+  nsContentPolicyType binaryInternalContentPolicyType();
+
+  readonly attribute nsContentPolicyType internalContentPolicyType;
 
   /**
    * Returns true if document or any of the documents ancestors
    * up to the toplevel document make use of the CSP directive
    * 'block-all-mixed-content'.
    *
    * Warning: If the loadingDocument is null, then the
    * blockAllMixedContent is false.