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

1312 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke ed0c4bbf24 Bug 1663924 - Split BorrowedStatement from CachedStatement. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D90234
2020-09-29 10:57:19 +00:00
Dave Townsend d41d51406e Bug 1657965: Remove expired async storage telemetry. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D86412
2020-09-28 16:47:51 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Dave Townsend c9061686f8 Bug 1635489: Add telemetry on the status of sqlite database accesses. r=mak
Includes baddataDB.sqlite which is a copy of goodDB.sqlite but with what appears
to be the row count inflated beyond the end of the file. This causes loading the
database to succeed but queries to fail.

This increments a scalar for every database open and for every database query
where a query is the full execution of a statement from start to completion. If
a statement is re-used then the scalar will be incremented once for each use.

Differential Revision: https://phabricator.services.mozilla.com/D73938
2020-08-11 20:55:33 +00:00
Razvan Maries be21687a00 Backed out changeset af815754d58a (bug 1635489) for perma failures on test_statement_executeAsync.js. CLOSED TREE 2020-08-11 00:21:05 +03:00
Dave Townsend d49a4517e8 Bug 1635489: Add telemetry on the status of sqlite database accesses. r=mak
Includes baddataDB.sqlite which is a copy of goodDB.sqlite but with what appears
to be the row count inflated beyond the end of the file. This causes loading the
database to succeed but queries to fail.

This increments a scalar for every database open and for every database query
where a query is the full execution of a statement from start to completion. If
a statement is re-used then the scalar will be incremented once for each use.

Differential Revision: https://phabricator.services.mozilla.com/D73938
2020-08-10 20:09:27 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke 032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Magnus Melin a605833bc3 Bug 1654626 - fix crash in [@ mozilla::storage::Connection::ExecuteAsync]. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D84589
2020-07-23 21:38:52 +00:00
Marco Bonardo 60239c6b26 Bug 1652546 - Disable mozStorage exclusive lock fallback for file URIs. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D83636
2020-07-16 01:56:11 +00:00
Geoff Lankow 18668c950f Bug 1652630 - Fix variable redefinition to un-break the Thunderbird build r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D83447
2020-07-14 02:13:24 +00:00
Marco Bonardo 14784dc42d Bug 1650201 - Fix mozStorage prefs read before profile and fallback to a non-exclusive VFS when it can't get an exclusive lock. r=asuth,geckoview-reviewers,agi
mozStorage used to read prefs on service init, because they could only be read
on the main-thread. When service init was moved earlier, it started trying
to read prefs too early, before the profile was set up, thus it ended up always
reading the default value.

This patch moves the only relevant pref to mirrored StaticPrefs that can be accessed
from different threads, and removes two preferences that apparently are not necessary
(they have been broken from a long time) for now.
In particular, providing a global synchronous setting is a footgun, each consumer should
decide about their synchronous needs, rather than abusing a dangerous "go fast" setting.
The page size is something we don't change from quite some time, and it's unlikely to be
used to run experiments in the wild before doing local measurements first, for which Try
builds are enough.

The remaining exclusiveLock pref is a bit controversial, because in general exclusive lock
is better for various reasons, and mostly it is necessary to use WAL on network shares.
Though developers may find it useful for debugging, and some third parties are doing
dangerous things (like copying over databases) to work around it, for which it's safer to
provide a less dangerous alternative.
Note exclusive lock only works on Unix-derived systems for now (no Windows implementation).

Finally, this introduces a fallback to exclusive lock, so that if a third party is using our
databases, so that we can't get an exclusive lock, we'll fallback to normal locking.

