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

159 Коммитов

Автор SHA1 Сообщение Дата
Birunthan Mohanathas a727c82e51 Bug 1192023 - Make UpdateType an enum class. r=khuey 2015-08-06 14:34:39 -07:00
Birunthan Mohanathas 752bf80bb4 Bug 1192023 - Use enum class instead of CheckpointMode_ prefix. r=khuey 2015-08-06 14:34:35 -07:00
Birunthan Mohanathas 69151f6831 Bug 1192023 - Flatten away AppId enum. r=khuey 2015-08-06 14:34:33 -07:00
Birunthan Mohanathas e95e1e7d13 Bug 1192023 - Use enum class instead of MaintenanceAction_ prefix. r=khuey 2015-08-06 14:34:29 -07:00
Birunthan Mohanathas 9f71a11dba Bug 1192023 - Use enum class instead of State_ prefix. r=khuey 2015-08-06 14:34:27 -07:00
Kyle Huey 76e3009ab8 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
Reuben Morais 5066ffe155 Bug 1184667 - Remove some unnecessary const_casts from ActorsParent.cpp. r=janv 2015-08-05 15:25:14 -03:00
Kyle Huey 0c59dad482 Bug 1180978: Don't proceed with opening an invalidated database. r=janv,baku 2015-07-22 14:46:19 +08:00
Kyle Huey b030401bd9 Bug 1185836. Nuke warnings from orbit. r=me 2015-07-21 17:07:05 +08:00
Kyle Huey 15a5ec1edf Bug 1185836: Fix warnings r=me.
CLOSED TREE
2015-07-21 16:52:44 +08:00
Kyle Huey 5129adf6dd Bug 1185836: Replace several EnumerateRead calls with the new hashtable iterators. r=baku 2015-07-21 16:38:31 +08:00
Brian Birtles 966c333f8b Bug 1182981 part 3 - Use nsTHashtable::Iterator in ActorsParent; r=khuey
--HG--
extra : commitid : 11ASXiomEJ5
2015-07-21 14:46:32 +09:00
Kyle Huey c14ad0ee62 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 6262017c4a Bug 1179025 - Protect against using cursors on a deleted objectStore/index, r=janv. 2015-07-02 10:47:53 -07:00
Birunthan Mohanathas a8939590de 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 5109d15769 Backed out changeset d29782c360fe (bug 1180978) for causing indexedDB assertions.
CLOSED TREE
2015-07-10 12:35:15 -04:00
Kyle Huey c7a5521db6 Bug 1180978: Don't proceed with opening an invalidated database. r=janv,baku 2015-07-10 07:38:53 -07:00
Birunthan Mohanathas d39c90fbcb Bug 1168606 - Part 1: Extract Cursor response data population into shared function. r=bent 2015-07-07 11:27:04 -07:00
Emanuel Hoogeveen 7d1e52f2ff Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Ryan VanderMeulen b47de52156 Backed out changeset d6063656f171 (bug 1179025) for Werror bustage.
CLOSED TREE

--HG--
extra : rebase_source : 1145bb0bc348b09d14e9239a378ec35d1f474f8e
2015-07-06 14:00:58 -04:00
Ben Turner dd5d843851 Bug 1179025 - Protect against using cursors on a deleted objectStore/index, r=janv. 2015-07-02 10:47:53 -07:00
Ryan VanderMeulen 3da97f6aee Backed out changeset c725221a7c45 (bug 1179025) for Werror bustage.
CLOSED TREE
2015-07-02 14:22:28 -04:00
Ben Turner 34db19da89 Bug 1179025 - Protect against using cursors on a deleted objectStore/index, r=janv.
--HG--
extra : rebase_source : 47580ae73fea87338eb5a33387e7e1afda47a119
2015-07-02 10:47:53 -07:00
Boris Zbarsky 07d97d9536 Bug 1178806. IndexedDB autoincrement overflow should be throwing ConstraintError per spec. r=bent 2015-07-01 00:15:30 -04:00
Daniel Holbert 7e76a840ac 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 283acfefd3 Bug 1170021 - Part 2: Move DirectoryLock out of QuotaManager class; r=bent 2015-06-30 14:59:53 +02:00
Jan Varga baba1643c1 Bug 1130775 - Convert synchronized ops and storage registration into unified directory locks; r=bent
--HG--
rename : dom/quota/OriginOrPatternString.h => dom/quota/OriginScope.h
2015-06-30 14:59:27 +02:00
Ben Turner af54c09757 Bug 1149815 - Properly handle IDBDatabase.close() called during a versionchange transaction, r=janv. 2015-06-20 09:08:30 -07:00
Ben Turner 778f5ee935 Bug 1149815 - Don't assume that index creation always succeeds, r=janv. 2015-06-20 09:08:26 -07:00
Ben Turner dbe52fd678 Bug 1149815 - Guard against using deleted IDBObjectStore and IDBIndex objects, r=janv. 2015-06-20 09:08:23 -07:00
Birunthan Mohanathas 8b524164fa Bug 968520 - Add mozilla::fallible to FallibleTArray::InsertElementSorted calls. r=froydnj 2015-06-08 13:40:00 -07:00
Ben Turner cc64bd1ee4 Bug 1168166 - Ignore failed IndexedDB optimization if disk is too full, r=janv. 2015-06-08 11:11:18 -07:00
Eric Rahm 75c4bebb79 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-03 15:25:57 -07:00
Carsten "Tomcat" Book 5471309381 Backed out 14 changesets (bug 1165515) for linux x64 e10s m2 test failures
Backed out changeset d68dcf2ef372 (bug 1165515)
Backed out changeset 7c3b45a47811 (bug 1165515)
Backed out changeset b668b617bef2 (bug 1165515)
Backed out changeset d0916e1283a2 (bug 1165515)
Backed out changeset ac4dc7489942 (bug 1165515)
Backed out changeset e9632ce8bc65 (bug 1165515)
Backed out changeset c16d215cc7e4 (bug 1165515)
Backed out changeset e4d474f3c51a (bug 1165515)
Backed out changeset d87680bf9f7c (bug 1165515)
Backed out changeset b3c0a45ba99e (bug 1165515)
Backed out changeset 9370fa197674 (bug 1165515)
Backed out changeset 50970d668ca1 (bug 1165515)
Backed out changeset ffa4eb6d24b9 (bug 1165515)
Backed out changeset 5fcf1203cc1d (bug 1165515)

