Commit Graph

124 Commits

Author SHA1 Message Date
Nika Layzell
be5f88174d Bug 1467223 - Part 1: Move CrossProcessRedirect Message to PContent, r=valentin
This is needed because early in a content process's lifecycle, NeckoParent may
not have been created yet. This leads to issues when trying to redirect into a
fresh process which hasn't performed network loads yet. By sending the message
over PContent, we can be sure the APIs are available.

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

--HG--
extra : moz-landing-system : lando
2019-01-23 21:27:44 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nika Layzell
d036b747e7 Bug 1477432 - Part 6: Stop using nsIJSID inside of WebIDL bindings, r=mccr8
Rather than adding a native type for nsID objects in WebIDL, this patch just
takes the approach of switching consumers over to using 'any' and calling the
APIs defined in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D2283
2018-11-16 17:27:39 -05:00
Andrea Marchesini
4439acd683 Bug 1498510 - Move nsICSPEventListener out of CSP object, r=ckerschb 2018-10-23 08:17:13 +02:00
Nathan Froyd
d75b9ed4bd Bug 1499726 - make main-thread XHR timer setting slightly more efficient; r=baku
Instead of creating a timer and then setting the timer's target, we can
determine the timer's target and pass it in directly when the timer is
created.  This reordering of steps is slightly more efficient, since
SetTarget() is both a virtual call and requires locking, both of which
can be skipped if we know the target at timer creation time.
2018-10-17 19:57:36 -04:00
Thomas Wisniewski
b4751b61e6 Bug 1454325 - have XHRs adjust content type of uploads per spec using the MIME Sniffing standard; r=hsivonen
have XHRs adjust content type of uploads per spec using the MIME Sniffing standard

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

--HG--
extra : moz-landing-system : lando
2018-09-20 01:04:51 +00:00
Henri Sivonen
7753be203b Bug 1484990 - Use BulkWrite instead of write past length via BeginWriting() in XHR. r=baku
The old code assumes that it's OK to use nsAString::BeginWriting() to write
past the string's logical length if the string has enough capacity. This is
bogus, because the string doesn't know of data written past its logical
length.

The BulkWrite API has been created precisely for this purpose and allows
orderly capacity-aware low-level writes to the string.

MozReview-Commit-ID: BYQHl8Z9Fbd

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

--HG--
extra : moz-landing-system : lando
2018-08-30 14:24:58 +00:00
Andreea Pavel
f5d1a4b1c3 Backed out changeset 510decfb443d (bug 1484990) for breaking many test suites e.g. Wr on a CLOSED TREE 2018-08-29 12:16:24 +03:00
Henri Sivonen
374b92a848 Bug 1484990 - Use BulkWrite instead of write past length via BeginWriting() in XHR. r=baku
The old code assumes that it's OK to use nsAString::BeginWriting() to write
past the string's logical length if the string has enough capacity. This is
bogus, because the string doesn't know of data written past its logical
length.

The BulkWrite API has been created precisely for this purpose and allows
orderly capacity-aware low-level writes to the string.

MozReview-Commit-ID: BYQHl8Z9Fbd

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

--HG--
extra : moz-landing-system : lando
2018-08-29 07:43:24 +00:00
Henri Sivonen
d3a158ae38 Bug 1483764 - Fix EOF behavior when decoding responseText lazily. r=smaug
* Drop the decoder when it finishes regardless of who called it.
 * Match criteria for having mDecoder process EOF from OnStopRequest to
   the criteria used for eager decoding in StreamReaderFunc.
 * Process EOF when decoding lazily.
 * Get rid of the useless mResponseCharset field.

MozReview-Commit-ID: 7oJwyKQYP8K

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

--HG--
extra : moz-landing-system : lando
2018-08-17 17:04:22 +00:00
Thomas Wisniewski
78af5fd2ae Bug 1454590 - Align overrideMIMEType with the XMLHttpRequest Standard. r=hsivonen
MozReview-Commit-ID: 5k34F96jRPX

--HG--
extra : rebase_source : 95944acc3123406dbf490f2fd1837b8decaa3e0b
2018-08-13 16:12:10 -04:00
Thomas Wisniewski
d4606b265f Bug 1070763 - Ensure that XHRs sniff the BOM for non-JSON responseTypes, and flush the decoder upon end-of-stream; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D3063

--HG--
extra : moz-landing-system : lando
2018-08-10 06:38:01 +00:00
Andrea Marchesini
9a9a71e436 Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
Patrick McManus
f18aa94399 Bug 1462357 - remove the channel and socket interface id r=bagder,baku
the id was a b2g feature only settable via chrome privd xhr and is no
longer active in the code base

MozReview-Commit-ID: 84GPNvhvjNb