Differential Revision: https://phabricator.services.mozilla.com/D82717
2020-07-10 21:45:53 +00:00
Kris Maglione b6be72f351 Bug 1649554: Part 1 - Move deprecated component registration helpers out of XPCOMUtils. r=mccr8,remote-protocol-reviewers,marionette-reviewers,perftest-reviewers,webcompat-reviewers,whimboo,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D81749
2020-07-10 23:58:30 +00:00
Kris Maglione 9d78661f88 Bug 1649221: Update ChromeUtils.generateQI callers to pass strings. r=mccr8,remote-protocol-reviewers,marionette-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,preferences-reviewers,agi,whimboo,Bebe,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D81594
2020-07-10 23:58:28 +00:00
Kris Maglione 6a39211860 Bug 1464542: Part 3b - Add existing Services.jsm registrations to the new services cache. r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D81419
2020-07-09 21:42:25 +00:00
Csoregi Natalia b355fcc4bf Backed out 6 changesets (bug 1464542) for xpcshell failures on test_Services.js. CLOSED TREE
Backed out changeset b50af9005851 (bug 1464542)
Backed out changeset 9d3a0ea2cf65 (bug 1464542)
Backed out changeset 71c3475fcbc2 (bug 1464542)
Backed out changeset 51ff93220a95 (bug 1464542)
Backed out changeset e84de1547c09 (bug 1464542)
Backed out changeset bbecc16d08eb (bug 1464542)
2020-07-09 23:19:26 +03:00
Kris Maglione d09458dc51 Bug 1464542: Part 3b - Add existing Services.jsm registrations to the new services cache. r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D81419
2020-07-09 17:59:16 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Tom Tung 3e754f2b5c Bug 1645943 - Override xFullPathname to avoid the use of GetFullPathNameW; r=janv,asuth
Differential Revision: https://phabricator.services.mozilla.com/D80202
2020-06-24 16:08:45 +00:00
Haik Aftandilian 82ec0b2bdb Bug 1643491 - Check for cancellation in SQLITE_BUSY loop r=mak
Check for cancellation in SQLITE_BUSY loop and refactor SQLITE_BUSY handling to release/acquire mMutex only once.

Differential Revision: https://phabricator.services.mozilla.com/D78565
2020-06-09 19:47:53 +00:00
Simon Giesecke 810a23f6ad Bug 1620198 - Part 4: Remove mozIStorageAggregateFunction. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D65508
2020-06-08 10:00:31 +00:00
Simon Giesecke 3628030e06 Bug 1620198 - Part 3: Change type of FunctionInfo::function to nsCOMPtr<mozIStorageFunction>. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D65507
2020-06-08 10:00:24 +00:00
Simon Giesecke 4fa00c14c3 Bug 1620198 - Part 2: Remove FunctionInfo::type. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D65506
2020-06-08 10:00:14 +00:00
Simon Giesecke f3d8e02f37 Bug 1620198 - Part 1: Remove CreateAggregateFunction. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D65505
2020-06-08 09:59:57 +00:00
Ryan VanderMeulen 750150f551 Bug 1619522 - Upgrade to SQLite 3.32.1. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D76860
2020-05-29 14:18:09 +00:00
Emilio Cobos Álvarez 54fd961a29 Bug 1641245 - Make string comparators not virtual. r=froydnj,necko-reviewers,geckoview-reviewers,jgilbert,agi,valentin
There's no use case for stateful comparators, so they can be just plain
function pointers.

This is used in some hot places like CSS selector matching.

Differential Revision: https://phabricator.services.mozilla.com/D77084
2020-05-27 18:11:12 +00:00
Nathan Froyd 0541624397 Bug 1639658 - make AsyncExecuteStatements use mozilla::Runnable; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D76201
2020-05-20 18:41:28 +00:00
Simon Giesecke e6422e2afd Bug 1626570 - Remove obsolete copy enabling machinery. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D72176
2020-05-11 08:23:03 +00:00
Simon Giesecke d0816721e3 Bug 1626570 - Improve handling of copying arrays in storage/. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D73683
2020-05-06 11:54:36 +00:00
Simon Giesecke 2d8c4390b7 Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D71300
2020-04-24 13:35:27 +00:00
Andreas Farre 63e21eec70 Bug 1620594 - Part 1: Rework NS_ReleaseOnMainThreadSystemGroup. r=nika
To be able to remove SystemGroup, NS_ReleaseOnMainThreadSystemGroup
needs to have its dependency on SystemGroup removed. Since all
releases using SystemGroup would've released on the main thread anyway
we can safely replace NS_ReleaseOnMainThreadSystemGroup with
NS_ReleaseOnMainThread.

