Commit Graph

814 Commits

Author SHA1 Message Date
Christoph Kerschbaumer
026a7442f3 Bug 1636900: Remove TYPE_XBL from nsIContentPolicy. r=remote-protocol-reviewers,emilio,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D74835
2020-05-13 06:53:28 +00:00
Alexandre Poirot
718bf89e62 Bug 1620966 - Move DocShell.watchedByDevtools to BrowsingContext and rename it to watchedByDevTools. r=nika,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D66037
2020-05-12 09:18:26 +00:00
Honza Bambas
ef0d4e6dd1 Bug 1618536 - Introduce nsIContentPolicy::TYPE_INTERNAL_FONT_PRELOAD representing preload of font, mapping to TYPE_FONT externally, r=baku
Depends on D69628

Differential Revision: https://phabricator.services.mozilla.com/D72118
2020-05-11 14:13:16 +00:00
Simon Giesecke
75c988ec13 Bug 1627892 - Use SafeRefPtr for Request. r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D70390
2020-05-11 12:13:48 +00:00
Simon Giesecke
32076b1063 Bug 1627892 - Make InternalRequest derive from SafeRefCounted. r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D69958
2020-05-11 12:10:53 +00:00
Simon Giesecke
61ad805d68 Bug 1626570 - Use CopyableTArray in ipdlc as member type for now. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D73685
2020-05-07 08:11:08 +00:00
Simon Giesecke
f43e7cfc99 Bug 1626570 - Improve handling of copying arrays in dom/fetch/. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D73652
2020-05-05 14:14:10 +00:00
Peter Van der Beken
6c885dbb71 Bug 1629390 - Don't crash when throwing exception with invalid UTF-8. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D73203
2020-04-30 10:25:58 +00:00
Csoregi Natalia
83cd8858fc Backed out changeset e1be97ce43d1 (bug 1622451) for failures on browser_download_canceled.js. CLOSED TREE 2020-05-01 03:58:25 +03:00
Perry Jiang
1ad4e039d4 Bug 1622451 - minimize stream copying across IPC boundaries r=asuth,baku
Initially, IPCInternal{Request,Response} had contained IPCStreams which would
result in unecessary copying when sending the objects over IPC. The patch
makes these streams either:

1) ParentToParentStream (just a UUID)
2) ParentToChildStream (a PIPCBlobInputStream actor, acting as a handle)
3) ChildToParentStream (a real IPCStream)

These three types are union-ed together by the BodyStreamVariant IPDL structure.
This structure replaces the IPCStream members in IPCInternal{Request,Response}
so that, depending on the particular IPDL protocol, we can avoid cloning streams
and just pass handles/IDs instead.

As a side effect, this makes file-backed Response objects cloneable. Initially,
these Responses would be backed by an nsFileInputStream, which is not cloneable
outside the parent process. They are now backed by IPCBlobInputStreams, which
are cloneable.

One thing that's not really satisfactory (IMO), is the manual management of
IPCBlobInputStreamStorage so that no streams are leaked, e.g. if we store a
stream in the IPCBlobInputStreamStorage but fail to send an IPC message and
therefore fail to remove the stream from storage on the other side of the IPC
boundary (only parent-to-parent in this case).

Differential Revision: https://phabricator.services.mozilla.com/D73173
2020-04-30 23:52:54 +00:00
Perry Jiang
3446310d6c Bug 1618546 - give worker debugger globals their own clients r=asuth,webidl,smaug
- Worker debugger globals gets a client with a null principal
- Ensure globals are created before script loads
- Introduce WorkerGlobalScopeBase to share code
- Transfer ClientSource ownership from WorkerPrivate to worker globals
- Require getting clients from the globals instead of WorkerPrivate with the
  exception of getting the reserved client before the non-debugger global is
  created

Differential Revision: https://phabricator.services.mozilla.com/D68936
2020-04-21 06:50:53 +00:00
Andrea Marchesini
1522741ef5 Bug 1629395 - Overwrite integrity attribute in fetch() is allowed, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D70798

--HG--
extra : moz-landing-system : lando
2020-04-14 11:09:06 +00:00
Andreas Farre
25ca8d7890 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
TabGroup never really made any difference in which thread something go
dispatched to. This was the intended use, but development of TabGroups
with abstract main threads never made it that far. The good thing is
that thish makes it safe to also remove to the SystemGroup and instead
switch all SystemGroup dispatches to dispatches to main thread.

Timers for setTimeout and workers were the sole users of wrapped and
throttled event targets, that those throttled queues have been moved
to the BrowsingContextGroup and are now accessed explicitly.