--HG--
extra : rebase_source : ab5c2229b98e1407b8b74ef2ee00dcfea45e046a
2018-05-16 16:05:03 -04:00
Boris Zbarsky
2b6097ae6d Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Andrea Marchesini
0f38ba4351 Bug 1453927 - Get rid of XMLHttpRequestMainThread::Init, r=qdot 2018-04-14 08:11:35 +02:00
Boris Zbarsky
83412146ec Bug 1449631 part 13. Remove now-unnecessary forwarding macros. r=smaug
MozReview-Commit-ID: 6teO2KoGqUo
2018-04-05 13:42:42 -04:00
akriti
44e0c8ab73 Bug 1442700 : Label added to TELEMETRY_SEND_FAILURE_TYPE and TelemetrySend's XHR_ERROR_TYPE for eTerminated , r=chutten
MozReview-Commit-ID: 5JnGdYynRKF

--HG--
extra : rebase_source : 1dcd2dbefd60ce68a78181998c9dc224a27c735a
2018-03-28 15:27:51 +05:30
Emilio Cobos Álvarez
c03ffd9c62 Bug 1425759: Simplify the style backend type setup. r=bholley
Now that what we use to decide whether a document is styled by Servo are only
prefs and the doc principal, we don't need to inherit the style backend type,
since unless the pref has changed, the result will be the same.

MozReview-Commit-ID: KBmeBn1cRne
2018-02-27 12:39:20 +01:00
Thomas Wisniewski
8d2ee99353 Bug 1439022 r=baku
MozReview-Commit-ID: HSKAPIXUrtz

--HG--
extra : amend_source : 5c6b3e29de5ac96d85e771a7341375a919b66d13
2018-02-21 22:20:37 -05:00
Thomas Wisniewski
c02f2f2b85 Bug 792808 - use XMLHttpRequestBinding::STATE consts in the XHR subclasses and remove XMLHttpRequest::State enum class; r=baku
MozReview-Commit-ID: HcP9oEzOnub

--HG--
extra : rebase_source : 794ed0897508f3e0e5f9ccc794cfe745bb9468b0
2017-11-19 23:00:10 -05:00
Thomas Wisniewski
7c05457e0d Bug 792808 - Purge nsIXMLHttpRequest, nsIXMLHttpRequestUpload, nsIXMLHttpRequestEventTarget, nsIXHRSendable XPCOM interfaces; r=baku
MozReview-Commit-ID: 8yzCXSeyO85

--HG--
extra : rebase_source : 80f2a96df1e250ad646a20271b7d3dbebf7774e4
2017-11-19 17:11:41 -05:00
Thomas Wisniewski
4476561b7d Bug 792808 - Migrate nsXMLParseEndListener away from nsIXMLHttpRequest interfaces; r=baku
MozReview-Commit-ID: 14Lxuj37GdJ

--HG--
extra : rebase_source : ac146258773810adf01ba05f14d0901b0f5ad663
2017-09-25 22:20:26 -04:00
Andrea Marchesini
c6da271117 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug
* * *
Bug 1425458 - Resource timing entries Workers - part 10 - Correct parameters in NS_NewChannel in nsDataObj.cpp, r=me
2018-01-24 17:17:31 +01:00
Brindusan Cristian
368c3d5b6b Backed out 12 changesets (bug 1425458) for mochitest failures on WorkerPrivate.cpp on a CLOSED TREE
Backed out changeset 11997de13778 (bug 1425458)
Backed out changeset 100b9d4f36bc (bug 1425458)
Backed out changeset a29e9dbb8c42 (bug 1425458)
Backed out changeset b96d58fd945c (bug 1425458)
Backed out changeset f140da44ba68 (bug 1425458)
Backed out changeset af56400233d9 (bug 1425458)
Backed out changeset 7034af4332e4 (bug 1425458)
Backed out changeset f70500179140 (bug 1425458)
Backed out changeset 793bbfc23257 (bug 1425458)
Backed out changeset 2efb375a8ffc (bug 1425458)
Backed out changeset 07e781e37451 (bug 1425458)
Backed out changeset e875f3702a5f (bug 1425458)
2018-01-24 20:47:48 +02:00
Andrea Marchesini
6480b95ba3 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug 2018-01-24 17:17:31 +01:00
Ben Kelly
a88ba0dac1 Bug 1231211 P15 Make xhr pass worker ClientInfo and ServiceWorkerDescriptor to NS_NewChannel(). r=asuth 2018-01-23 10:38:54 -05:00
Nika Layzell
f1ac9bf744 Bug 1419597 - Part 18: Remove IsInnerWindow and IsOuterWindow methods, r=smaug
MozReview-Commit-ID: DAAm6tLubhJ
2017-11-23 13:12:13 -05:00
Andrea Marchesini
209fb327a0 Bug 1411384 - nested sync XHR should throw, r=smaug 2017-11-13 10:17:05 +01:00
Andrea Marchesini
6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Sebastian Hengst
24f9efc1d1 Backed out changeset 4bac27faa19b (bug 1070763) for crashes and broken websites. r=backout a=backout
MozReview-Commit-ID: 6BAkoAT8JyJ
2017-10-14 23:50:33 +02:00
Thomas Wisniewski
5b68608547 Bug 1070763 - Ensure that XHRs sniff the BOM for non-JSON responseTypes, and flush the decoder upon end-of-stream; r=hsivonen
MozReview-Commit-ID: ICHbs2BQcbR