Depends on D64390

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

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:23 +00:00
Simon Giesecke 2e68c75bb1 Bug 1626973 - Add assertions for result of MaybeUpdateSize. r=janv,dom-workers-and-storage-reviewers
Depends on D69580

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

--HG--
extra : moz-landing-system : lando
2020-04-03 16:16:50 +00:00
Eric Rahm 12ca859e67 Bug 1626456 - Remove stray nsAutoPtr.h includes. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D69127

--HG--
extra : moz-landing-system : lando
2020-04-03 21:05:46 +00:00
Simon Giesecke 58d0171406 Bug 1620632 - Ensure nsTArray_Impl only declares a copy-constructor/assignment operator if E is copy-constructible. r=froydnj
To correctly implement this, it must be known on instantiation whether E is
copy-constructible, which is not the case if only a forward declaration is
available. This can be resolved either by making sure a full definition of E is
available, which is preferable. But in cases where this is not (easily) possible,
the information can be explicitly provided by the MOZ_DECLARE_COPY_CONSTRUCTIBLE
and MOZ_DECLARE_NON_COPY_CONSTRUCTIBLE macros. In particular, declarations for
IPDL-declared types are added to nsTArray.h itself, like it was already done
for MOZ_DECLARE_RELOCATE_USING_MOVE_CONSTRUCTOR.

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

--HG--
extra : moz-landing-system : lando
2020-03-20 17:13:51 +00:00
Lina Cambridge 534fd0e715 Bug 1622949 - Add `HashPropertyBag::clone_from_bag`. r=froydnj
`clone_from_bag` lets Rust code create a thread-safe `HashPropertyBag`
from any kind of `nsIPropertyBag` by cloning its contents. This is
important when you want to use a property bag that's passed to an XPIDL
method off the main thread. An `nsIPropertyBag` passed from JS isn't
thread-safe, since it's cycle-collected, and its properties are
`XPCVariant`s. But a Rust `HashPropertyBag` is, because it's backed by
a non-cycle collected `nsHashPropertyBag`, and the only supported
properties are thread-safe storage variants.

It also marks `HashPropertyBag` as `Send + Sync`, given that the only
way to construct one is through `HashPropertyBag::new`, and
`VariantType` is only implemented for storage variants.

Finally, it adds more type tags for string (narrow and wide) variants,
and changes the `VariantType for nsCString` getter to use
`GetAsAUTF8String`, since that's what mozStorage implements for its
text variant, not `GetAsACString`.

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

--HG--
extra : moz-landing-system : lando
2020-03-17 23:33:45 +00:00
Simon Giesecke c2d3f05163 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in storage. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D65498

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:56 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 1bdb56207c Bug 1613985 - Use default for equivalent-to-default constructors/destructors in storage. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D65498

--HG--
extra : moz-landing-system : lando
2020-03-16 09:07:54 +00:00
Ed Lee acb960676c Bug 1620556 - Automatic code fixes for Prettier 1.19.1 upgrade. r=Standard8,remote-protocol-reviewers,marionette-reviewers,webcompat-reviewers,perftest-reviewers,sparky,whimboo,denschub
Differential Revision: https://phabricator.services.mozilla.com/D66128

--HG--
extra : moz-landing-system : lando
2020-03-13 23:38:52 +00:00
Cosmin Sabou 9ec8941cd4 Backed out 2 changesets (bug 1603703) for xpc failures on test_storage_aggregates.js. CLOSED TREE
Backed out changeset 05dbbf7c379f (bug 1603703)
Backed out changeset a1e723439116 (bug 1603703)

--HG--
extra : rebase_source : 65d834f15b63fdd0ce5c90d2efd080e4841777aa
2020-03-05 19:37:32 +02:00
Simon Giesecke 9e296ae57f Bug 1603703 - Part 2: Rename CreateFunction/RemoveFunction to RegisterFunction/UnregisterFunction. r=mak
Depends on D57089

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

