Граф коммитов

670 Коммитов

Автор SHA1 Сообщение Дата
Karl Tomlinson 5104cdfad1 Bug 1565956 adjust IsCurrentThreadRunningChromeWorker() for worklet threads r=baku
Depends on D53135

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

--HG--
extra : moz-landing-system : lando
2019-11-17 21:17:40 +00:00
Karl Tomlinson 2d84aace80 Bug 1565956 run worker-specific MessagePort close on initialize on only worker threads r=baku
MessagePorts will be initialized also on worklet threads.

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

--HG--
extra : moz-landing-system : lando
2019-11-17 21:09:52 +00:00
Tom Ritter 23ba7b6fe3 Bug 1583949 - Add a check for IsEvalAllowed to the worker callpath for eval() r=ckerschb,baku
This patch does several things.  Because Workers aren't on the main thread,
many of the things done are in the name of off main thread access.

1) Changes a parameter in IsEvalAllowed from a nsIPrincipal to a bool.
   We only used the principal to determined if it was the System Principal.
   Principals aren't thread safe and can only be accessed on Main Thread, so
   if we passed a Principal in, we would be in error. Instead only pass in
   the bool which - for workers - comes from a thread-safe location.

2) Separates out the Telemetry Event Recording and sending a message to the
   console into a new function nsContentSecurityUtils::NotifyEvalUsage. (And
   creates a runnable that calls it.)

   We do this because we will need to only call this method on the main thread.

   Telemetry Event Recording has only ever been called on the Main Thread.
   While I possibly-successfully cut it over to happen Off Main Thread (OMT)
   by porting preferences to StaticPrefs, I don't know if there were other
   threading assumptions in the Telemetry Code. So it would be much safer to
   just continue recording Event Telemetry on the main thread.

   Sending a message to the console requires calling GetStringBundleService()
   which requires main thread. I didn't investigate if this could be made
   thread-safe, I just threw it onto the main thread too.

   If, in IsEvalAllowed, we are on the main thread - we call NotifyEvalUsage
   directly. If we are not, we create a runnable which will then call
   NotifyEvalUsage for us on the main thread.

3) Ports allow_eval_with_system_principal and allow_eval_in_parent_process
   from bools to RelaxedAtomicBool - because we now check these prefs OMT.

4) In RuntimeService.cpp, adds the call to IsEvalAllowed.

5) Add resource://gre/modules/workers/require.js to the allowlist of eval
   usage. This was the script that identified this gap in the first place.
   It uses eval (twice) for structural reasons (scope and line number
   massaging.)  The contents of the eval are the result of a request to a
   uri (which may be internal, like resource://). The whole point of this
   is to implement a CommonJS require() api.

   This usage of eval is safe because the only way an attacker can inject
   into it is by either controlling the response of the uri request or
   controlling (or appending to) the argument. If they can do that, they
   are able to inject script into Firefox even if we cut this usage of eval
   over to some other type of safe(r) script loader.

   Bug 1584564 tracks making sure calls to require.js are safe.

6) Adds cld-worker.js to the allowlist. Bug 1584605 is for refactoring that
   eval usage, which is decidedly non-trivial.

7) Does _not_ enforce the eval restrictions for workers. While I've gotten
   try to be green and not throw up any instances of eval-usage by workers,
   it is much safer to deploy this is Telemetry-only mode for Workers for
   a little bit to see if anything pops up from the Nightly population.

   Bug 1584602 is for enforcing the checks.

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

--HG--
extra : moz-landing-system : lando
2019-10-08 17:31:35 +00:00
Tom Ritter cdd2029b79 Bug 1576254 - Cut WorkerPrincipal over to a real object and implement isSystemOrAddonPrincipal r=baku
Unlike WorkletPrincipal, a WorkerPrincipal had been a simple static object shared by
all Workers. We never needed to consult it about an individual Worker before. Now we
do. So we cut it over from a static object to individual objects for each Worker.

