Commit Graph
47 Commits
Author SHA1 Message Date
Gabriele Svelto eb403b8785 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442
2019-12-06 09:24:56 +00:00
Dorel Luca 67889e1013 Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto dc6fa2e86c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442
2019-12-04 15:01:19 +00:00
Jan Varga bed05f6a2e Bug 1591394 - QM: Add more getters to DirectoryLock; r=ttung
Differential Revision: https://phabricator.services.mozilla.com/D50610
2019-10-26 08:50:43 +00:00
Tom Tung d25728e255 Bug 1576593 - P2 - Change the way for tunneling quota information to SQLite; r=janv
Differential Revision: https://phabricator.services.mozilla.com/D48183
2019-10-25 12:02:10 +00:00
Tom Tung 872282faaf Bug 1581067 - P5 - Only remove the temporary body files & body directories when it's in the initializing stage; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D47770
2019-10-02 10:38:55 +00:00
Tom Tung 05706dbcde Bug 1581067 - P2 - Extract similar to reuse the code; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D46780
2019-09-27 16:54:45 +00:00
Tom Tung 304bdccd96 Bug 1581067 - P1 - Remove the emptry body directory when removing files inside; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D46586
2019-09-27 16:54:22 +00:00
Jan Varga db7d391891 Bug 1581127 - Add IsShuttingDown checks to DOM Cache origin initialization; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D45846
2019-09-13 16:43:30 +00:00
Jan Varga c4ad5c1db0 Bug 1563023 - Part 3: Change client usage type to support the null value; r=asuth
This patch wraps the uint64_t type in a Maybe container, so the client usage can
represent a state when there are no files on disk for the given client. Zero
usage then represents a state when there are some files but they are empty or
the client tracks logical size (not physical size of files on disk) and the
logical size is zero. This can be useful especially for LocalStorage.

Differential Revision: https://phabricator.services.mozilla.com/D38181
2019-08-22 20:52:09 +00:00
Byron Campen [:bwc] 28635f171a Bug 1566445: Rename a couple of macros to avoid conflicts. r=ttung
Differential Revision: https://phabricator.services.mozilla.com/D38226
2019-07-20 15:56:31 +00:00
Jan Varga 69d511b1cc Bug 1541771 - LSNG: Don't cache usage in InitOrigin if it's not for temporary storage initialization; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D27490
2019-04-15 13:35:38 +02:00
Tom Tung 273c9254cf Bug 1436188 - Add telemetry probes to collect the number of failures during the QuotaManager initialization; r=asuth, data-review=chutten
This patch uses categorical keyed Historgram to collect data. While the key is
used to determine whether is it an external error or an internal error (Note:
the external error is referred to low level failure, for example: database
corrupt, OS API errors, ... etc; the internal error is referred to errors, like:
not handle file properly, unexpected filenames, ... etc), the labels for
categorical indicates where the error happens.
Furthermore, this patch make QuotaManager keep traversing the profile even if
an error happens so that we can get more information in the telemetry data.
Please note that these things should only happen in the Nightly Channel.