--HG--
extra : moz-landing-system : lando
2020-03-05 15:14:56 +00:00
Simon Giesecke e6cae211c4 Bug 1603703 - Part 1: Change mozIStorageAsyncConnection::CreateFunction to accept a nsCOMPtr rather than a raw pointer. r=asuth,mak
Differential Revision: https://phabricator.services.mozilla.com/D57089

--HG--
extra : moz-landing-system : lando
2020-03-05 16:51:14 +00:00
Lina Cambridge 38a1672309 Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak
Previously, `mozIStorageConnection#transactionInProgress` returned true
only if a transaction was started via `beginTransaction()`. This meant
that manually executing `BEGIN`, as `Sqlite.jsm` and the Rust bindings
do, wouldn't accurately report if a transaction was in progress.
Similarly, the flag wasn't accurate in cases where SQLite automatically
rolled back a transaction.

Fortunately, SQLite provides the `sqlite3_get_autocommit()` function,
which we can use to determine if a transaction is open or not. This
commit refactors the `transactionInProgress` getter, along with all
`Connection` methods that depend on it, to use the SQLite API instead
of managing that state on the connection. `mozStorageTransaction` and
`Sqlite.jsm` still use their own flags to decide whether to commit
their transactions, for reasons explained in the IDL comment.

This commit also moves `transactionInProgress` to
`mozIStorageAsyncConnection`, so that `Sqlite.jsm` can use it, and
exposes it to Rust.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 22:57:39 +00:00
shindli db1eff80fd Backed out 2 changesets (bug 1613835) for causing very frequent xpcshell failures in netwerk/test/unit/test_cookies_async_failure.js CLOSED TREE
Backed out changeset 4d2e14adc96b (bug 1613835)
Backed out changeset 61fb3c36ea92 (bug 1613835)
2020-03-03 20:44:17 +02:00
Lina Cambridge 99282e0bd7 Bug 1613835 - Use a SQLite API call to check for in-progress transactions. r=mak
Previously, `mozIStorageConnection#transactionInProgress` returned true
only if a transaction was started via `beginTransaction()`. This meant
that manually executing `BEGIN`, as `Sqlite.jsm` and the Rust bindings
do, wouldn't accurately report if a transaction was in progress.
Similarly, the flag wasn't accurate in cases where SQLite automatically
rolled back a transaction.

Fortunately, SQLite provides the `sqlite3_get_autocommit()` function,
which we can use to determine if a transaction is open or not. This
commit refactors the `transactionInProgress` getter, along with all
`Connection` methods that depend on it, to use the SQLite API instead
of managing that state on the connection. `mozStorageTransaction` and
`Sqlite.jsm` still use their own flags to decide whether to commit
their transactions, for reasons explained in the IDL comment.

This commit also moves `transactionInProgress` to
`mozIStorageAsyncConnection`, so that `Sqlite.jsm` can use it, and
exposes it to Rust.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 15:24:06 +00:00
Sylvestre Ledru 7ba14f1431 Bug 1617369 - Reformat storage/variant/ using rustfmt r=lina
Depends on D64871

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

--HG--
extra : moz-landing-system : lando
2020-03-02 15:48:30 +00:00
Marco Bonardo b5b6473a6d Bug 1611386 - Drop support for --enable-system-sqlite. r=asuth,glandium
Differential Revision: https://phabricator.services.mozilla.com/D63177

--HG--
extra : moz-landing-system : lando
2020-02-20 22:16:03 +00:00
Marco Bonardo 8eb5703927 Bug 1616896 - inline ifdefs in SqliteMutex.h. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D63515

--HG--
extra : moz-landing-system : lando
2020-02-20 18:40:27 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Marco Bonardo ext:(%20%3Cmbonardo%40mozilla.com%3E) 142f9d8d72 Bug 1611925 - Stop doing our own special parsing of Sqlite zName to build the Quota Object. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D61169