We have an off main thread access problem for the Principal however, WorkerPrivate
has a method UsesSystemPrincipal that returns a bool that was initialized from the
Principal on the main thread. We copy that pattern and add a
UsesAddonOrExpandedAddonPrincipal method that will be called by the
isSystemOrAddonPrincipal method we must implement so we can inheirt from JSPrincipal.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 17:37:09 +00:00
Tom Ritter cac810aea7 Bug 1576254 - Update wasmForTrustedPrinciples to use a separate pref r=luke
Differential Revision: https://phabricator.services.mozilla.com/D47474

--HG--
extra : moz-landing-system : lando
2019-10-04 17:36:08 +00:00
Tom Ritter 754ebbc4d7 Bug 1576254 - Add a wasmForTrustedPrinciples bool onto ContextOptions that (currently) behaves the exact same as the wasm bool r=luke
In a future commit we will tie this boolean to its own preference value, but here we
initialize it with the same value as the wasm boolean.

We also update wasm::HasSupport to check the to-be-added isSystemOrAddonPrincipal()
method on JSPrincipals to determine which member (wasm or wasmForTrustedPrinciples)
to consult.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 17:35:46 +00:00
Steve Fink 91b1ffaac3 Bug 1560667 - Collection of fixes for things uncovered by improvements to the hazard analysis. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D46534

--HG--
extra : moz-landing-system : lando
2019-10-02 03:20:33 +00:00
Jon Coppeard 2d89bbf3df Bug 1569564 - Remove the original malloc counter infrastructure r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D39735

--HG--
extra : moz-landing-system : lando
2019-07-31 09:13:36 +00:00
Nicholas Nethercote cd426e3ad2 Bug 1569526 - Remove return values from `Add*VarCache()`. r=KrisWright
They're infallible in practice and always `NS_OK`. (This stems from
`AddVarCacheNoAssignment()` always returning `NS_OK`.)

As a result, the commit removes lots of unnecessary checks.

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

--HG--
extra : moz-landing-system : lando
2019-07-30 06:19:46 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Karl Tomlinson 53e03975c9 Bug 1542931 add CycleCollectedJSContext::ReportError() r=baku
to make AutoJSAPI error reporting safe for worklets.

Parameter order matches xpc::ErrorReport::Init().

Depends on D34477

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

--HG--
extra : moz-landing-system : lando
2019-06-12 19:11:04 +00:00
Andrea Marchesini d261515486 Bug 1563950 - Worker threads should run with a normal priority, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37694

--HG--
extra : moz-landing-system : lando
2019-07-11 10:49:55 +00:00
Jan de Mooij 93d6f816f0 Bug 1564349 part 1 - Convert Baseline/Ion/NativeRegExp prefs from ContextOptions to JitOptions. r=nbp,smaug
Using process-wide prefs is consistent with the other JIT options and is simpler
to work with (one place to initialize for all runtimes).

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

--HG--
extra : moz-landing-system : lando
2019-07-10 09:43:39 +00:00
Karan Sapolia ed6ee44baf Bug 1549263 - Rename sliceTimeBudget() and related symbols to include units. r=pbone
Differential Revision: https://phabricator.services.mozilla.com/D35588

--HG--
extra : moz-landing-system : lando
2019-06-28 12:56:08 +00:00
Jon Coppeard 22952620f8 Bug 1560931 - Set JS engine low memory state based on memory pressure notifications r=smaug
Update the memory pressure observers for main thread and workers to call the new JS API to set/clear the low memory state.

Differential Revision: https://phabricator.services.mozilla.com/D35682
2019-06-24 18:24:47 +01:00
Jon Coppeard 98d75b5cd9 Bug 1560948 - Don't garbage collect workers in an ongoing memory pressure state because it likely won't help much r=smaug
Ignore ongoing memory pressure events on workers like we do on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D35678
2019-06-24 18:21:53 +01:00
Brian Hackett 46b6a244cd Bug 1325195 Part 1 - Create opaque CCWs when wrapping worker debugger objects into other compartments, r=asuth.
Differential Revision: https://phabricator.services.mozilla.com/D32872

--HG--
extra : rebase_source : ebf0dd18959f3a2623450c2a944f26ca04a8ef85
2019-05-28 08:32:06 -10:00
Sylvestre Ledru d57d4905f1 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-05-25 17:46:15 +00:00
Ehsan Akhgari 70dba3be94 Bug 1547813 - Part 8: Introduce a CookieSettings API to query whether cookies from third-party trackers must be rejected and use it in Gecko; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D30117