--HG--
extra : rebase_source : 91fac79b191330c5f771386f9977450a569157b1
2017-10-03 08:54:14 -04:00
Thomas Wisniewski
81d59581ae Bug 1341609 - Don't throw on async XHR send() failures when open() created no channel; r=baku
MozReview-Commit-ID: IKVSbdRXoP8

--HG--
extra : rebase_source : 6f85751dae1bf7413598a3ddc381bee86545de9b
2017-09-29 11:36:55 -04:00
Thomas Wisniewski
2956d278f7 Bug 1400748 - Correct our handling of XHR.abort edge-cases; r=baku
1. Handle the "terminate the ongoing fetch" cases in the spec-text
   - do not CloseRequest in Abort/Open if the state is UNSENT or DONE).
   - ensure we don't fire extra events after terminating this way
     if a stray OnDataAvailable happens afterward.
2. Ensure that status/statusText correctly return 0/"" to mimic the
   spec's "set response to a network error" steps (requires special
   handling in the worker XHR code).

MozReview-Commit-ID: 5kMyGgD7uUU

--HG--
extra : rebase_source : ba8b6e85fb922869bbba749b4948bb4489878f22
2017-09-25 12:58:23 -04:00
Andrea Marchesini
2071ba4680 Bug 1397145 - Remove the support for moz-blob type in XHR, r=smaug 2017-09-22 07:18:14 +02:00
Andrea Marchesini
8aeaa4ff79 Bug 1392358 - Introduce XHR.sendInputStream(nsIInputStream) chrome-only, r=smaug 2017-08-25 15:31:15 +02:00
Andrea Marchesini
a1e210edec Bug 1392358 - Remove XHR.send(nsIInputStream) and unify XHR.send(params) as the spec says, r=smaug 2017-08-25 15:30:33 +02:00
Bobby Holley
d42f0733ac Bug 1389300 - Inherit style backend into NS_NewDOMDocument. r=smaug,r=heycam
Our current machinery for enabling stylo requires a docshell - if there isn't
one, we default to the Gecko style system.

When getComputedStyle operates on an element without a presshell, it uses the
caller's presshell instead. If the element has previously been styled with
one style system (but no longer has a presshell), and the caller uses a
different style backend, using the caller's style system can cause crashes when
we pull bits of cached data off the DOM (like cached style attributes).

So we want to throw when window.getComputedStyle(element) is called for a
(window, element) pair with different style backends (which is what the next
patch in this bug does).

However, that causes a few failures where stylo-backed documents try to do
getComputedStyle on an XHR document (which, without a docshell, will use the
gecko style system).

So this patch does some work to propagate the creator's style backend into
various docshell-less documents. This should allow both chrome (which uses gecko)
and content (which uses stylo) to use getComputedStyle on the response document
for XHRs they create.

Note that the second patch in this bug will make
chromeWin.getComputedStyle(contentObj) throw. If we discover code that does
that, we can just make it invoke the content's getComputedStyle method over Xrays.

MozReview-Commit-ID: 5OsmHJKq5Ui
2017-08-15 19:10:43 -07:00
Masatoshi Kimura
af24452443 Bug 437381 - Remove nsIJSXMLHttpRequest and fix the comments in nsIXMLHttpRequest.h. r=smaug
MozReview-Commit-ID: CYkV01S9QEZ

--HG--
extra : rebase_source : 96e3a42aee2e018e70d54c3bf623e655d85cd32d
2017-08-12 01:16:22 +09:00
Bevis Tseng
95b18d794e Bug 1382172 - Name nsITimerCallback instances in native implementation. r=billm
--HG--
extra : rebase_source : 84de1abfcc30a6964144c2e6718a508c71027b65
2017-07-27 02:18:20 +08:00
Andrea Marchesini
9214414749 Bug 1377101 - Add some return value checks in XHR, r=mystor 2017-06-29 10:27:59 -07:00
Masatoshi Kimura
b515c9c804 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : fdae0046f882d47fb539a7f882364e5c5caafdcd
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Sebastian Hengst
dfc1ad2562 Backed out changeset 7235d05662b0 (bug 1373984) for Android bustage. r=backout on a CLOSED TREE 2017-06-25 18:30:13 +02:00
Masatoshi Kimura
2e04751921 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : a84ab644f52e68676b45f112ff69f868d89f6177
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Wes Kocher
e02435a31e Backed out changeset 77af189b5c49 (bug 1373984) for build bustage in nsHtml5Parser.cpp a=backout CLOSED TREE
MozReview-Commit-ID: 6kBmU71j2To
2017-06-25 05:10:14 -07:00
Masatoshi Kimura
241039fd97 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : 09da1685795583513bf019d61c58230c2c4d298d
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Andrea Marchesini
9e04e35075 Bug 1370819 - Postpone the dispatching of XHR events with opened synchronously, r=smaug 2017-06-16 08:07:00 +02:00
Henri Sivonen
432653453a Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00