--HG--
extra : rebase_source : 6fb850d063cbabe738f97f0380302153e3eae97a
2015-06-02 13:05:56 +02:00
Eric Rahm a9afd68cef Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-01 22:17:33 -07:00
Wes Kocher 4e9f80ed2e Backed out 14 changesets (bug 1165515) for b2g mochitest-6 permafail CLOSED TREE
Backed out changeset 9b97e2aa2ed9 (bug 1165515)
Backed out changeset 150606c022a2 (bug 1165515)
Backed out changeset 4e875a488349 (bug 1165515)
Backed out changeset 467e7feeb546 (bug 1165515)
Backed out changeset d6b6cc373197 (bug 1165515)
Backed out changeset 0615265b593c (bug 1165515)
Backed out changeset fafd1dce9f08 (bug 1165515)
Backed out changeset d1df869245f9 (bug 1165515)
Backed out changeset 6876a7c63611 (bug 1165515)
Backed out changeset b7841c94a9a3 (bug 1165515)
Backed out changeset e5e3617f7c73 (bug 1165515)
Backed out changeset 39be3db95978 (bug 1165515)
Backed out changeset 0ec74176f8de (bug 1165515)
Backed out changeset 5b928dd10d71 (bug 1165515)
2015-06-01 17:57:58 -07:00
Eric Rahm f82c0e7caf Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-01 14:31:01 -07:00
Birunthan Mohanathas 180b572edb Bug 968520 - Add mozilla::fallible to FallibleTArray::AppendElement calls. r=froydnj 2015-05-28 11:07:44 -07:00
Birunthan Mohanathas 470bd9148f Bug 968520 - Add mozilla::fallible to FallibleTArray::AppendElements calls. r=froydnj 2015-05-28 11:07:43 -07:00
Ben Turner 2e348da54f Bug 858680 - Part 4: Perform maintenance on databases while idle, r=janv.
--HG--
extra : rebase_source : b541f27d0a746949d721584dd061f499209cc05a
2015-05-04 22:56:47 -07:00
Ben Turner 805bc94273 Bug 858680 - Part 2: Add idle notifications to QuotaClient, r=janv.
--HG--
extra : rebase_source : d4ec5e860b885ab01e4e1c19e6aed057b78e5aaa
2015-04-30 13:46:51 -07:00
Ben Turner 52201e6166 Bug 858680 - Part 1: Perform incremental_vacuum on open databases while idle, r=janv.
--HG--
extra : rebase_source : 7e81213dd7bb770db69546ca7c48e0cc7c3a814c
2015-04-30 13:47:03 -07:00
Ryan VanderMeulen 8f6f16604c Merge inbound to m-c. a=merge 2015-05-22 14:02:47 -04:00
Cervantes Yu 23c8a5e12c Backout change 3f62597c7e66 (bug 1156611) due to backout of bug 970307. 2015-05-19 11:26:23 +08:00
Wes Kocher 8526be0c5a Backed out changeset 73a5b49fac38 (bug 858680) for build bustage CLOSED TREE
--HG--
extra : amend_source : 301659435046722d5e68541fe702c89a3442ab0b
2015-05-21 16:44:44 -07:00
Wes Kocher a6c4705f9a Backed out changeset 0aaa67fc61e8 (bug 858680) 2015-05-21 16:44:42 -07:00
Wes Kocher 8f53fad843 Backed out changeset ca9c2b05d659 (bug 858680) 2015-05-21 16:44:36 -07:00
Wes Kocher f1fd091dd9 Backed out changeset 2661dabba074 (bug 858680) 2015-05-21 16:44:14 -07:00
Ben Turner 5fdcf72f12 Bug 858680, Prevent unused variable warning on opt builds, r=bustage.
--HG--
extra : rebase_source : abec6bc1896d17d07abe3a885861002c5762d6ef
2015-05-21 16:28:23 -07:00
Eric Rahm 3925a960aa Bug 1165515 - Part 1: Convert PR_LOG to MOZ_LOG. r=froydnj 2015-05-21 13:22:04 -07:00