--HG--
extra : moz-landing-system : lando
2019-05-25 01:25:43 +00:00
arthur.iakab af8e458c5f Backed out changeset a296439a25ff (bug 1519636) for frequent Windows cppunit failures CLOSED TREE 2019-05-24 14:26:01 +03:00
Sylvestre Ledru c82ea97226 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-05-24 09:59:17 +00:00
Noemi Erli 6430d23336 Backed out 12 changesets (bug 1547813) for failures in browser_partitionedIndexedDB.js CLOSED TREE
Backed out changeset 98989127264b (bug 1547813)
Backed out changeset f9d790139a26 (bug 1547813)
Backed out changeset a29f58cef022 (bug 1547813)
Backed out changeset c1288949de1c (bug 1547813)
Backed out changeset 8cad4fd197b1 (bug 1547813)
Backed out changeset 807ce59e7e6e (bug 1547813)
Backed out changeset 06943593738c (bug 1547813)
Backed out changeset 4ced8d49ddc3 (bug 1547813)
Backed out changeset 77a040f527e9 (bug 1547813)
Backed out changeset b4651cfaff30 (bug 1547813)
Backed out changeset 279c140a4d71 (bug 1547813)
Backed out changeset 0e0241f3d366 (bug 1547813)
2019-05-09 20:04:16 +03:00
Ehsan Akhgari c7cb5521d1 Bug 1547813 - Part 8: Introduce a CookieSettings API to query whether cookies from third-party trackers must be rejected and use it in Gecko; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D30117

--HG--
extra : moz-landing-system : lando
2019-05-08 20:22:18 +00:00
Haik Aftandilian 268a1d9df4 Bug 1546544 - Reduce navigator.hardwareConcurrency to account for TCSM r=luke
Differential Revision: https://phabricator.services.mozilla.com/D29437

--HG--
extra : moz-landing-system : lando
2019-05-07 22:16:28 +00:00
arthur.iakab 62df572c1c Backed out 2 changesets (bug 1546544) for causing mochitest-chrome test failures on automation.py CLOSED TREE
Backed out changeset d4b67960c0f9 (bug 1546544)
Backed out changeset fda45db5f8e9 (bug 1546544)
2019-05-07 05:38:37 +03:00
Haik Aftandilian a2d7f3a328 Bug 1546544 - Reduce navigator.hardwareConcurrency to account for TCSM r=luke
Differential Revision: https://phabricator.services.mozilla.com/D29437

--HG--
extra : moz-landing-system : lando
2019-05-06 06:09:11 +00:00
Andrea Marchesini 0b8eabfa62 Bug 1546576 - Canceling workers during xpcom-shutdown, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D28595

--HG--
extra : moz-landing-system : lando
2019-04-24 17:18:29 +00:00
Brian Hackett b851bf262e Bug 1535071 - Use the debugger global scope for worker error reporting if necessary, r=smaug,baku.
Differential Revision: https://phabricator.services.mozilla.com/D24270

--HG--
extra : moz-landing-system : lando
2019-03-25 09:26:48 +00:00
Boris Zbarsky 10d7ccf23e Bug 1535384 part 5. Eliminate MOZ_CAN_RUN_SCRIPT_BOUNDARY for mutation callbacks. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D23776

--HG--
extra : moz-landing-system : lando
2019-03-19 15:14:11 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Andrea Marchesini bbbb6b3c68 Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 11 - windows/workers/documents must keep the current cookie settings and ignore changes, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D18960

