Commit Graph

70 Commits

Author SHA1 Message Date
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
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
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
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
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
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
3011601eaa Bug 1373646 add nsIProxyInfo to webrequest, r=kmag
MozReview-Commit-ID: pc98rgtkVc
2017-08-23 10:43:04 -07:00
Andrew Swan
3d501bbfd5 Bug 1369577 Part 1 Rename SingletonEventManager to EventManager r=kmag
MozReview-Commit-ID: 7nsYWdSTJCG
2017-06-09 13:49:07 -07:00
Sebastian Hengst
8642712c2a Backed out changeset 26fd6d0a1254 (bug 1369577) for failing xpcshell's test_ext_simple.js and test_ext_startup_cache.js on Android. r=backout 2017-06-30 01:01:13 +02:00
Andrew Swan
c140bd9d12 Bug 1369577 Part 1 Rename SingletonEventManager to EventManager r=kmag
MozReview-Commit-ID: 7nsYWdSTJCG
2017-06-09 13:49:07 -07:00
Mark Banner
9916415caf Bug 1371292 - Clean up more ESLint global definitions in configuration files in toolkit/ and browser/. r=mossop
MozReview-Commit-ID: 5KC23kzaCFN
2017-06-08 10:59:12 +01:00
Kris Maglione
972b1073af Bug 1368152: Part 4 - Remove ExtensionManagement.jsm. r=aswan
MozReview-Commit-ID: Apbi1QYeb2x
2017-06-03 17:18:18 -07:00
Kris Maglione
4f623b6890 Bug 1322235: Part 3 - Use MatchPatternSet for whiteListedHosts and webRequest. r=aswan,zombie
This is the second step to migrating the policy service to pure native code,
with similar impacts and reasoning to the previous patch.

MozReview-Commit-ID: L5XdPzWNZXM
2017-06-03 22:11:20 -07:00
Shane Caraveo
2a84eab190 Bug 1367138 fix webrequest frameId and parentFrameId, r=aswan
MozReview-Commit-ID: F8lD8vvfSQ5
2017-06-02 12:05:13 -07:00
Kris Maglione
da08b6926c Bug 1317697: Remove things from ExtensionUtils that don't belong there. r=mixedpuppy
MozReview-Commit-ID: CTX0TckLqoV
2017-04-07 13:39:06 -07:00
Kris Maglione
e6a8ac0beb Bug 1355120: Get rid of top-level window ID tracking. r=aswan
MozReview-Commit-ID: y7DzMxXBot
2017-04-12 14:12:22 -07:00
Tomislav Jovanovic
b916f5f3e6 Bug 1345225 - Check if webRequest filters overlap with host permissions r=kmag
MozReview-Commit-ID: 1tMHynv9FBO
2017-03-26 20:53:28 +02:00
Kris Maglione
884009911d Bug 1350522: Part 2 - Convert toolkit APIs to lazy loading. r=aswan
MozReview-Commit-ID: 8TbTIM4WX2d
2017-03-31 19:36:00 -07:00
Tomislav Jovanovic
410a8bbf73 Bug 1311815 - Check host permissions for webRequest listeners r=kmag
MozReview-Commit-ID: 9bcb4p7tP2u
2017-02-16 14:56:35 +01:00
Kris Maglione
1ccc618561 Bug 1260548: Part 5 - Factor out <browser> data logic into shared modules. r=aswan
MozReview-Commit-ID: GHPympWA7U
2017-01-30 20:11:14 -08:00
Shane Caraveo
f094e18e5f Bug 1190689 implement onAuthRequired for WebRequest, r=kmag
MozReview-Commit-ID: D6ydPIMNzDI
2017-01-26 13:40:36 -08:00
Andrew Swan
1ac8741081 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X
2017-01-26 20:00:33 -08:00
Phil Ringnalda
5781d2a09e Backed out 3 changesets (bug 1203330) for failures in test_delay_update_webextension.js
CLOSED TREE

