Isolate DNS Cache using Origin Attributes

RESOLVED FIXED in Firefox 55

Status

()

defect
P1
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: tjr, Assigned: timhuang)

Tracking

Trunk
mozilla55
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox54 wontfix, firefox55 fixed)

Details

(Whiteboard: [OA][tor][necko-backlog])

Attachments

(5 attachments)

Reporter

Description

2 years ago
No description provided.

Updated

2 years ago
Priority: -- → P1
Assignee

Updated

2 years ago
Assignee: nobody → tihuang
Whiteboard: [OA][tor] → [OA][tor][necko-backlog]
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Attachment #8839946 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8839947 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8839948 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8839950 - Flags: review?(mcmanus) → review?(valentin.gosu)

Comment 6

2 years ago
mozreview-review
Comment on attachment 8839946 [details]
Bug 1337893 - Part 1: Updating idl and ipdl files of DNS to make them originAttributes aware.

https://reviewboard.mozilla.org/r/114516/#review116126

::: netwerk/dns/nsIDNSService.idl:49
(Diff revision 1)
>       *        listener's onLookupComplete should be called.  however, if this
>       *        parameter is null, then onLookupComplete will be called on an
>       *        unspecified thread (possibly recursively).
> +     * @param aOriginAttributes
> +     *        the originAttribute for this resolving, the DNS cache will be separated
> +     *        according to this originAttributes. This attribute is optional to avoid

nit: try to keep these lines under 80 chars.

::: netwerk/dns/nsIDNSService.idl:49
(Diff revision 1)
>       *        listener's onLookupComplete should be called.  however, if this
>       *        parameter is null, then onLookupComplete will be called on an
>       *        unspecified thread (possibly recursively).
> +     * @param aOriginAttributes
> +     *        the originAttribute for this resolving, the DNS cache will be separated
> +     *        according to this originAttributes. This attribute is optional to avoid

nit: try to keep these lines under 80 chars.
Attachment #8839946 - Flags: review?(valentin.gosu) → review+

Comment 7

2 years ago
mozreview-review
Comment on attachment 8839947 [details]
Bug 1337893 - Part 2: Making the DNS cache be aware of originAttributes.

https://reviewboard.mozilla.org/r/114518/#review116362

::: netwerk/dns/ChildDNSService.cpp:95
(Diff revision 1)
> +                              uint8_t            aArgc,
>                                nsICancelable    **result)
>  {
> -  return AsyncResolveExtended(hostname, flags, EmptyCString(), listener,
> -                              target_, result);
> +  OriginAttributes attrs;
> +
> +  if (aArgc == 1) {

aArgc is the number of optional arguments, right?
Presumably after we deprecate xpcom addons, we can make OA non-optional. We should have a bug for that after we land this.
Attachment #8839947 - Flags: review?(valentin.gosu) → review+

Comment 8

2 years ago
mozreview-review
Comment on attachment 8839948 [details]
Bug 1337893 - Part 3: Updating Necko for DNS changes.

https://reviewboard.mozilla.org/r/114520/#review116364
Attachment #8839948 - Flags: review?(valentin.gosu) → review+

Comment 9

2 years ago
mozreview-review
Comment on attachment 8839950 [details]
Bug 1337893 - Part 5: Add a test case for DNS with originAttributes.

https://reviewboard.mozilla.org/r/114524/#review116366
Attachment #8839950 - Flags: review?(valentin.gosu) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Attachment #8839948 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8839947 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8839946 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8839950 - Flags: review?(mcmanus) → review?(valentin.gosu)
Assignee

Comment 15

2 years ago
Sorry Patrick and Valentin, I forgot to modify the reviewer's name when I re-submitted a new version of patches, which makes the review board set review flags incorrectly.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Assignee

Updated

2 years ago
Attachment #8839946 - Flags: review?(valentin.gosu) → review+
Assignee

Updated

2 years ago
Attachment #8839947 - Flags: review?(valentin.gosu) → review+
Assignee

Updated

2 years ago
Attachment #8839948 - Flags: review?(valentin.gosu) → review+
Assignee

Updated

2 years ago
Attachment #8839950 - Flags: review?(valentin.gosu) → review+

Comment 21

2 years ago
mozreview-review
Comment on attachment 8839949 [details]
Bug 1337893 - Part 4: Updating whole gecko to make all callers of DNS using correct originAttributes.

https://reviewboard.mozilla.org/r/114522/#review119120

::: dom/html/nsHTMLDNSPrefetch.cpp:143
(Diff revision 3)
>      // considers empty strings to be valid hostnames
>      if (!hostname.IsEmpty() &&
>          net_IsValidHostName(NS_ConvertUTF16toUTF8(hostname))) {
>        // during shutdown gNeckoChild might be null
>        if (gNeckoChild) {
> -        gNeckoChild->SendHTMLDNSPrefetch(nsAutoString(hostname), flags);
> +        gNeckoChild->SendHTMLDNSPrefetch(nsAutoString(hostname),

nsString()

::: dom/html/nsHTMLDNSPrefetch.cpp:192
(Diff revision 3)
>      return NS_ERROR_NOT_AVAILABLE;
>  
>    nsAutoString hostname;
>    aElement->GetHostname(hostname);
> -  return CancelPrefetch(hostname, flags, aReason);
> +  return CancelPrefetch(hostname,
> +                        aElement->GetElement()

check that GetElement() is not null.

::: dom/html/nsHTMLDNSPrefetch.cpp:350
(Diff revision 3)
>          if (!hostName.IsEmpty() && NS_SUCCEEDED(rv) && !isLocalResource) {
>            if (IsNeckoChild()) {
>              // during shutdown gNeckoChild might be null
>              if (gNeckoChild) {
>                gNeckoChild->SendHTMLDNSPrefetch(NS_ConvertUTF8toUTF16(hostName),
> +                                               link->GetElement()

same here.

::: dom/html/nsHTMLDNSPrefetch.cpp:362
(Diff revision 3)
>  
> -            rv = sDNSService->AsyncResolve(hostName,
> +            rv = sDNSService->AsyncResolveNative(hostName,
> -                                           mEntries[mTail].mFlags
> +                                                 mEntries[mTail].mFlags
> -                                           | nsIDNSService::RESOLVE_SPECULATE,
> +                                                 | nsIDNSService::RESOLVE_SPECULATE,
> -                                           sDNSListener, nullptr,
> +                                                 sDNSListener, nullptr,
> +                                                 link->GetElement()

here as well

::: dom/html/nsHTMLDNSPrefetch.cpp:373
(Diff revision 3)
>                link->OnDNSPrefetchRequested();
>            }
>          }
>        }
>      }
>      

just because you are touching this file, do you mind to remove this extra spaces?
Attachment #8839949 - Flags: review?(amarchesini) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 28

2 years ago
Pushed by jhao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8ee0c21d462
Part 1: Updating idl and ipdl files of DNS to make them originAttributes aware. r=valentin
https://hg.mozilla.org/integration/autoland/rev/7405ef5589cc
Part 2: Making the DNS cache be aware of originAttributes. r=valentin
https://hg.mozilla.org/integration/autoland/rev/a98c0d18ca5e
Part 3: Updating Necko for DNS changes. r=valentin
https://hg.mozilla.org/integration/autoland/rev/2e4be7d6a0a8
Part 4: Updating whole gecko to make all callers of DNS using correct originAttributes. r=baku
https://hg.mozilla.org/integration/autoland/rev/a339ae7dcfa3
Part 5: Add a test case for DNS with originAttributes. r=valentin
You need to log in before you can comment on or make changes to this bug.