Bug 1639247 - Isolate DNS cache per first-party when privacy.partition.network_state is set to true - part 3 - DNS originAttributes suffix in about:networking, r=valentin,fluent-reviewers,necko-reviewers,flod
☠☠ backed out by b45a70689704 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 20 May 2020 15:52:54 +0000
changeset 531273 48a854ee6710ee77fce1b7dc08799352d6ff3fdb
parent 531272 032d302608e4bcc7dcca45bf410041cdcb3a03f9
child 531274 3f8bd0042ec2f093ad1c712924816cc3c6ac6eb6
push id37436
push userncsoregi@mozilla.com
push dateWed, 20 May 2020 21:30:50 +0000
treeherdermozilla-central@6c10970490f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, fluent-reviewers, necko-reviewers, flod
bugs1639247
milestone78.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 1639247 - Isolate DNS cache per first-party when privacy.partition.network_state is set to true - part 3 - DNS originAttributes suffix in about:networking, r=valentin,fluent-reviewers,necko-reviewers,flod Differential Revision: https://phabricator.services.mozilla.com/D75986
dom/webidl/NetDashboard.webidl
netwerk/base/Dashboard.cpp
netwerk/base/DashboardTypes.h
netwerk/dns/nsHostResolver.cpp
toolkit/content/aboutNetworking.html
toolkit/content/aboutNetworking.js
toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl
--- a/dom/webidl/NetDashboard.webidl
+++ b/dom/webidl/NetDashboard.webidl
@@ -61,16 +61,17 @@ dictionary WebSocketDict {
 };
 
 dictionary DnsCacheEntry {
   DOMString hostname = "";
   sequence<DOMString> hostaddr;
   DOMString family = "";
   double expiration = 0;
   boolean trr = false;
+  DOMString originAttributesSuffix = "";
 };
 
 [GenerateConversionToJS]
 dictionary DNSCacheDict {
   sequence<DnsCacheEntry> entries;
 };
 
 [GenerateConversionToJS]
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -665,16 +665,19 @@ nsresult Dashboard::GetDNSCacheEntries(D
       CopyASCIItoUTF16(dnsData->mData[i].hostaddr[j], *addr);
     }
 
     if (dnsData->mData[i].family == PR_AF_INET6) {
       entry.mFamily.AssignLiteral(u"ipv6");
     } else {
       entry.mFamily.AssignLiteral(u"ipv4");
     }
+
+    entry.mOriginAttributesSuffix =
+        NS_ConvertUTF8toUTF16(dnsData->mData[i].originAttributesSuffix);
   }
 
   JS::RootedValue val(cx);
   if (!ToJSValue(cx, dict, &val)) {
     return NS_ERROR_FAILURE;
   }
   dnsData->mCallback->OnDashboardDataAvailable(val);
 
--- a/netwerk/base/DashboardTypes.h
+++ b/netwerk/base/DashboardTypes.h
@@ -27,16 +27,17 @@ struct HalfOpenSockets {
 
 struct DNSCacheEntries {
   nsCString hostname;
   nsTArray<nsCString> hostaddr;
   uint16_t family;
   int64_t expiration;
   nsCString netInterface;
   bool TRR;
+  nsCString originAttributesSuffix;
 };
 
 struct HttpConnInfo {
   uint32_t ttl;
   uint32_t rtt;
   nsString protocolVersion;
 
   void SetHTTPProtocolVersion(HttpVersion pv);
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -2295,14 +2295,16 @@ void nsHostResolver::GetDNSCacheEntries(
         addrElement = addrElement->getNext();
         if (addrElement) {
           addr = &addrElement->mAddress;
         }
       }
       info.TRR = addrRec->addr_info->IsTRR();
     }
 
+    info.originAttributesSuffix = iter.Key().originSuffix;
+
     args->AppendElement(std::move(info));
   }
 }
 
 #undef LOG
 #undef LOG_ENABLED
--- a/toolkit/content/aboutNetworking.html
+++ b/toolkit/content/aboutNetworking.html
@@ -97,16 +97,17 @@
               <table>
                   <thead>
                       <tr>
                           <th data-l10n-id="about-networking-hostname"/>
                           <th data-l10n-id="about-networking-family"/>
                           <th data-l10n-id="about-networking-trr"/>
                           <th data-l10n-id="about-networking-addresses"/>
                           <th data-l10n-id="about-networking-expires"/>
+                          <th data-l10n-id="about-networking-originAttributesSuffix"/>
                       </tr>
                   </thead>
                   <tbody id="dns_content" />
               </table>
           </div>
 
           <div id="websockets" class="tab" hidden="true">
               <table>
--- a/toolkit/content/aboutNetworking.js
+++ b/toolkit/content/aboutNetworking.js
@@ -119,16 +119,17 @@ function displayDns(data) {
 
     for (let j = 0; j < data.entries[i].hostaddr.length; j++) {
       column.appendChild(document.createTextNode(data.entries[i].hostaddr[j]));
       column.appendChild(document.createElement("br"));
     }
 
     row.appendChild(column);
     row.appendChild(col(data.entries[i].expiration));
+    row.appendChild(col(data.entries[i].originAttributesSuffix));
     new_cont.appendChild(row);
   }
 
   parent.replaceChild(new_cont, cont);
 }
 
 function displayWebsockets(data) {
   let cont = document.getElementById("websockets_content");
--- a/toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutNetworking.ftl
@@ -19,16 +19,17 @@ about-networking-idle = Idle
 about-networking-host = Host
 about-networking-tcp = TCP
 about-networking-sent = Sent
 about-networking-received = Received
 about-networking-family = Family
 about-networking-trr = TRR
 about-networking-addresses = Addresses
 about-networking-expires = Expires (Seconds)
+about-networking-originAttributesSuffix = Isolation Key
 about-networking-messages-sent = Messages Sent
 about-networking-messages-received = Messages Received
 about-networking-bytes-sent = Bytes Sent
 about-networking-bytes-received = Bytes Received
 about-networking-logging = Logging
 about-networking-log-tutorial =
     See <a data-l10n-name="logging">HTTP Logging</a>
     for instructions on how to use this tool.