Commit Graph

120 Commits

Author SHA1 Message Date
Boris Zbarsky
7fa3838d4d Bug 1452185 part 2. Remove nsIDOMXULElement use in JS. r=qdot
MozReview-Commit-ID: 2JIybnXaudR
2018-04-09 16:30:32 -04:00
Kris Maglione
4c402a31f9 Bug 1451215: Run codespell on code. r=aswan
MozReview-Commit-ID: HIilZTKcQUY
2018-04-03 22:22:07 -07:00
Shane Caraveo
48ad9795b9 Bug 1448599 - fix WebRequest events for redirected channels when onBeforeRedirect is not used, r=kmag
If any WebRequest listener *other* than onBeforeRedirect was used, and a channel was redirected,
the ChannelWrapper was not updated with the redirected channel.  This broke most listeners for
redirected channels and specifically an extension would never see events for the new channel.

MozReview-Commit-ID: BwXToTD5LEu
2018-04-02 21:12:07 -05:00
Kris Maglione
fd8a0b2ac6 Bug 1415644: Create a list of restricted domains. r=aswan,mixedpuppy
MozReview-Commit-ID: A0AkaBG33In
2018-03-03 16:28:18 -08:00
Christoph Kerschbaumer
8af0a6f791 Bug 1434357: Exempt Web Extensions from insecure redirects to data: URIs. r=kmag,mayhemer 2018-02-18 19:52:52 +01:00
Andrew McCreight
272cee1e65 Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG
2018-02-06 09:36:57 -08:00
Florian Quèze
c5f15a4700 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Kris Maglione
0bb74efdf1 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Cosmin Sabou
f09d6d985d Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
fd67f090b2 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Brindusan Cristian
483ba301cb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
683a97d172 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Luca Greco
df769bb81d Bug 1428094 - Exception raised from a webRequest blocking listener should report the original error message and filename. r=mixedpuppy
MozReview-Commit-ID: KiCg6dKaVd5
2017-12-07 21:19:03 +01:00
Andreea Pavel
f83f963a34 Merge inbound to mozilla-central r=merge a=merge 2017-12-09 22:21:17 +02:00
Kris Maglione
c8ea1d4273 Bug 1421459: Update to ESLint 4 "indent" rule. r=aswan
MozReview-Commit-ID: LxLDWlsIlSk
2017-11-28 14:13:59 -08:00
Shane Caraveo
616ecb3d39 Bug 1149250 add support for https upgrades from webextensions, r=bz,mayhemer,rpl
MozReview-Commit-ID: ChIs2Q6bgEn
2017-12-08 12:12:37 -08:00
Peter Snyder
9308fe1009 Bug 1377689 - merge identical headers in set{Request,Response}Header, r=bz,mixedpuppy
MozReview-Commit-ID: Kpli9YzEvlt
2017-12-04 22:48:54 -06:00
Kris Maglione
12b1b432af Bug 1405286: Part 3 - Test that filterResponseData from cached onHeadersReceived doesn't crash. r=mixedpuppy
It currently isn't possible to suspend a channel from onHeadersReceived for a
cached response. And since it's not possible to add a new stream filter after
a response has started, adding a stream filter at that point will crash if the
channel is still registered.

This test is a basic sanity check for that scenario.

MozReview-Commit-ID: ALYUtxX7mci
2017-10-14 19:25:35 -07:00
Shane Caraveo
cf8c5452ed Bug 1305237 Expose frameAncestors to webextensions, r=bz,kmag
MozReview-Commit-ID: 64lIMu6neaD
2017-10-10 09:54:22 -07:00
Wes Kocher
ce6083bc04 Backed out 2 changesets (bug 1305237) for crashtest failures in 403574-1.xhtml and 1282985-1.svg a=backout
Backed out changeset 96b5d596cc27 (bug 1305237)
Backed out changeset 5fe72402746f (bug 1305237)