--HG--
extra : moz-landing-system : lando
2020-02-04 10:18:47 +00:00
Doug Thayer 185e25fddf Bug 1606880 - Implement fast shutdown prefs r=froydnj
I originally had this as a few patches, but the work to fix test
failures and get the whole thing into a complete working state
quickly tangled them up. Apologies for that. To summarize what's
going on here, however:

- We introduce two prefs: shutdown.fastShutdownStage and
  shutdown.lateWriteChecksStage. The latter pref is set to 1, which
  will leave the existing late write checking behavior unchanged.
  However, we introduce this pref to make it simpler in the future
  to bump the late write checks window earlier in the shutdown cycle.
- We introduce an AppShutdown class, which will house static methods
  and a small amount of state for unifying some shutdown logic. Most
  importantly, it will now manage the state for app initiated restarts,
  as well as the logic for performing a safe fast shutdown.
- We refactored the existing restart code to call into the new
  AppShutdown file, so that if we are configured to actually perform
  a fast shutdown, we will be able to run the necessary restart logic
  immediately before doing so. Previously, the restart logic occurred
  later in the shutdown cycle than our late write checking, meaning
  if we were to simply exit the process at that point in time, we
  would never run the restart coe.
- Lastly, we updated two locations which called TerminateProcess and/or
  _exit(0) to call into the AppShutdown method (DoFastShutdown).

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

--HG--
extra : moz-landing-system : lando
2020-01-29 12:29:43 +00:00
Simon Giesecke 916d2ad550 Bug 1414737 - Ensure Connection::GetQuotaObjects only returns NS_OK if the quota objects are non-null. r=janv,dom-workers-and-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D60135

--HG--
extra : moz-landing-system : lando
2020-01-23 12:46:46 +00:00
Sylvestre Ledru cc2040bf21 Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

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

--HG--
extra : moz-landing-system : lando
2020-01-18 13:48:34 +00:00
Dorel Luca 506e65bcab Backed out changeset bbb39655cf71 (bug 1605934) for build bustage in widget/gtk/mozwayland/mozwayland.c 2020-01-18 15:39:55 +02:00
Sylvestre Ledru 6689a37527 Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

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

--HG--
extra : moz-landing-system : lando
2020-01-18 13:16:39 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Jeff Walden 62a130ba0a Bug 1602882 - Move array operations to a new js/Array.h header. r=sfink,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D56595

--HG--
extra : moz-landing-system : lando
2019-12-11 06:17:44 +00:00
Gabriele Svelto 5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Tom Tung a973874d9b Bug 1576593 - P2 - Change the way for tunneling quota information to SQLite; r=janv
Differential Revision: https://phabricator.services.mozilla.com/D48183

--HG--
extra : moz-landing-system : lando
2019-10-25 12:02:10 +00:00
Lina Cambridge 9d9b081407 Bug 1588329 - Introduce `mozIStorageAsyncConnection::variableLimit`. r=mak
This is a wrapper around the `sqlite3_limit` interface that returns the
binding parameter limit. Adding this getter lets us clean up the inline
`SQLITE_MAX_VARIABLE_NUMBER` constants scattered around Places.

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

--HG--
extra : moz-landing-system : lando
2019-10-15 21:22:57 +00:00
Jan de Mooij 6febd292ea Bug 1586683 - Remove flat strings from JSAPI. r=jwalden,bzbarsky
We want to remove flat strings (JSFlatString). With this patch we only expose
linear strings (JSLinearString) to API consumers.

This is very mechanical for the most part, because code typically only cares
about linear strings and not the null-termination aspect.

CTypes's Library.cpp has some Windows-specific code where we relied on null-terminated
strings. This patch adds JS_CopyStringCharsZ for that use case.

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

--HG--
extra : moz-landing-system : lando
2019-10-14 09:32:07 +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
Boris Zbarsky 44c015a4b0 Bug 1584431 part 4. Use the new length-aware versions of JS_StringEqualsAscii and JS_FlatStringEqualsAscii where possible. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D47393