Backed out changeset 2d42350d209a (bug 1203330)
Backed out changeset 3a12c51c3eca (bug 1203330)
Backed out changeset 31fac390e15d (bug 1203330)
2017-01-26 19:13:11 -08:00
Andrew Swan
8e5ca9edb5 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X
2017-01-26 13:43:12 -08:00
Shane Caraveo
166e323191 Bug 1329299 verify frameId in webrequest tests, r=kmag
MozReview-Commit-ID: LuQcGsogs7J
2017-01-12 12:09:35 -08:00
Shane Caraveo
514b6a6f46 Bug 1311576 fix webrequest filter for tabId and windowId, r=kmag
MozReview-Commit-ID: FzW53LXktWz
2016-11-15 16:34:33 -08:00
Kris Maglione
b5f8391635 Bug 1305217: Part 1 - Run webRequest listeners asynchronously. r=mixedpuppy
MozReview-Commit-ID: 2XF6irv5WBd
2016-11-12 13:51:59 -08:00
Sebastian Hengst
990d219d9a Backed out changeset 4efa832fc852 (bug 1305217) for frequent timeouts in test_ext_webrequest_upload.html. r=backout 2016-11-12 13:45:03 +01:00
Kris Maglione
7374699bc7 Bug 1305217: Part 1 - Run webRequest listeners asynchronously. r=mixedpuppy
MozReview-Commit-ID: 2XF6irv5WBd
2016-11-11 11:09:35 -08:00
Shane Caraveo
b2ca77fcab Bug 1273138 fix WebRequest for background pages, r=kmag
MozReview-Commit-ID: DEW9anMmKi2
2016-11-02 09:30:50 -07:00
Tomislav Jovanovic
32a487cd24 bug 1293355 - add fromCache to onResponseStarted details, r=kmag
MozReview-Commit-ID: GO0a8s8D2oT
2016-09-21 21:57:15 +02:00
Rob Wu
812e170fe8 Bug 1287010 - Make environment of Context explicit. r=billm
- Add `envType` to BaseContext.
 - Pass an explicit envType to all `registerSchemaAPI` invocations.
 - The factories passed to `registerSchemaAPI` will be split up later, so
   that content scripts (`content_child`) and addon pages can share
   common implementations.
 - The factories that implement the addon API will also be split up,
   to separate code running in the main process (`addon_parent`) from
   code running in a child process (`addon_child`).
 - Remove the use of a hardcoded list of `namespaces` from ProxyContext.
   Now `envType` is used to specify whether an API should be activated.

MozReview-Commit-ID: Jiff8HIwG92
2016-08-16 15:51:50 -07:00
Rob Wu
a68fdede92 Bug 1287010 - Use minimal global scope for ext-*.js scripts r=billm
Currently there is a tight coupling between registered APIs because they
share the same global scope, and the dependencies between the modules
that use these globals are not explicit. Consequently, it would be
possible for APIs to break when the registered APIs run in separate
processes, because then there are separate global scopes.
To mitigate this issue, this patch isolates the global namespaces of
API registrations in different environments, starting with the "chrome"
process. Content and addon processes will follow later.

A new JSM is introduced to avoid hidden dependencies between ext-*.js
and the script loader. ExtensionUtils.jsm would be a natural choice for
this shared utility method, but cannot be used because its local
`EventEmitter` implementation conflicts with the `EventEmitter` import
in ext-tabs.js.

So, this patch provides isolation of global variables declared through
`globals.XXX = ...`, but does not provide isolation for `Cu.import`-ed
logic. Ideally `Cu.import` should always use its second argument to
prevent inadvertent namespace pollution.

MozReview-Commit-ID: 1DTZaKOaeSE
2016-08-17 20:28:19 -07:00
Rob Wu
6efdd88867 Bug 1295082 - Put Extension in BaseContext r=kmag
ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR
2016-08-15 01:04:58 -07:00
Sebastian Hengst
c7a498ffbd Backed out changeset 0ce1cc39aa3d (bug 1295082) for timing out in test_ext_schemas_api_injection.js. r=backout 2016-08-18 16:47:09 +02:00
Rob Wu
6189daa99f Bug 1295082 - Put Extension in BaseContext r=kmag
ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR
2016-08-15 01:04:58 -07:00
Giorgio Maone
fe97eb7f75 Bug 1201979 - Support requestBody in onBeforeRequest. r=kmag
MozReview-Commit-ID: LAHKN5uZO0
2016-07-29 23:38:43 +02:00
Kris Maglione
843973aa31 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS
2016-06-09 17:44:47 -07:00
Sebastian Hengst
d97f588f03 Backed out changeset a00cf073f5c0 (bug 1279392) for failing mochitest test_ext_contentscript_create_iframe.html at least on Linux x64 opt. r=backout 2016-06-14 13:37:52 +02:00
Kris Maglione
b2a33e3bf1 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS
2016-06-09 17:44:47 -07:00
Giorgio Maone
ac57061154 Bug 1242871 - add an originUrl property to every webRequest event details object + tests (extended & fixed + nits). r=kmag
MozReview-Commit-ID: 6PeCwTeCuFs
2016-04-01 00:48:57 +02:00
Giorgio Maone
91221ae90d Bug 1252596 - Implement webRequest.onErrorOccurred. r=kmag
MozReview-Commit-ID: GFeFjKlsMAD
2016-03-07 09:35:24 +01:00
Giorgio Maone
25af910545 Bug 1253924 - Implement statusLine + fix & test statusCode r=kmag
MozReview-Commit-ID: BhyM10w8iGt
2016-03-06 16:59:07 +01:00
Giorgio Maone
b21e727227 Bug 1163862 - Switch to HTTP observer + support requestId & data: URIs + test fixes r=billm
MozReview-Commit-ID: 30nEXQpWEHg
2016-02-26 19:08:32 +01:00
Phil Ringnalda
d4818c82ca Back out 8ae0fba61023 (bug 1163862) for Win7 e10s test_ext_webrequest.html bustage 2016-02-25 20:41:40 -08:00
Giorgio Maone
a690c97982 Bug 1163862 - Switch to HTTP observer where possible + support requestId & data: URIs r=billm
MozReview-Commit-ID: EBRWBgGPqyD
2016-02-24 00:21:42 +01:00