MozReview-Commit-ID: CjCWY73Hps1
2017-10-02 16:41:56 -07:00
Shane Caraveo
a7b37edbc1 Bug 1305237 Expose frameAncestors to webextensions, r=bz,kmag
MozReview-Commit-ID: 8gvEiqJEsP3
2017-10-02 15:11:54 -07:00
Wes Kocher
26e25c2519 Backed out 2 changesets (bug 1305237) for bc failures in browser_WebRequest_ancestors.js a=backout
Backed out changeset 163a2b0bb0a0 (bug 1305237)
Backed out changeset e05bab140564 (bug 1305237)

MozReview-Commit-ID: GLlbWYZqyVS
2017-10-02 13:35:03 -07:00
Shane Caraveo
29494e6337 Bug 1305237 Expose frameAncestors to webextensions, r=bz,kmag
MozReview-Commit-ID: Dcf2AaUqBsb
2017-10-02 11:06:31 -07:00
Wes Kocher
4253ce7dce Merge inbound to m-c a=merge
MozReview-Commit-ID: 7zOjePOWzOM
2017-09-28 16:56:44 -07:00
Ryan VanderMeulen
252c89b8d4 Backed out changesets d0d30a90efa1 and fd1d81b93380 (bug 1305237) for causing bug 1403932. 2017-09-28 17:55:43 -04:00
Shane Caraveo
d7ebe7ee66 Bug 1305237 Expose frameAncestors to webextensions, r=bz,kmag
MozReview-Commit-ID: HpneTIKPoS1
2017-09-27 07:58:17 -07:00
Shane Caraveo
f2e81a0dcd Bug 1401350 fix proxy auth for system requests, r=kmag
MozReview-Commit-ID: CAh89djQobI
2017-09-25 15:14:09 -07:00
Kris Maglione
f10debfb5b Bug 1402944: Part 10 - Minor runChannelListener cleanups/optimizaitons. r=mixedpuppy
Moving the event type lists to constants avoids array construction overhead
for each event, and allows us to use the much faster Set.has rather than
Array.includes.

Using Object.create to add the base request info to the listener-specific info
allows us to avoid object copy overhead.

Switching to a .forEach() loop lets us avoid creating expensive live Map
iterator objects, and also GC pressure caused by the huge number of iterator
result objects and intermediate array objects created by for-of-entries().
It's otherwise just as fast as for-of in Ion.

MozReview-Commit-ID: 53Fw1tJbuMY
2017-09-25 14:01:12 -07:00
Kris Maglione
baa806b321 Bug 1402944: Part 9 - Optimize request/response header handling. r=mixedpuppy,ehsan
We don't use the initial Map returned by ChannelWrapper as a map, so there's no
need for the overhead involved in creating it. We also don't need the header map
generated by HeaderChanger unless headers are actually being modified, which
for many listeners they never are, so there's no need for the map creation and
string lower-casing overhead prior to modification time.

MozReview-Commit-ID: K2uK93Oo542
2017-09-23 16:25:19 -07:00
Kris Maglione
9880082601 Bug 1402944: Part 7 - Move traceable channel registration to ChannelWrapper. r=mixedpuppy,ehsan
MozReview-Commit-ID: 6hGmh4VpJMQ
2017-09-27 18:15:39 -07:00
Kris Maglione
813dfdec77 Bug 1402944: Part 5 - Move request filtering and permission matching into ChannelWrapper. r=mixedpuppy,ehsan
This allows us to reuse the same URLInfo objects for each permission or
extension that we match, and also avoids a lot of XPConnect overhead we wind
up incurring when we access URI objects from the JS side.