--HG--
extra : moz-landing-system : lando
2019-03-08 09:03:38 +00:00
Ciure Andrei 712dd2bb8c Backed out 16 changesets (bug 1525245) for perma failing test_document_cookie.html CLOSED TREE
Backed out changeset 3fd27215698f (bug 1525245)
Backed out changeset d9a9e8e77873 (bug 1525245)
Backed out changeset 0e6f7be92e3f (bug 1525245)
Backed out changeset 6790802e2fa5 (bug 1525245)
Backed out changeset a5a9e01116ed (bug 1525245)
Backed out changeset 66e19a0c38dd (bug 1525245)
Backed out changeset fb90d51ba853 (bug 1525245)
Backed out changeset 4772db3625b3 (bug 1525245)
Backed out changeset 9affaf0cb998 (bug 1525245)
Backed out changeset a91b7ebe8bdd (bug 1525245)
Backed out changeset c2a13a7480e1 (bug 1525245)
Backed out changeset abe4482fa137 (bug 1525245)
Backed out changeset b3920c0bcf84 (bug 1525245)
Backed out changeset 0821b81f2724 (bug 1525245)
Backed out changeset 70bed2ad7899 (bug 1525245)
Backed out changeset 5f72ba232cc8 (bug 1525245)
2019-03-07 17:54:18 +02:00
Andrea Marchesini 78f43c5536 Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 11 - windows/workers/documents must keep the current cookie settings and ignore changes, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D18960

--HG--
extra : moz-landing-system : lando
2019-03-07 10:18:45 +00:00
Dorel Luca ac34e1d973 Backed out 16 changesets (bug 1525245) for Android failures. CLOSED TREE
Backed out changeset 9f8a1b410320 (bug 1525245)
Backed out changeset 0ef284a9a1d5 (bug 1525245)
Backed out changeset 835e5f642a03 (bug 1525245)
Backed out changeset 362f5a8d033c (bug 1525245)
Backed out changeset 9da3ab33cf67 (bug 1525245)
Backed out changeset 6aacd2d6e835 (bug 1525245)
Backed out changeset 8ff9e8f45e02 (bug 1525245)
Backed out changeset 2020227181cc (bug 1525245)
Backed out changeset fc3c64c330b9 (bug 1525245)
Backed out changeset 2762bf88e050 (bug 1525245)
Backed out changeset ffc10fdc50a6 (bug 1525245)
Backed out changeset bb6ade1207d7 (bug 1525245)
Backed out changeset 1875eb5085e4 (bug 1525245)
Backed out changeset 7e4f67a6d6f1 (bug 1525245)
Backed out changeset e671fc9581eb (bug 1525245)
Backed out changeset b89f5def8d0d (bug 1525245)
2019-03-06 21:07:49 +02:00
Andrea Marchesini cc423cd937 Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 11 - windows/workers/documents must keep the current cookie settings and ignore changes, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D18960

--HG--
extra : moz-landing-system : lando
2019-03-06 17:03:33 +00:00
Ehsan Akhgari 6b550507ec Bug 1532402 - Part 3: Pass a principal pointer nsContentUtils::ShouldResistFingerprinting() in the user-agent spoofing code for the rest of the Navigator properties; r=baku
Depends on D21991

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

--HG--
extra : moz-landing-system : lando
2019-03-05 23:13:22 +00:00
Brindusan Cristian 3707df1311 Backed out 4 changesets (bug 1532402) for assertion failures at Navigator.cpp. CLOSED TREE
Backed out changeset 135025f2d2c0 (bug 1532402)
Backed out changeset 6df23def6c36 (bug 1532402)
Backed out changeset ed1e303084c4 (bug 1532402)
Backed out changeset 589d985b3cfe (bug 1532402)
2019-03-05 21:41:08 +02:00
Ehsan Akhgari b9adb18a0b Bug 1532402 - Part 3: Pass a principal pointer nsContentUtils::ShouldResistFingerprinting() in the user-agent spoofing code for the rest of the Navigator properties; r=baku
Depends on D21991

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

