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

5472 Коммитов

Автор SHA1 Сообщение Дата
Jan de Mooij 41621582c6 Bug 1674777 part 3 - Change Get*LengthAndData outparam from uint32_t to size_t. r=sfink,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D103275
2021-01-31 08:35:40 +00:00
Jan de Mooij e6456075d7 Bug 1674777 part 1 - Change JS::NewArrayBuffer and JS_New*Array size argument from uint32_t to size_t. r=sfink
A later patch will add a jsapi-test for this.

Differential Revision: https://phabricator.services.mozilla.com/D103273
2021-01-28 15:53:44 +00:00
Jan de Mooij 8d290159a6 Bug 1688616 part 2 - Check for large ArrayBuffer{View}s in WebIDL bindings. r=edgar,lth
The dom::TypedArray type currently represents its length as uint32_t. Changing
that to size_t/uint64_t would cause problems (truncation) for many 'Length()' callers.
Instead of requiring a length check for each of those call sites, for now check for
and reject large array buffers and views in the generated bindings.

Code and tests are based on the implementation of the [AllowShared] attribute.
Additional tests for the new JSAPIs will be added as part of bug 1674777.

Differential Revision: https://phabricator.services.mozilla.com/D102912
2021-01-31 07:33:41 +00:00
Butkovits Atila 80ba5dd933 Backed out 2 changesets (bug 1688616) for casing failures on test_large_arraybuffers.html. CLOSED TREE
Backed out changeset 560718ce8d2c (bug 1688616)
Backed out changeset 7985fd012bc7 (bug 1688616)
2021-01-30 18:10:09 +02:00
Jan de Mooij 2192481240 Bug 1688616 part 2 - Check for large ArrayBuffer{View}s in WebIDL bindings. r=edgar,lth
The dom::TypedArray type currently represents its length as uint32_t. Changing
that to size_t/uint64_t would cause problems (truncation) for many 'Length()' callers.
Instead of requiring a length check for each of those call sites, for now check for
and reject large array buffers and views in the generated bindings.

Code and tests are based on the implementation of the [AllowShared] attribute.
Additional tests for the new JSAPIs will be added as part of bug 1674777.

Depends on D102911

Differential Revision: https://phabricator.services.mozilla.com/D102912
2021-01-27 14:01:44 +00:00
Narcis Beleuzu 1fbccc0d6c Backed out 3 changesets (bug 1680607, bug 1685588, bug 1685586) for SM bustages. CLOSED TREE
Backed out changeset 0382d66d1f7a (bug 1685588)
Backed out changeset bdd7ddb19a48 (bug 1685586)
Backed out changeset cc6fbd4db752 (bug 1680607)
2021-01-27 18:16:33 +02:00
Steve Fink 2fa74ce8a6 Bug 1680607 - Mark dom::TypedArray_base as not allowing GC r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D100430
2021-01-13 22:18:00 +00:00
Kagami Sascha Rosylight 9d5beaf069 Bug 1688335 - Remove .length and .name from namespaces r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D102830
2021-01-25 21:47:12 +00:00
Kagami Sascha Rosylight 69d9e4312c Bug 1686225 - Part 1: Replace infallible with needsErrorResult r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D102254
2021-01-21 15:49:29 +00:00
Steve Fink 4bf3434c15 Bug 1686532 - Add dom::TypedArray_base::Reset() as a signal to the hazard analysis that no invalidatable data is being held onto r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D100429
2021-01-13 22:18:00 +00:00
Steve Fink a75149f6b8 Bug 1684123 - Implement GetArrayBufferViewFixedData and dom::TypedArray_base::FixedData(). r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D100426
2021-01-13 22:17:40 +00:00
Mihai Alexandru Michis bf411e8d30 Backed out 2 changesets (bug 1684123, bug 1682068) for causing bustages.
CLOSED TREE

Backed out changeset e6df68a131a3 (bug 1682068)
Backed out changeset 91ad893cc4d4 (bug 1684123)
2021-01-13 20:34:56 +02:00
Steve Fink 7f06a7503b Bug 1684123 - Implement GetArrayBufferViewFixedData and dom::TypedArray_base::FixedData(). r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D100426
2021-01-13 18:03:25 +00:00
Kartik Gautam 7ae6aea145 Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Sean Feng cab1fa2b49 Bug 1674783 - Implement the Get method for Maplike in webidl r=edgar,smaug
Without the `Get` method, it's hard to extract the values for keys from
Maplike interface in C++.