The SchedulerEventTarget has been removed, since there are no longer a
separate event target for every TaskCategory. Instead a
LabellingEventTarget has been added to DocGroup to handle the case
where an event is dispatched do DocGroup or when an AbstractThread is
created using a DocGroup. This means that we'll actually label more
events correctly with the DocGroup that they belong to.

DocGroups have also been moved to BrowsingContextGroup.

Depends on D67636

Differential Revision: https://phabricator.services.mozilla.com/D65936

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:47 +00:00
Eric Rahm
1fca90d61d Bug 1626441 - Remove nsAutoPtr usage from dom/fetch. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D69112

--HG--
extra : moz-landing-system : lando
2020-04-03 21:05:07 +00:00
Andrea Marchesini
6e5bd2d254 Bug 1402784 - Use nsIContentPolicy::TYPE_INTERNAL_AUDIOWORKLET and nsIContentPolicy::TYPE_INTERNAL_PAINTWORKLET in Worklet code, r=smaug
Depends on D67105

Differential Revision: https://phabricator.services.mozilla.com/D67106

--HG--
extra : moz-landing-system : lando
2020-03-17 22:24:39 +00:00
Andrea Marchesini
96d0e4f828 Bug 1402784 - Introduce nsIContentPolicy::TYPE_INTERNAL_AUDIOWORKLET and nsIContentPolicy::TYPE_INTERNAL_PAINTWORKLET, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D67105

--HG--
extra : moz-landing-system : lando
2020-03-17 11:29:33 +00:00
Perry Jiang
0e90b8bb8b Bug 1147178 - remove InternalResponse::mTerminationReason r=dom-workers-and-storage-reviewers,sg
The termination reason doesn't exist in the Fetch spec anymore. The member
variable isn't ever used either.

Differential Revision: https://phabricator.services.mozilla.com/D66539

--HG--
extra : moz-landing-system : lando
2020-03-12 08:50:22 +00:00
Mark Banner
15cfe23b88 Bug 1620542 - Automatically fix ESLint errors in .eslintrc.js files. r=mossop
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D65703

--HG--
extra : moz-landing-system : lando
2020-03-07 10:09:44 +00:00
Boris Zbarsky
00cd5d4380 Bug 1619112 part 5. Stop accepting nsAString in ErrorResult error-throwing. r=smaug
Callers should pass in UTF-8, since that's what the JS engine ends up with in the end anyway.

The various URL changes are because NS_NewURI converts incoming nsAString to
UTF-8 anyway.  So we might as well do that up-front and then use the UTF-8
string for both the NS_NewURI call and the error-reporting if it fails.

Differential Revision: https://phabricator.services.mozilla.com/D65543

--HG--
extra : moz-landing-system : lando
2020-03-06 21:08:02 +00:00
Boris Zbarsky
c878a8bb26 Bug 1619112 part 2. Pass char literals instead of char16_t literals into ErrorResult throwing methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65538

--HG--
extra : moz-landing-system : lando
2020-03-06 21:04:58 +00:00
Tim Huang
04d44bae12 Bug 1616570 - Part 1: Rename CookieSettings to CookieJarSettings. r=Ehsan
Given that we are going to add ContentBlockingAllowList in
CookieSettings, so CookieSettings will be responsible for more stuff than the
cookie behavior and cookie permission. We should use a proper name to
reflect the purpose of it. The name 'CookieSettings' is misleading that
this is only for cookie related stuff. So, we decide to rename
'CookieSettins' to 'CookieJarSettings' which serves better meaning here.

Differential Revision: https://phabricator.services.mozilla.com/D63935

--HG--
rename : netwerk/cookie/CookieSettings.cpp => netwerk/cookie/CookieJarSettings.cpp
rename : netwerk/cookie/nsICookieSettings.idl => netwerk/cookie/nsICookieJarSettings.idl
extra : moz-landing-system : lando
2020-03-04 08:59:08 +00:00
Simon Giesecke
daf97da936 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/fetch. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63165

--HG--
extra : moz-landing-system : lando
2020-02-20 16:53:06 +00:00
Simon Giesecke
b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli
91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Tom Schuster
9121200eb8 Bug 1614359 - Remove explicit initialization from Headers in Headers constructor. r=Ehsan
The Web IDL type for HeadersInit didn't match the definition in http://fetch.spec.whatwg.org/#headers-class.
The headers-basic tests makes it clear that this difference is observable.

Differential Revision: https://phabricator.services.mozilla.com/D62489

--HG--
extra : moz-landing-system : lando
2020-02-11 22:25:58 +00:00
Boris Zbarsky
05327f8a52 Bug 1613978. Allow passing u"...", not just nsAStrings, to templated ThrowType/RangeError. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D62061

--HG--
extra : moz-landing-system : lando
2020-02-10 13:08:48 +00:00
Edgar Chen
9e846bd48a bug 1610296 - Rename TypedArray_base::ComputeLengthAndData to TypedArray_base::ComputeState; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D60514