--HG--
extra : moz-landing-system : lando
2019-03-05 15:53:57 +00:00
Brian Hackett 448cf790fe Bug 1522244 - Fix previewing in worker threads for several builtin classes, r=lsmyth. 2019-03-03 07:05:07 -10:00
Daniel Varga 74f08acf9b Backed out changeset 4047bcadec73 (bug 1522244) for mochitest failure at devtools/client/debugger/new/test/mochitest/browser_dbg-worker-scopes.js a=backout
--HG--
extra : rebase_source : 3ad963907a2364fa351e67b957f49d3d754e5efb
2019-03-02 00:01:01 +02:00
Brian Hackett 75c921ea5c Bug 1522244 - Fix previewing in worker threads for several builtin classes, r=lsmyth.
--HG--
extra : rebase_source : cdd1d02a69a17709aff17ac2d6d13f6f0039d5bb
2019-02-28 06:24:46 -10:00
Andreea Pavel 3f0c70001c Backed out 2 changesets (bug 1526557, bug 1522244) for failing xpcshell at test_framebindings-02.js on a CLOSED TREE
Backed out changeset 67bef7d63d86 (bug 1526557)
Backed out changeset 09f23a363606 (bug 1522244)
2019-02-28 03:27:12 +02:00
Brian Hackett 337b884850 Bug 1522244 - Fix previewing in worker threads for several builtin classes, r=lsmyth.
--HG--
extra : rebase_source : 2af71f479062e128c1a01d772a19840f87dca4b0
2019-02-27 09:42:58 -10:00
Luke Wagner fc9dea6cc7 Bug 1520931 - Remove asm.js cache hooks JS API (r=bbouvier)
--HG--
extra : rebase_source : aac95865af1b87970d49b89edbec0acad6c74219
2019-02-11 11:41:57 -06:00
Chris Peterson 8e1848413c Bug 1507049 - Rename MOZ_CRASH_UNSAFE_OOL MOZ_CRASH_UNSAFE. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D18515

--HG--
extra : rebase_source : e8ef6eec0f7542bb381e2da81ae6431b2828aabc
extra : source : a8c262b4a2579e6def1b3a5a8220f5197b443e34
2019-02-03 00:09:37 -08:00
Jeff Walden 59aaefa333 Bug 1522350 - Move JS::ContextOptions{,Ref} to a new js/public/ContextOptions.h header to further slim jsapi.h. r=arai
--HG--
rename : js/src/jsapi.h => js/public/ContextOptions.h
2019-01-23 16:56:56 -08:00
Jon Coppeard de2d55ee8b Bug 1521524 - Replace some uses of the 'API' GC reason with more informative ones r=sfink 2019-01-24 12:34:55 +00:00
Benjamin Bouvier b6e305766e Bug 1509441: Unify wasm compilation switches under the --wasm-compiler umbrella; r=lth
--HG--
extra : rebase_source : 47a370c182bacc170bf83be3e2b3dbdbc488a787
2019-01-23 12:33:01 +01:00
Lars T Hansen d66fb136aa Bug 1508561 - Disentangle support for reftypes and gc. r=jseward
This does the following:

- It introduces a controlling ifdef ENABLE_WASM_REFTYPES that enables
  exactly those features that are in the reftypes proposal, excluding
  those in the gc proposal.  Any remaining features (namely, ref.eq,
  (ref T) types, struct types) are still under ENABLE_WASM_GC control.
  ENABLE_WASM_GC requires ENABLE_WASM_REFTYPES and this is checked.

- It introduces a new TestingFunctions predicate, wasmReftypesEnabled,
  that distinguishes reftype-proposal support from gc-proposal
  support.  We keep wasmGcEnabled to test for gc-proposal support.

- It segregates test cases so that gc-proposal relevant tests are in
  their own files, and tests relevant to the reftypes-proposal are now
  guarded by wasmReftypesEnabled.

- It renames the predicate HasGcSupport() as HasReftypesSupport(),
  since that is what the predicate tests for.

- It has a drive-by fix for the DEBUG-only function wasm::Classify()
  to properly put ref.null and ref.is_null under ifdef control.

Reftypes will soon be enabled unconditionally in Nightly (once we can
trace pointers from Ion frames) while gc-types will remain conditional
until Ion supports all the new instructions for struct types.  Therefore:

- The command line switch and about:config option are still called
  --wasm-gc and j.o.wasm_gc, respectively, which is fine since they will
  fairly soon control only gc-proposal features.

- Internal names still use "Gc" rather than "Reftypes", eg,
  HasGcTypes, wasmGc_, and so on.  This is most appropriate since it
  reduces the scope of the patch and these names will pertain mainly
  to the gc feature in the future.

--HG--
extra : rebase_source : 51cf3bfe67da594e89195472e4ce1ccfa36c146d
2018-12-18 17:26:32 +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