Commit Graph

1263 Commits

Author SHA1 Message Date
Nicholas Nethercote
8b67338005 Bug 1200484 (part 10) - Use JS column numbers in indexedDB. r=khuey. 2015-09-01 18:01:02 -07:00
Nicholas Nethercote
10d95cca57 Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Michael Layzell
5fd427a324 Bug 1147821 - Update IndexedDB to use common StorageAllowedForWindow logic, r=khuey 2015-08-28 10:10:30 -04:00
Yoshi Huang
fd98ffd5d7 Bug 1165272 - Part 2: replace getNoAppCodebasePrincipal. r=bholley 2015-08-18 15:01:42 +08:00
Yoshi Huang
98f6ea7f6c Bug 1165272 - Part 1: remove getAppCodebasePrincipal. r=bholley 2015-08-17 17:03:19 +08:00
Kyle Huey
acd018b89c Bug 1196840: Make IDBTransaction::ObjectStoreNames const. r=baku 2015-08-25 13:30:18 -07:00
Bobby Holley
28a3efa072 Backed out 3 changesets (bug 1165272) for b2g sanity blocker. 2015-08-25 11:16:21 -07:00
Yoshi Huang
053573a7c0 Bug 1165272 - Part 2: Replace getNoAppCodebasePrincipal. r=bholley 2015-08-24 01:18:00 -04:00
Yoshi Huang
25acbe867f Bug 1165272 - Part 1: Remove getAppCodebasePrincipal. r=bholley 2015-08-24 01:31:00 -04:00
Birunthan Mohanathas
c3a5504f48 Bug 1168606 - Part 5: Send two records with every ObjectStoreCursorResponse. r=khuey 2015-08-19 14:59:29 -07:00
Birunthan Mohanathas
0e01e06dec Bug 1168606 - Part 4: Allow current key to be provided with PBackgroundIDBCursor::Continue. r=khuey
The key is assumed to be unset for now.
2015-08-19 14:59:28 -07:00
Birunthan Mohanathas
ba3cc38ba2 Bug 1168606 - Part 3: Allow multiple ObjectStoreCursorResponses in a CursorResponse. r=khuey
For now, we assume that the array only ever contains a single response.
2015-08-19 14:59:25 -07:00
Michael Layzell
1cafd47819 Bug 1165217 - Use nsIPrincipal instead of nsIURI/appId/inBrowser for nsIQuotaManager, r=janv 2015-08-18 20:24:30 -04:00
Birunthan Mohanathas
e6e05569c3 Bug 1192023 - Make UpdateType an enum class. r=khuey 2015-08-06 14:34:39 -07:00
Birunthan Mohanathas
55e4e8564d Bug 1192023 - Use enum class instead of CheckpointMode_ prefix. r=khuey 2015-08-06 14:34:35 -07:00
Birunthan Mohanathas
f036d3bdba Bug 1192023 - Flatten away AppId enum. r=khuey 2015-08-06 14:34:33 -07:00
Birunthan Mohanathas
3751434bfd Bug 1192023 - Use enum class instead of MaintenanceAction_ prefix. r=khuey 2015-08-06 14:34:29 -07:00
Birunthan Mohanathas
c9ba727c58 Bug 1192023 - Use enum class instead of State_ prefix. r=khuey 2015-08-06 14:34:27 -07:00
Kyle Huey
1ffb03e8dc Bug 1179909: Refactor stable state handling. r=smaug
This is motivated by three separate but related problems:

1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).

2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).

3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.

The solve this, this patch does the following:

1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
2015-08-11 06:10:46 -07:00
Jeff Walden
8ef6024e61 Bug 1158399 - Expose the [[DateValue]] field in Date objects only through a ClippedTime class that enforces prior TimeClip-ing on the given value. r=evilpie, r=bz, r=dhylands, r=mt, r=froydnj, r=khuey, r=baku, r=smaug 2015-05-01 19:12:52 -07:00
Reuben Morais
fd3e71878e Bug 1184667 - Remove some unnecessary const_casts from ActorsParent.cpp. r=janv 2015-08-05 15:25:14 -03:00
Kyle Huey
7ef31f3f7e Bug 1188117: Do not allow IDBCursor.delete while cursor update is in progress. r=baku 2015-07-28 15:59:55 -07:00
Kyle Huey
863d358c86 Bug 1180978: Don't proceed with opening an invalidated database. r=janv,baku 2015-07-22 14:46:19 +08:00
Kyle Huey
7001b16a28 Bug 1185836. Nuke warnings from orbit. r=me 2015-07-21 17:07:05 +08:00
Kyle Huey
24193ba821 Bug 1185836: Fix warnings r=me.
CLOSED TREE
2015-07-21 16:52:44 +08:00
Kyle Huey
9bdd9a0259 Bug 1185836: Replace several EnumerateRead calls with the new hashtable iterators. r=baku 2015-07-21 16:38:31 +08:00
Brian Birtles
7c93d1b174 Bug 1182981 part 3 - Use nsTHashtable::Iterator in ActorsParent; r=khuey 2015-07-21 14:46:32 +09:00
Brian Birtles
bf49d6d623 Bug 1182981 part 4 - Use nsTHashtable::Iterator in IDBDatabase; r=njn 2015-07-21 10:48:54 +09:00
Kyle Huey
452b1f0f65 Bug 1184410: Track whether or not the transaction has been active on the connection thread. r=janv
Because StartTransactionOp is a TransactionDatabaseOperationBase, it is possible for it to never run DoDatabaseWork, if the transaction is invalidated before StartTransactionOp runs. In the case of a readwrite transaction, we'll never BeginWriteTransaction() on the connection.