Differential Revision: https://phabricator.services.mozilla.com/D97247
2021-01-05 23:19:26 +00:00
Cosmin Sabou 2978aa00a3 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam 775cdec032 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Emilio Cobos Álvarez 039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Edgar Chen c9da52cf4e Bug 1680223 - Generate right include for InstrumentedProps; r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D99631
2020-12-16 13:47:53 +00:00
Chris H-C a0efcbcf74 Bug 1673660 - C++ and JS API for Glean Custom Pings r=janerik,webidl,smaug
Covers adding the new JS global `GleanPings` for JS, the new structs for C++ at
mozilla::glean_pings, ping-id and string-table-index codegen, the usual
boilerplate for JS and C++ stuff, and tests.

Unresolved:
* What happens if we call this on a non-parent process?
  (This isn't a supported mode of operation)

Differential Revision: https://phabricator.services.mozilla.com/D98671
2020-12-14 16:50:07 +00:00
Chris H-C 8a65ae0861 Bug 1673660 - Move FOG C++ and JS API scaffolding headers to subdir r=janerik
Headers we want our consumers to use remain in mozilla/glean,
but scaffolding now lives in mozilla/glean/bindings.

This will allow me to have a binding for the GleanPings global in GleanPings.h
AS WELL AS a GleanPings.h which is the C++ consumer API for custom pings.

Differential Revision: https://phabricator.services.mozilla.com/D98670
2020-12-14 16:49:43 +00:00
Emilio Cobos Álvarez 27090924b1 Bug 1682120 - Allow having UTF8String stringifiers. r=edgar
UTF8String is an implementation detail, it behaves the same as
USVString, so no reason it shouldn't be allowed.

Depends on D99587

Differential Revision: https://phabricator.services.mozilla.com/D99588
2020-12-14 11:28:47 +00:00
Emilio Cobos Álvarez fd7551ce10 Bug 1682120 - Coerce strings to utf8 strings before handling treatNullAs. r=edgar
Otherwise stuff like:

  [TreatNullAs=EmptyString] UTF8String priority = ""

Generates bogus code because it thinks that the literal string is a
regular DOMString.

Differential Revision: https://phabricator.services.mozilla.com/D99587
2020-12-14 11:39:57 +00:00
Emilio Cobos Álvarez fcbf80b0fb Bug 1682121 - Add a ToJSValue overload for nsACString. r=hsivonen
I wrote this for bug 1682003, but I split it off it because I don't
really _need_ it (I need it on one place where I know I have valid
utf-8).

I think this is a sensible thing to do though. This throws on invalid
utf-8 via:

  https://searchfox.org/mozilla-central/rev/0bcf81557b89e7757c44e25bb4bc7f4cb8619dc9/js/src/vm/CharacterEncoding.cpp#432

This would allow doing stuff like resolving promises using nsCStrings
slightly more conveniently / efficiently than using NS_ConvertUTF*.

Differential Revision: https://phabricator.services.mozilla.com/D99589
2020-12-14 11:12:11 +00:00
Emilio Cobos Álvarez 5d978443c6 Bug 1681939 - Use nsAutoCString for UTF8String return values. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D99444
2020-12-11 23:15:47 +00:00
Simon Giesecke 4cab6ac723 Bug 1677466 - Move ParamTraits specializations with extra dependencies out of IPCMessageUtils.h. r=mccr8
This moves parts of IPCMessageUtils.h to two new header files and adapts
the include directives as necessary. The new header files are:
- EnumSerializer.h, which defines the templates for enum serializers
- IPCMessageUtilsSpecializations.h, which defines template specializations
  of ParamTraits with extra dependencies (building upon both IPCMessageUtils.h
  and EnumSerializer.h)

This should minimize the dependencies pulled in by every consumer of
IPCMessageUtils.h

Differential Revision: https://phabricator.services.mozilla.com/D94459
2020-12-10 11:09:21 +00:00
Simon Giesecke 1c53236b70 Bug 1679272 - Include ScopeExit.h exactly where used. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98888
2020-12-07 14:25:59 +00:00
Jan de Mooij a24d6b0558 Bug 1673553 part 67 - Remove JS_NewObjectWithUniqueType. r=iain
We no longer need this API to create singleton objects. It was used to prevent
polluting type information.

Differential Revision: https://phabricator.services.mozilla.com/D98499
2020-12-03 07:54:00 +00:00
Simon Giesecke feb7572bff Bug 1678374 - Avoid including jsapi.h from header files. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D97620

Depends on D97618
2020-11-23 16:12:34 +00:00
Simon Giesecke ee949b8e10 Bug 1678374 - Reduce dependencies on js, in particular on jsfriendapi.h. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D97617

Depends on D97616
2020-11-23 16:12:19 +00:00
Simon Giesecke 94b0165df6 Bug 1678374 - Avoid including js/RootingAPI.h from header files. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D97616

Depends on D97467
2020-11-23 16:12:12 +00:00
Simon Giesecke dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Simon Giesecke a61cef41e1 Bug 1673931 - Avoid including ScriptSettings.h from BindingUtils.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D96560

Depends on D96557
2020-11-23 16:10:52 +00:00
Simon Giesecke 3c48c1c404 Bug 1676361 - Remove unused include for GeckoProfiler.h from generated bindings headers. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D96546

Depends on D96545
2020-11-23 16:09:43 +00:00
Simon Giesecke 6fac745ea4 Bug 1673931 - Remove dependency of BindingUtils.h on Document.h.
Differential Revision: https://phabricator.services.mozilla.com/D95048

Depends on D95047
2020-11-23 16:08:03 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
David Major 6e260b8d5a Bug 1677893 - CONFIG["CXX_TYPE"] is not a thing r=firefox-build-system-reviewers,andi,mhentges
Due to lack of `CXX_TYPE`, clang-cl builds were accidentally taking the `else` branch where the `-O0` was ignored/unrecognized. This went unnoticed for a long time until it busted the landing of bug 1677726.

While here, fix the intent of SmokeDMD: `-Og-` is a silent no-op in clang-cl, so it's not actually disabling anything.

Differential Revision: https://phabricator.services.mozilla.com/D97387
2020-11-18 16:01:23 +00:00
Karl Tomlinson 43dbe6d29b Bug 1213512 use a DOMException for MaybeRejectWithNotReadableError() r=baku
This is consistent with
https://w3c.github.io/FileAPI/#dfn-error-codes

Depends on D95968

Differential Revision: https://phabricator.services.mozilla.com/D95969
2020-11-15 22:02:05 +00:00
Tim Huang f0c895fc31 Bug 1641270 - Part 1: Expose cookieJarSettings to UI code through Document. r=smaug,dimi
Differential Revision: https://phabricator.services.mozilla.com/D95611
2020-11-11 11:13:57 +00:00
Mihai Alexandru Michis 4038013e6f Backed out 9 changesets (bug 1641270) for causing dt failures in browser_jsonview_save_json.js
CLOSED TREE

Backed out changeset 89a6dab92f1a (bug 1641270)
Backed out changeset 5f9c5af66b77 (bug 1641270)
Backed out changeset dfeb879f4131 (bug 1641270)
Backed out changeset 143728b1b1ab (bug 1641270)
Backed out changeset 265ae2953416 (bug 1641270)
Backed out changeset 55ea7810c160 (bug 1641270)
Backed out changeset 7bef9112f296 (bug 1641270)
Backed out changeset 2663dc1e9a3e (bug 1641270)
Backed out changeset fcba6dba3649 (bug 1641270)
2020-11-11 13:10:11 +02:00
Tim Huang 5a9cd22328 Bug 1641270 - Part 1: Expose cookieJarSettings to UI code through Document. r=smaug,dimi
Differential Revision: https://phabricator.services.mozilla.com/D95611
2020-11-10 11:47:11 +00:00
Sylvestre Ledru fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila 964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Barret Rennie 96c4d18dcb Bug 1674949 - Don't use self in staticmethod in Codegen.py r=nika
Differential Revision: https://phabricator.services.mozilla.com/D95647
2020-11-03 17:02:02 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Jan-Erik Rediger eeb5f1a8c2 Bug 1646165 - Implement FOG's JavaScript API via WebIDL. r=chutten,webidl,emilio,smaug
This is only the basic outline.
It doesn't do anything yet, but compile.
As there are no metrics generated for it it can't look up anything.

To note: Actual metric types are implemented in XPIDL later.

The following (priviliged) JavaScript code will soon work (if the
corresponding metrics would be defined):

const { Glean } = ChromeUtils.import("resource://gre/modules/Glean.jsm");
Glean.shared.test_only.count_things.add(1);

Differential Revision: https://phabricator.services.mozilla.com/D92211
2020-10-21 11:36:46 +00:00
Mike Hommey 91d99a2d66 Bug 1671376 - Disable -Wmissing-braces on clang < 6. r=firefox-build-system-reviewers,dmajor
The warning is broken in older versions of clang. It also turns out we
were disabling it locally for some directories because of this very
problem.

A few local disable rules stay under accessible/ because they do hide
actual warnings from code generated by MIDL.

Differential Revision: https://phabricator.services.mozilla.com/D94262
2020-10-22 01:31:19 +00:00