Commit Graph

54 Commits

Author SHA1 Message Date
Birunthan Mohanathas
94998cf5fe Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Nathan Froyd
e4e2da55c9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
M Hamdy
72753aa511 Bug 606655 - delete cookies UI option AskMeEveryTime and its related comments and tests. r=mak 2015-10-08 09:13:00 +02:00
Andrew McCreight
0c62d00526 Bug 1210517 - Create nsVariant directly rather than via do_CreateInstance(). r=froydnj
The goal here is to leave creation stuff mostly for JS, so we can
convert it entirely over to a non-threadsafe cycle-collected version
without breaking any existing C++ users.

I didn't do this for a remaining use in nsGlobalWindow.h to avoid
including nsVariant.h all over the place.
2015-10-07 08:17:42 -07:00
Ehsan Akhgari
ead1b198aa Bug 1208897 - Fix an initialization order bug in DOMStorageDBThread; r=baku
This is found by Viva64.  The error is in fact benign since the
StatementCache constructor takes a reference to the nsCOMPtr
passed to it, and stores it for later use, so nothing bad
happens at runtime, but still we should not be using uninitialized
members to initialize other members with.
2015-09-28 09:08:44 -04:00
Chris Peterson
dd2fcb9b7d Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Nicholas Nethercote
69d088e45f 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
e58db18abe Bug 536509 - Update localStorage to use common StorageAllowedForWindow logic, r=ehsan 2015-08-28 10:10:28 -04:00
Aidin Gharibnavaz
a54e107520 Bug 929846 - Considering key size when calculating quota usage. r=jdm 2015-08-17 15:19:30 -07:00
Kyle Huey
0a62d4d460 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
Honza Bambas
3eb6a6c821 Bug 1192194 - Make DOMStorageDBThead::mDBReady atomic. r=smaug 2015-08-07 05:00:00 -04:00
Honza Bambas
8e16fcbc62 Bug 1189426 - Don't assert false in DOMStorageDBThread::InsertDBOp when we failed to open the database. r=smaug 2015-08-06 11:08:00 -04:00
Nicholas Nethercote
e53f112538 Bug 1182977 (part 2) - Use PLDHashTable::Iterator in dom/storage/. r=khuey. 2015-07-22 00:02:15 -07:00
Nicholas Nethercote
b7d512592e Bug 1182977 - Use PLDHashTable::Iterator in dom/storage/. r=khuey. 2015-07-21 23:54:12 -07:00
Michael Layzell
ec0195ef0d Bug 1184971 - Expose cookieBehavior and cookieLifetimePolicy preference variants from nsICookieService. r=ehsan 2015-07-17 08:01:00 +02:00
Carsten "Tomcat" Book
730486ac29 Backed out changeset 2f4b5acae553 (bug 1184971) for causing OS X Memory Leaks 2015-07-21 10:27:44 +02:00
Michael Layzell
998d1f8e15 Bug 1184971 - Expose cookieBehavior and cookieLifetimePolicy preference variants from nsICookieService. r=ehsan 2015-07-17 08:01:00 +02:00
Michael Layzell
3b6bd60b8d Bug 1173523 - Part 1: Expose an nsIPrincipal from nsIPermission rather than a host string, appId, and isInBrowserElement, r=ehsan 2015-07-16 14:49:22 -04:00
Wes Kocher
24d022d24f Backed out 24 changesets (bug 1173523, bug 1172080, bug 817007, bug 1165263) for android reftest bustage CLOSED TREE
Backed out changeset 84fe04b2e7d1 (bug 1172080)
Backed out changeset 0ff004760a1f (bug 1172080)
Backed out changeset af147585ad55 (bug 1165263)
Backed out changeset c3af8ebb6db0 (bug 1165263)
Backed out changeset cd3f33a888fe (bug 1165263)
Backed out changeset e5db39044a1e (bug 1165263)
Backed out changeset c01c9ed77061 (bug 1165263)
Backed out changeset fb723aaa4267 (bug 1165263)
Backed out changeset f754e52e74dc (bug 1165263)
Backed out changeset c6bda3a0afd6 (bug 817007)
Backed out changeset bfa100253349 (bug 817007)
Backed out changeset b787b3f9aadc (bug 1173523)
Backed out changeset 4a0676b73f77 (bug 1173523)
Backed out changeset 82034a4560c5 (bug 1173523)
Backed out changeset 4bdb91114c7a (bug 1173523)
Backed out changeset 72406261eccc (bug 1173523)
Backed out changeset 541b6faf7196 (bug 1173523)
Backed out changeset 1caac4569616 (bug 1173523)
Backed out changeset 0d4f9f9e1b4e (bug 1173523)
Backed out changeset 2d5661eb966c (bug 1173523)
Backed out changeset 89833c0bb0cd (bug 1173523)
Backed out changeset ea64d70eacfe (bug 1173523)
Backed out changeset a8e4f1c0c445 (bug 1173523)
Backed out changeset cf498d466b85 (bug 1173523)
2015-07-14 14:00:32 -07:00
Michael Layzell
f67c6a0009 Bug 1173523 - Part 1: Expose an nsIPrincipal from nsIPermission rather than a host string, appId, and isInBrowserElement, r=ehsan 2015-07-14 15:06:15 -04:00
Birunthan Mohanathas
47ed3a3675 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
Michael Layzell
355a5ad0bf Bug 1180993 - Part 3: Correct use sites of functions which return already_AddRefed. r=ehsan 2015-07-10 08:36:00 -04:00
Emanuel Hoogeveen
e1b03075a7 Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Juan Gomez
01df2f691b Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Ryan VanderMeulen
e6131fc8b8 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Juan Gomez
2128198065 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-06-24 14:11:00 -04:00
Blake Kaplan
c32149f142 Bug 1173573 - Fix possible crash initializing sessionstorage. r=honzab 2015-06-23 11:22:00 +02:00
Blake Kaplan
94ea21554a Bug 1151840 - Make a couple of messages urgent to deal with CPOWs properly. r=billm 2015-06-11 18:53:31 -07:00
Ms2ger
4e05909144 Bug 1017758 - Use infallible getters for appId/isInBrowserElement/unknownAppId; r=bz 2015-05-13 17:59:08 +02:00
Andrew McCreight
c979f253c0 Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrew McCreight
5a5637e076 Bug 1152551, part 1 - Remove leading tabs in dom/. r=baku
Also, remove trailing whitespace in nsXMLContentSink.cpp
2015-05-03 15:32:33 -04:00
David Major
ed6ca74f4f Bug 1157835: Remove the MSVC_ENABLE_PGO flag from the build system. r=glandium 2015-04-27 19:59:27 -04:00
Boris Zbarsky
f751c0a094 Bug 1157898 part 5. Eliminate the remaining non-ErrorResult consumers of ErrorResult::ErrorCode and make it protected. r=peterv 2015-04-27 09:18:52 -04:00
Boris Zbarsky
485eb48959 Bug 1157898 part 4. Add ErrorResult::ErrorCodeIs() and use it in various places to get rid of ErrorCode(). r=peterv 2015-04-27 09:18:52 -04:00
Andrea Marchesini
94545cbb2e Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Ehsan Akhgari
5cccea6f0f Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Boris Zbarsky
988b8e01be Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Nicholas Nethercote
ee41df7dc2 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo. 2015-02-09 14:34:50 -08:00
Andrew McCreight
1ee96e7527 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote
0a02b5d31c Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo. 2015-02-04 20:05:36 -08:00
Mike Hommey
50e6916b40 Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn 2015-02-02 09:56:13 +09:00
Marco Bonardo
47099c6793 Bug 1010717 - add nsIRunnable support to the DOM Storage thread. r=mayhemer 2015-01-28 00:00:18 +01:00
Kyle Huey
2a6f8887b5 Bug 1121673: Use move references in IPDL. r=bent 2015-01-16 11:58:52 -08:00
Ehsan Akhgari
e6a340d9e2 Bug 1118609 - Mark virtual overridden functions as MOZ_OVERRIDE in dom/storage; r=baku 2015-01-07 10:22:00 -05:00
Peter Van der Beken
4b7e268d87 Bug 1078744 - Replace SetIsDOMBinding with SetIsNonDOMBinding, remove nsWrapperCache::SetIsDOMBinding. r=bz.
--HG--
extra : rebase_source : 89c476cd9436530b2df5acc903909e34188417a0
2014-10-07 11:44:49 +02:00
Patrick Wang (Chih-Kai Wang)
8b7c4920ce Bug 1032125: Part 2: Prevent DOM Storage from sending IPC after Nuwa ready. r=khuey 2014-09-30 22:13:25 +08:00
Carsten "Tomcat" Book
172a489aaa Backed out changeset e193cf8cb616 (bug 1032125) for causing regressions 2014-09-22 12:45:22 +02:00
Patrick Wang (Chih-Kai Wang)
6fec404e23 Bug 1032125: Part 2: Prevent DOM Storage from sending IPC after Nuwa ready. r=khuey 2014-09-19 17:12:10 +08:00
Carsten "Tomcat" Book
cfea934932 Backed out changeset f945fb33b616 (bug 1032125) 2014-09-18 15:13:53 +02:00
Patrick Wang (Chih-Kai Wang)
9fa0ad74c2 Bug 1032125: Part 2: Prevent DOM Storage from sending IPC after Nuwa ready. r=khuey 2014-09-18 10:29:45 +08:00