--HG--
extra : moz-landing-system : lando
2020-01-23 03:22:06 +00:00
Perry Jiang
8d5e045e9d Bug 1602333 - InternalRequest cleanup: remove mPreserveContentCodings r=dom-workers-and-storage-reviewers,ytausky
This member variable is never used and I can't find the corresponding property
in the Fetch spec.

Differential Revision: https://phabricator.services.mozilla.com/D60077

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:49 +00:00
Perry Jiang
6761552a7b Bug 1602333 - InternalRequest cleanup: remove mSameOriginDataURL r=dom-workers-and-storage-reviewers,ytausky
This member variable is never used and I can't find the corresponding property
in the Fetch spec.

Differential Revision: https://phabricator.services.mozilla.com/D60076

--HG--
extra : moz-landing-system : lando
2020-01-20 13:08:09 +00:00
Perry Jiang
54ed5dbf51 Bug 1602333 - InternalRequest cleanup: default member initialize mSkipServiceWorker r=dom-workers-and-storage-reviewers,ytausky
Fetch spec says "A request has an associated service-workers mode, that is
"all" or "none". Unless stated otherwise it is "all"." "all" corresponds to
don't skip ServiceWorkers.

Differential Revision: https://phabricator.services.mozilla.com/D60075

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:35 +00:00
Perry Jiang
caf2685322 Bug 1602333 - InternalRequest cleanup: default member initialize mResponseTainting r=dom-workers-and-storage-reviewers,ytausky
Fetch spec says "A request has an associated response tainting, which is
"basic", "cors", or "opaque". Unless stated otherwise, it is "basic"."

Differential Revision: https://phabricator.services.mozilla.com/D60074

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:28 +00:00
Perry Jiang
ad2c9b8586 Bug 1602333 - InternalRequest cleanup: default member initialize mUnsafeRequest r=dom-workers-and-storage-reviewers,ytausky
Fetch spec says "A request has an associated unsafe-request flag. Unless stated otherwise it is unset."

Differential Revision: https://phabricator.services.mozilla.com/D60073

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:19 +00:00
Perry Jiang
67384d7488 Bug 1602333 - InternalRequest cleanup: default member initialize mSynchronous r=dom-workers-and-storage-reviewers,ytausky
Fetch spec says "A request has an associated synchronous flag. Unless stated otherwise it is unset.""

Differential Revision: https://phabricator.services.mozilla.com/D60072

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:15 +00:00
Perry Jiang
408c4d78d6 Bug 1602333 - InternalRequest cleanup: remove mAuthenticationFlag r=dom-workers-and-storage-reviewers,ytausky
This member variable is never used. It's also not defined by in the Fetch spec
AFAICT. The spec does define a "authentication-fetch flag", but it is not
the property of a request.

Differential Revision: https://phabricator.services.mozilla.com/D60071

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:08 +00:00
Perry Jiang
28fd147c17 Bug 1602333 - InternalRequest cleanup: default member initialize mUseURLCredentials r=dom-workers-and-storage-reviewers,ytausky
"A request has an associated use-URL-credentials flag. Unless stated otherwise, it is unset."

A quick search shows that this member variable is never actually used. It's
defined by the Fetch spec though, so I didn't delete it in the event that it is
used in the future.

Differential Revision: https://phabricator.services.mozilla.com/D60070

--HG--
extra : moz-landing-system : lando
2020-01-16 16:33:04 +00:00
Andrea Marchesini
1263b355e2 Bug 1605801 - FetchReadableStreamReadDataArray should be a rooted dictionary, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D58176

--HG--
extra : moz-landing-system : lando
2019-12-24 04:14:35 +00:00
Andrea Marchesini
31ef581995 Bug 1595786 - FetchStreamReader takes a copy of the received array buffer, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D54900

--HG--
extra : moz-landing-system : lando
2019-12-20 13:49:25 +00:00
Kris Maglione
94e3b0bd8d Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
2019-12-13 20:36:16 +00:00
Boris Zbarsky
cbc90e1aca Bug 1602090 part 2. Create separate CheckMayLoad and CheckMayLoadWithReporting APIs. r=ckerschb
CheckMayLoadAndReport takes a window ID.  This allows us to report
errors from it to the web console as needed.  Most consumers know statically
whether they want reporting or not, so there's no reason to force the ones that
don't to provide window ids.

Differential Revision: https://phabricator.services.mozilla.com/D56388