MozReview-Commit-ID: GqgVRjQ3wYQ
2017-09-27 18:15:12 -07:00
Kris Maglione
d4776d075c Bug 1402944: Part 4 - Fold start/stop listener into ChannelWrapper. r=mixedpuppy,ehsan
MozReview-Commit-ID: 52zZNjgaCEj
2017-09-26 13:39:30 -07:00
Kris Maglione
7f5cb37174 Bug 1402944: Part 3 - Move error checks into ChannelWrapper. r=mixedpuppy,ehsan
MozReview-Commit-ID: 7uLonYWnLcX
2017-09-26 13:38:54 -07:00
Kris Maglione
b0e7882fea Bug 1402944: Part 2 - Move error string logic into ChannelWrapper. r=mixedpuppy,ehsan
MozReview-Commit-ID: 4rOeoliLTV7
2017-09-22 18:43:18 -07:00
Kris Maglione
92b4999d58 Bug 1399346: Make sure channel is QIed to nsIChannel before wrapping. r=trivial
MozReview-Commit-ID: EyKcc9irD8H
2017-09-11 21:44:30 -07:00
Sebastian Hengst
3da80f316b merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: CmMBcpJapLy
2017-09-12 11:35:15 +02:00
Kris Maglione
53b1a84d5d Bug 1398642: Bustage fix bustage fix. r=me CLOSED TREE
MozReview-Commit-ID: 4jTSVg6L3is
2017-09-11 21:59:15 -07:00
Kris Maglione
570585705f Bug 1398642: Follow-up: Fix terrible error checking code. r=me CLOSED TREE
MozReview-Commit-ID: 1xQNYwZiqsj
2017-09-11 21:18:42 -07:00
Kris Maglione
a59115a44c Bug 1398642: Several minor WebRequest optimizations. r=mixedpuppy
MozReview-Commit-ID: 4vsDScMkyzA
2017-09-10 18:37:52 -07:00
Kris Maglione
232f1e847d Bug 1397448: Part 1 - Generate WebRequest message objects in WebRequest.jsm. r=mixedpuppy
Aside from moving this logic closer to the place the input data is generated,
this significantly reduces the number of cross-compartment wrappers involved
in creating those messages, especially with JSM global sharing enabled.

MozReview-Commit-ID: 6IvetcHnMfC
2017-09-06 17:43:38 -07:00
Shane Caraveo
60f1dc1af2 Bug 1398622 fix ws handling in contentpolicymanager, and fix stupid error. r=kmag
MozReview-Commit-ID: EmPvtRrnrnI
2017-09-10 21:37:27 -07:00
Kris Maglione
bd93d990bf Bug 1397536: Avoid newURI overhead for MatchPattern. r=ehsan,mixedpuppy
Ehsan, can you please review the (trivial) WebIDL changes, and Shane the
WebRequest logic?

The change to allow strings in MatchPattern arguments removes a huge amount of
XPConnect overhead that accumulates when creating nsIURI objects for
WebRequest processing.

The change to re-use existing URI objects removes a huge amount of URI
creation overhead.

MozReview-Commit-ID: 3DJjAKJK1Sa
2017-09-06 21:56:45 -07:00
Kris Maglione
4fbcf97b35 Bug 1396856: Part 4 - Update WebRequest.jsm to use ChannelWrapper bindings. r=mixedpuppy
MozReview-Commit-ID: 7s7SOQ1XVaw
2017-09-06 21:52:24 -07:00
Kris Maglione
d2830a9581 Bug 1255894: Part 7 - Expose response stream filtering via the webRequest API. r=mixedpuppy
MozReview-Commit-ID: AErBFGJyFg5
2017-09-02 13:37:31 -07:00
Shane Caraveo
cf5699a2db Bug 1388889 fix null principal handling for webrequest, r=kmag
MozReview-Commit-ID: B8qK4ZnaO9i
2017-08-25 14:12:42 -07:00
Shane Caraveo
3011601eaa Bug 1373646 add nsIProxyInfo to webrequest, r=kmag
MozReview-Commit-ID: pc98rgtkVc
2017-08-23 10:43:04 -07:00
Shane Caraveo
802866c20d Bug 1388289 fix challenger info for proxy auth requests, r=kmag
MozReview-Commit-ID: D0Tin2bK8R4
2017-08-17 19:56:22 -07:00
Shane Caraveo
51d0da99dc Bug 1368527 add new on-before-connect notification to httpChannel, r=dragana,kmag
MozReview-Commit-ID: 8hiAgY4KzDB
2017-08-15 13:11:50 -07:00
Shane Caraveo
415d4e808d Bug 1386533 fix host permitted matching, r=kmag
MozReview-Commit-ID: 81ANT5R1671
2017-08-02 15:33:17 -07:00
Shane Caraveo
9908bc12e8 Bug 1380186 implement SimpleChannel Parent/Child IPC, r=kmag,mayhemer
MozReview-Commit-ID: 8zgF2MLwdu2
2017-07-27 13:34:54 -07:00