--HG--
extra : moz-landing-system : lando
2019-09-27 21:25:23 +00:00
Lina Cambridge 065c7d61d2 Bug 1582379 - Include more context in Rust mozStorage errors. r=tcsc
A low-frequency error that showed up in telemetry for new bookmark
sync is "Storage operation failed with NS_ERROR_CANNOT_CONVERT_DATA",
which occurs when we try to convert a variant to the wrong type. It
would be helpful to include the type and column names for this case;
for example, "Can't get i32 for column lastModified". Neither the type
nor column name are PII; we want them to show up in telemetry.

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

--HG--
extra : moz-landing-system : lando
2019-09-19 21:16:59 +00:00
Gijs Kruitbosch 847224881f Bug 1575692 - do not recreate the DB file via the directory service inside DatabaseLocker class off the mainthread, r=mak
Differential Revision: https://phabricator.services.mozilla.com/D43225

--HG--
extra : moz-landing-system : lando
2019-08-27 14:31:48 +00:00
Jan Varga 9f906cd7c4 Bug 1563023 - Part 1: Implement per client usage tracking; r=asuth
This patch adds a fixed-size array of client usages to OriginInfo and modifies
quota tracking APIs to require the client type to be passed in.
A new method ResetUsageForClient is implemented. The method is used during
client-specific origin clearing. ResetUsageForClient is much faster than calling
GetUsageForOrigin and calling DecreaseUsageForOrigin after that.
LockedUsage now has an assertion that verifies that the total sum of client
usages matches total origin usage. This method should be called instead of
touching mUsage directly.
A new assertion is added to GetQuotaObject which verifies that passed file
belongs to the given persistence type, origin, and client.

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

--HG--
extra : moz-landing-system : lando
2019-08-22 13:06:48 +00:00
Mike Hommey 103c1bec20 Bug 1567739 - Stop using deprecated rust libc integer types in storage_variant and kvstore. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D38940

--HG--
extra : moz-landing-system : lando
2019-07-23 00:13:43 +00:00
Olli Pettay bbc417c890 Bug 1565056, merge ImgDecoder and mozStorage threads in THREAD_WAKEUP telemetry, r=tnikkel,asuth
Differential Revision: https://phabricator.services.mozilla.com/D37643

--HG--
extra : moz-landing-system : lando
2019-07-11 04:03:44 +00:00
Victor Porof 93517ce014 Bug 1561435 - Fix linting errors for storage/, r=standard8
# ignore-this-changeset

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

--HG--
extra : source : 79fe200fde95a459a3af42ce5818d09fbba2dbda
extra : intermediate-source : 6359e8b271dfe06430ac7f373ae14b72f1ede5da
2019-06-21 13:32:39 -07:00
Victor Porof 9eeaa5c80c Bug 1561435 - Format storage/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : 77bfd37cea066708241ba39795e94f5ee4a06ff6
2019-07-05 10:59:24 +02:00
Eden Chuang e8c9e6170c Bug 1516333 - Part 1: Move group and origin re-escaping from QuotaManager::GetQuotaObject to GetQuotaObjectFromNameAndParameters in TelemetryVFS.cpp; r=janv,asuth
Differential Revision: https://phabricator.services.mozilla.com/D33769
2019-06-07 08:04:57 +02:00
Ehsan Akhgari 4cb428d268 Bug 1555205 - Move db/sqlite3 to third_party/; r=mak
Differential Revision: https://phabricator.services.mozilla.com/D32939

--HG--
rename : db/sqlite3/README => third_party/sqlite3/README
rename : db/sqlite3/README.MOZILLA => third_party/sqlite3/README.MOZILLA
rename : db/sqlite3/src/moz.build => third_party/sqlite3/src/moz.build
rename : db/sqlite3/src/sqlite.symbols => third_party/sqlite3/src/sqlite.symbols
rename : db/sqlite3/src/sqlite3.c => third_party/sqlite3/src/sqlite3.c
rename : db/sqlite3/src/sqlite3.h => third_party/sqlite3/src/sqlite3.h
extra : moz-landing-system : lando
2019-05-29 10:16:29 +00:00
Sylvestre Ledru 993c03acb1 Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D31769