Differential Revision: https://phabricator.services.mozilla.com/D15908
2019-01-17 17:12:27 +00:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Tom Tung 1870598d40 Bug 1425146 - P1 - Ensure the schema for the cache.sqlite is up to date beforing accessing it; r=janv
Bug 1290481 introduces the padding mechanism, but there was a corner case which
weren't handled correctly. It created a chance to access cache database before
acutally checking the database version and schema upgrade. If the schema of
cache.sqlite is too old and the padding file disappear, it breaks origins
initialization. This patch ensure the schema is updated to the newest before
accessing it.
2018-09-07 10:28:30 +02:00
Kris Maglione 187318b0b7 Bug 1462937: Update callers to use nsIFile::GetDirectoryEntries as a nsIDirectoryEnumerator. r=froydnj
MozReview-Commit-ID: Iv4T1MVAF5
2018-05-19 20:17:45 -07:00
Jonathan Watt 4e2e2f0954 Bug 1417365 - Unified build issues in dom/cache. r=baku 2017-10-26 12:35:08 +01:00
Andrew Sutherland 7ec869d94a Bug 1404344 - Part 2: DOM Cache API schema 57-56 downgrade support. r=bkelly
Alter 57 and 58 DOM Cache API to use an on-disk schema version of 25 again,
as was used prior to the landing of bug 1290481 that bumped the disk schema
version to 26.  Patched versions will recognize this internally as schema 27
based on the presence of the column introduced by the 26 upgrade.
2017-10-03 10:02:49 -04:00
Tom Tung 299716652c Bug 1402581 - P3: Allow failures happen when restoring or wiping padding file. r=bkelly 2017-10-05 17:30:40 +08:00
Tom Tung 0fc7ca1663 Bug 1402581 - P2: Ensure the temporary file exists when failure happens. r=bkelly
There are three changes in this patch: 1. Make sure deleting padding file before
the temporary padding file. 2. Not deleting temporary file when failure happens.
3. Endure failure happens after the transaction commit.
2017-10-03 18:44:56 +08:00
Tom Tung 5393fe76be Bug 1290481 - P13: Get padding from DB when there is no directroy padding file. r=bkelly
MozReview-Commit-ID: KlVsaGhpABk
2017-07-18 19:08:41 +08:00
Tom Tung ca026d2342 Bug 1290481 - P12: Get the padding size while QM gets usage from DOM Cache. r=bkelly
MozReview-Commit-ID: KlVsaGhpABk
2017-07-18 19:07:53 +08:00
Tom Tung b0a5dcfe0f Bug 1290481 - P11: Add an assertion to ensure DOM Cache running in the Quota IO thread while getting overall usage. r=bkelly
MozReview-Commit-ID: KlVsaGhpABk
2017-07-18 19:03:25 +08:00
Tom Tung 15d5a42c6c Bug 1290481 - P10: Update padding size to the direcotry padding file. r=bkelly
MozReview-Commit-ID: KlVsaGhpABk
2017-07-18 19:00:09 +08:00
Tom Tung 104d11f718 Bug 1290481 - P8: Implement few utility functions to access direcotry padding file. r=bkelly
MozReview-Commit-ID: KlVsaGhpABk
2017-07-18 18:57:54 +08:00
Tom Tung d1d55ebfb1 Bug 1290481 - P7: Create a mutex lock on CacheQuotaClient for protected accessing directory padding file. r=bkelly 2017-07-20 11:33:39 +08:00
Tom Tung c6849638fc Bug 1290481 - P6: Upgrade QuotaManager to v3.0 for adding directory padding file to existing DOM Cache directory. r=bkelly, janv
MozReview-Commit-ID: KlVsaGhpABk
2017-07-18 18:54:20 +08:00
Jan Varga 11a69e579f Bug 1348660 - Part 3: Separate the canceled state out of UsageInfo; r=btseng 2017-03-22 12:13:54 +01:00
Ben Kelly 077c137d4a Bug 1328686 Add diagnostic assertions to dom/cache. r=asuth 2017-01-06 12:41:15 -08:00
Jan Varga c840a049f6 Bug 961049 - Part 6: Quota Manager on PBackground cache changes; r=bkelly 2015-11-22 10:44:16 +01:00
Nathan Froyd 4e6d8f6705 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
Birunthan Mohanathas a29151dc87 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
Jan Varga a1455f50a1 Bug 1130775 - Convert synchronized ops and storage registration into unified directory locks; r=bent 2015-06-30 14:59:27 +02:00
Ben Kelly 126cd3b0d4 Bug 1110446 P1 Create marker files when Cache API context is open. r=ehsan 2015-06-25 22:22:46 -07:00
Ben Turner c44efa62ca Bug 858680 - Part 2: Add idle notifications to QuotaClient, r=janv. 2015-04-30 13:46:51 -07:00
Wes Kocher 7dab015407 Backed out changeset 0aaa67fc61e8 (bug 858680) 2015-05-21 16:44:42 -07:00
Ben Turner 6ddd853e21 Bug 858680 - Part 2: Add idle notifications to QuotaClient, r=janv. 2015-04-30 13:46:51 -07:00
Ben Kelly 50866fae8b Bug 1165395 Test Cache API after QuotaManager reset. r=janv 2015-05-19 17:47:16 -07:00
Timur Valeev 0e612195ae Bug 1162365 - Cache API does not calculate usage in QuotaClient::InitOrigin(). r=bkelly 2015-05-12 13:11:36 +03:00
Ehsan Akhgari de64e4da77 Bug 1156033 - Add some missing error handling to the DOM Cache code; r=bkelly 2015-04-20 13:10:33 -04:00
Jan Varga 6c66811081 Bug 1125102 - Make QuotaManager and FileService to be independent of each other; r=bent 2015-04-14 10:57:41 +02:00
Ben Kelly 44a3980c9e Bug 1110487 P2 Implement the nsIOfflineStorage interface in Cache. r=janv,ehsan 2015-03-16 07:10:36 -07:00
Ehsan Akhgari ea41d8de48 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
Ryan VanderMeulen 40ab4fd559 Backed out changeset 734e81bff9f3 (bug 1110487) for intermittent e10s cache test crashes.
CLOSED TREE
2015-03-16 13:51:33 -04:00
Ben Kelly 95bc43c11a Bug 1110487 P2 Implement the nsIOfflineStorage interface in Cache. r=janv,ehsan 2015-03-16 07:10:36 -07:00
Daniel Holbert e0dc790346 Bug 1139603: Add MOZ_OVERRIDE annotations in CacheParent.h and QuotaClient.cpp to fix clang -Winconsistent-missing-override. r=ehsan 2015-03-04 13:58:55 -08:00
Ben Kelly 0c2e7a4f3c Bug 940273 - Part 4 - Initial implementation of Service Worker Cache. r=ehsan,baku,janv 2015-03-02 14:20:00 +01:00