Bug 1639247 - Isolate DNS cache per first-party when privacy.partition.network_state is set to true - part 4 - DNS originAttributes suffix in about:networking, r=valentin,fluent-reviewers,necko-reviewers,flod
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 20 May 2020 16:46:26 +0000
changeset 531317 84e6e0fcbd3575c29cf238050d61a59b34c7673c
parent 531316 ab42c2dd3b435e2f8fe4d367963cbb90c6b21e95
child 531318 a8d65c8b993b73d3b04722875fc4b61e0f768f46
push id37437
push usernerli@mozilla.com
push dateThu, 21 May 2020 02:34:41 +0000
treeherdermozilla-central@3d91ba9e1d25 [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 4 - 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.