--HG--
extra : moz-landing-system : lando
2019-05-22 22:37:14 +00:00
Boris Zbarsky 202f15eaec Bug 1552547 part 2. Stop using [array] in mozIStorageBindingParams. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D31659

--HG--
extra : moz-landing-system : lando
2019-05-20 16:30:12 +00:00
Boris Zbarsky f1f2d7ade1 Bug 1552547 part 1. Stop using [array] in mozIStorageAsyncConnection.executeAsync. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D31658

--HG--
extra : moz-landing-system : lando
2019-05-20 16:17:51 +00:00
Boris Zbarsky 4073a4a809 Bug 1551929. Mark some storage interfaces builtinclass, since we assume there are no JS implementations already. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D31342

--HG--
extra : moz-landing-system : lando
2019-05-16 11:23:44 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Lina Cambridge 21a7f49fb0 Bug 1545200 - Squelch spurious synchronous operation warnings in `Connection::operationSupported`. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D27959

--HG--
extra : moz-landing-system : lando
2019-04-17 19:10:28 +00:00
Andrea Marchesini 85f93c4ddc Bug 1541934 - mozStorageConnection can crash on shutdown, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D26491

--HG--
extra : moz-landing-system : lando
2019-04-11 16:43:13 +00:00
Andreea Pavel 35a8067dab Backed out changeset 6e87244c4b89 (bug 1541934) for failing xpcshell at test_removeDataFromDomain.js on a CLOSED TREE 2019-04-11 16:57:19 +03:00
Andrea Marchesini afbad5faf0 Bug 1541934 - mozStorageConnection can crash on shutdown, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D26491

--HG--
extra : moz-landing-system : lando
2019-04-11 11:14:51 +00:00
Lina Cambridge 9dee2518ef Bug 1543295 - Pass the text length when creating an `nsString` from a SQLite text result. r=mak
This commit updates mozStorage to always:

* Pass the length, using sqlite3_{column, value}_bytes16, when
  creating an nsDependentString from a pointer.
* Call sqlite3_{column, value}_bytes{16} after
  sqlite3_{column, value}_{text, blob, text16}, per the
  recommendation in https://www.sqlite.org/c3ref/column_blob.html.
  Some callers did this before, or in unclear order, since C++ doesn't
  specify one for evaluating function arguments.
* Pass the byte length to sqlite3_result_text16.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 03:19:39 +00:00
Sylvestre Ledru 03fc65347c Bug 1542146 - Apply the change with the option StatementMacros from clang-format-8 r=andi
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:42:17 +00:00
Jan Varga caa68dc186 Bug 1542104 - LSNG: Incorrect usage calculation of archived data; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D26269
2019-04-05 06:15:21 +02:00
Lina Cambridge 2276deaa8d Bug 1539697 - Report more detailed errors in the mozStorage Rust binding. r=mak,tcsc
The `nsresult` codes that mozStorage returns are often too generic. For
example, `NS_ERROR_FAILURE` might be anything from a SQL syntax error
to an invalid column name in a trigger.

This commit adds a `Conn::call_and_wrap_error` helper that checks the
last SQLite error, and returns that instead of `nsresult`. Not all
errors are SQLite errors, however, so we only use this for mozStorage
methods that return `convertResultCode`.

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

--HG--
extra : moz-landing-system : lando
2019-04-02 16:56:41 +00:00
Lina Cambridge 0cdebe20d7 Bug 1539104 - Add a way to detect supported storage connection operations. r=mak
In retrospect, overloading `Connection::connectionReady` to mean
"is ready _and_ supports this operation" wasn't a good idea. This
commit reverts that change (cfd44c936a9b), and adds two new methods:

* `Connection::operationSupported`, to check if a connection supports
  sync or async operations. This method is public.
* `Connection::ensureOperationSupported`, that asserts or returns an
  error if the connection doesn't support an operation. This is
  private.