--HG--
extra : moz-landing-system : lando
2019-12-13 06:24:12 +00:00
Ciure Andrei
6c95adafed Backed out 4 changesets (bug 1602483, bug 1602090) for causing perma leackchecks CLOSED TREE
Backed out changeset 6b057ba06b4a (bug 1602483)
Backed out changeset 9be3269d781d (bug 1602483)
Backed out changeset e3e2c1d7478e (bug 1602090)
Backed out changeset fdc4a588912e (bug 1602090)
2019-12-12 18:37:01 +02:00
Boris Zbarsky
e0acf6e9fc Bug 1602090 part 2. Create separate CheckMayLoad and CheckMayLoadWithReporting APIs. r=ckerschb
CheckMayLoadAndReport takes a window ID.  This allows us to report
errors from it to the web console as needed.  Most consumers know statically
whether they want reporting or not, so there's no reason to force the ones that
don't to provide window ids.

Differential Revision: https://phabricator.services.mozilla.com/D56388

--HG--
extra : moz-landing-system : lando
2019-12-12 13:03:42 +00:00
Junior Hsu
4afe29f65d Bug 1530230 - strip request-body-header for POST to GET redirection in fetch r=valentin
Spec change brief:
A request-body-header name is a header name that is a byte-case-insensitive match for one of:
  - Content-Encoding
  - Content-Language
  - Content-Location
  - Content-Type

If one of the following is true
1. actualResponse ’s status is 301 or 302 and request ’s method is POST
1. actualResponse ’s status is 303 and request ’s method is not GET or HEAD
then set then:
1. Set request ’s method to GET and request ’s body to null.
1. For each headerName of request-body-header name , delete headerName from request ’s header list .

Differential Revision: https://phabricator.services.mozilla.com/D55887

--HG--
extra : moz-landing-system : lando
2019-12-10 17:41:43 +00:00
shindli
91924fedc7 Backed out 9 changesets (bug 1596918) for causing mochitest permafailures in toolkit/content/tests/chrome/test_findbar_events.xhtml CLOSED TREE
Backed out changeset 45a1c42118f2 (bug 1596918)
Backed out changeset db09910ffa56 (bug 1596918)
Backed out changeset 5c9d9f141c10 (bug 1596918)
Backed out changeset 6a135670d603 (bug 1596918)
Backed out changeset 3a0184e0df72 (bug 1596918)
Backed out changeset 2f0036486823 (bug 1596918)
Backed out changeset a770c6d08d52 (bug 1596918)
Backed out changeset ef062eb7a6ee (bug 1596918)
Backed out changeset a6ea596e98db (bug 1596918)
2019-12-11 03:09:26 +02:00
Kris Maglione
16a9b29848 Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
2019-12-10 23:07:13 +00:00
Noemi Erli
82d41a33b2 Backed out 9 changesets (bug 1596918) for causing multiple browser-chrome failures
Backed out changeset 415007efd8c9 (bug 1596918)
Backed out changeset 011eb5ce927b (bug 1596918)
Backed out changeset e5fd3ee22ea1 (bug 1596918)
Backed out changeset 0bca4de31d40 (bug 1596918)
Backed out changeset 11ec4393f23d (bug 1596918)
Backed out changeset c5404a7c286d (bug 1596918)
Backed out changeset 7e9304405a46 (bug 1596918)
Backed out changeset fa0f0aeabf99 (bug 1596918)
Backed out changeset de196b077000 (bug 1596918)
2019-12-07 22:26:43 +02:00
Kris Maglione
910eab35d2 Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
2019-12-07 19:11:58 +00:00
Daniel Varga
84a601a6d4 Backed out 17 changesets (bug 1596918) for multiple browser-chrome and dev-tools failures. On a CLOSED TREE
Backed out changeset ab87d2c1afae (bug 1596918)
Backed out changeset 775f3b06a687 (bug 1596918)
Backed out changeset 67cc63ef5d7f (bug 1596918)
Backed out changeset 7d290bcd2067 (bug 1596918)
Backed out changeset 048db9f4db7c (bug 1596918)
Backed out changeset 96a79d2ba614 (bug 1596918)
Backed out changeset be770d112dd8 (bug 1596918)
Backed out changeset 302c8ab8391c (bug 1596918)
Backed out changeset 44ef8f20732e (bug 1596918)
Backed out changeset 38c11ebfb8ff (bug 1596918)
Backed out changeset b586fc081374 (bug 1596918)
Backed out changeset 12283166716f (bug 1596918)
Backed out changeset 99b0421015d8 (bug 1596918)
Backed out changeset 97ec49dbbbf3 (bug 1596918)
Backed out changeset ec79478f58f1 (bug 1596918)
Backed out changeset c6d356833bb8 (bug 1596918)
Backed out changeset 5ef6026806c8 (bug 1596918)
2019-12-07 03:12:07 +02:00
Kris Maglione
20da940e14 Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
2019-12-06 22:14:14 +00:00
Gabriele Svelto
ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00