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

1220 Коммитов

Автор SHA1 Сообщение Дата
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