`operationSupported` is used by callers like `Service::minimizeMemory`
to detect if the connection supports sync operations, since both sync
and async connections implement `mozIStorageConnection` now.

Finally, some callers used `!mDBConn` to check if the connection was
ready, while others used `connectionReady()`. This commit changes them
to use the latter.

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

--HG--
extra : moz-landing-system : lando
2019-04-02 18:49:21 +00:00
Mark Banner dba6983e75 Bug 1415265 - Remove now unnecessary .eslintrc.js files or entries. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D23850

--HG--
extra : moz-landing-system : lando
2019-03-28 09:38:14 +00:00
Lina Cambridge 3e894ac30e Bug 1482608 - Add basic Rust bindings for mozStorage. r=nika,asuth,mak
This commit wraps just enough of the mozStorage API to support the
bookmarks mirror. It's not complete: for example, there's no way
to open, clone, or close a connection, because the mirror handles
that from JS. The wrapper also omits shutdown blocking and retrying on
`SQLITE_BUSY`.

This commit also changes the behavior of sync and async mozStorage
connections. Async (`mozIStorageAsyncConnection`) methods may be called
from any thread on any connection. Sync (`mozIStorageConnection`)
methods may be called from any thread on a sync connection, and from
background threads on an async connection. All connections now QI
to `mozIStorageConnection`, but attempting to call a sync method on
an async connection from the main thread throws.

Finally, this commit exposes an `OpenedConnection::unsafeRawConnection`
getter in Sqlite.jsm, for JS code to access the underlying connection.

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

--HG--
extra : moz-landing-system : lando
2019-03-25 04:49:18 +00:00
Ryan Hunt 9a799db5fe Bug 1523969 part 22 - Move method definition inline comments to new line in 'storage/'. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D21123

--HG--
extra : rebase_source : 6f31a375d7ac1eccea882565156a90c33b5615f1
extra : histedit_source : 97461995a55fc9df98fdc75028eaf55a636b3c9a
2019-02-25 16:12:31 -06:00
Lina Cambridge 8f82f61df9 Bug 1530506 - Add a generic writable property bag wrapper for Rust code. r=nika
This commit adds a `storage_variant::HashPropertyBag` type that
exposes an idiomatic Rust interface for `nsIWritablePropertyBag`.

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

--HG--
extra : moz-landing-system : lando
2019-02-26 21:53:32 +00:00
Nika Layzell f2d9e32b48 Bug 1530028 - Remove now-unnecessary NsresultExt trait, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D20880

--HG--
extra : moz-landing-system : lando
2019-02-25 15:50:14 +00:00
Gurzau Raul fbe889dd73 Backed out changeset f18666cc5793 (bug 1530028) for build bustages on a CLOSED TREE. 2019-02-25 16:55:00 +02:00
Nika Layzell f4b66e3031 Bug 1530028 - Remove now-unnecessary NsresultExt trait, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D20880

--HG--
extra : moz-landing-system : lando
2019-02-25 00:23:17 +00:00
Kris Maglione b2f85650a1 Bug 1524687: Part 12 - Convert everything else to static registration. r=erahm
--HG--
extra : source : 625f71135038f79c075f758e316fbb00097c9a18
extra : intermediate-source : 7a1ef487a9e74d66b112034051e49b77023860b8
extra : histedit_source : 88d19dbee4a99faa191e49e2847c4c59aba05b0c%2C5ee702f97153152d31124e0c5f3e8318cbeb3195
2019-01-29 16:03:41 -08:00
arthur.iakab 470dbf03b6 Backed out 5 changesets (bug 1524687) for causing build bustages on platform.h CLOSED TREE
Backed out changeset 0f06a6b51bfe (bug 1524687)
Backed out changeset 7a1ef487a9e7 (bug 1524687)
Backed out changeset accad7b4cbc7 (bug 1524687)
Backed out changeset eb33f7e6467c (bug 1524687)
Backed out changeset 86cf09db340b (bug 1524687)
2019-02-21 02:04:02 +02:00