CommitOp, on the other hand, is a DatabaseOperationBase. It doesn't check IsInvalidatedOnAnyThread before running, so it will try to commit the transaction and the assertions will fire because we never called BeginWriteTransaction.

Reworking the inheritance here, if possible, would be hard. Keeping track of the active state on both the background and connection threads is easy though, and we do this sort of thing all over dom/workers. So do that.

This should resolve several intermittent oranges where MOZ_ASSERT(!mInReadTransaction) fires upon committing a transaction.

CLOSED TREE
2015-07-16 10:34:49 -07:00
Ben Turner
2a514b9e4e Bug 1179025 - Protect against using cursors on a deleted objectStore/index, r=janv. 2015-07-02 10:47:53 -07:00
Birunthan Mohanathas
e52329c788 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Ryan VanderMeulen
befa1668b4 Backed out changeset d29782c360fe (bug 1180978) for causing indexedDB assertions.
CLOSED TREE
2015-07-10 12:35:15 -04:00
Kyle Huey
9e077e13c4 Bug 1180978: Don't proceed with opening an invalidated database. r=janv,baku 2015-07-10 07:38:53 -07:00
Birunthan Mohanathas
ae2feaa3f6 Bug 1168606 - Part 2: Convert DelayedDeleteRunnable into reusable DelayedActionRunnable class. r=bent 2015-06-09 07:57:19 -07:00
Birunthan Mohanathas
96230e064f Bug 1168606 - Part 1: Extract Cursor response data population into shared function. r=bent 2015-07-07 11:27:04 -07:00
Emanuel Hoogeveen
31c0c961cd Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Ryan VanderMeulen
81ab24d0bc Backed out changeset d6063656f171 (bug 1179025) for Werror bustage.
CLOSED TREE
2015-07-06 14:00:58 -04:00
Ben Turner
dc3eb40174 Bug 1179025 - Protect against using cursors on a deleted objectStore/index, r=janv. 2015-07-02 10:47:53 -07:00
Juan Gomez
21d73728f3 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Jonathan Watt
0dfb07a4fa Bug 1177688, part 6 - Follow-up to provide a default BlobDirState::eUnknownIfDir arg to BlobImplBase's ctor to avoid excessively specifying the same argument. r=baku 2015-06-23 00:31:40 +01:00
Jonathan Watt
d88c51e319 Bug 1177688, part 1 - Add API and functionality to the BlobImpl classes so that BlobImpl's that are created from an nsIFile can provide information about whether or not the nsIFile was a directory. r=baku 2015-06-23 00:31:28 +01:00
Martin Thomson
202ada6261 Bug 1176434 - Enabling indexedDB for content JS sandboxes, r=bent 2015-07-02 13:30:15 -07:00
Ryan VanderMeulen
6eb6228f53 Backed out changeset c725221a7c45 (bug 1179025) for Werror bustage.
CLOSED TREE
2015-07-02 14:22:28 -04:00
Ben Turner
2db71c193a Bug 1179025 - Protect against using cursors on a deleted objectStore/index, r=janv. 2015-07-02 10:47:53 -07:00
Boris Zbarsky
c70e842138 Bug 1178806. IndexedDB autoincrement overflow should be throwing ConstraintError per spec. r=bent 2015-07-01 00:15:30 -04:00
Boris Zbarsky
368a751274 Bug 1178803. Fix the handling of the 'length' key in IDB keypaths when operating on a string. r=bent 2015-07-01 00:15:30 -04:00
Jan de Mooij
91656f1d39 Bug 1177892 part 3 - Remove OBJECT_TO_JSVAL. r=evilpie 2015-06-30 21:09:46 -07:00
Daniel Holbert
5d2a8734e1 Bug 1130775 followup: Add 'override' keyword to macro-provided AddRef/Release methods for QuotaClient::GetDirectoryLockListener. rs=ehsan 2015-06-30 10:06:24 -07:00
Jan Varga
d8e220fa45 Bug 1170021 - Part 2: Move DirectoryLock out of QuotaManager class; r=bent 2015-06-30 14:59:53 +02:00
Jan Varga
bc82e78a6b Bug 1130775 - Convert synchronized ops and storage registration into unified directory locks; r=bent 2015-06-30 14:59:27 +02:00