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

16 Коммитов

Автор SHA1 Сообщение Дата
Andrea Marchesini 2616cac8b3 Bug 1030481 - Remove nsIMutable, r=smaug
nsIMutable is used only by DOM Blob/File. But Blobs are immutable by spec.
FileBlobImpl has a couple of lazy member values, but those are called when
the object is cloned in order to be sent to a different thread/process.

Differential Revision: https://phabricator.services.mozilla.com/D58946

--HG--
extra : moz-landing-system : lando
2020-01-07 15:02:00 +00:00
Brindusan Cristian ed883ce3f4 Backed out changeset 61101e3eebb3 (bug 1030481) for mochitest failures at test_file.xhtml. CLOSED TREE 2020-01-07 16:30:53 +02:00
Andrea Marchesini 4059db5bc7 Bug 1030481 - Remove nsIMutable, r=smaug
nsIMutable is used only by DOM Blob/File. But Blobs are immutable by spec.
FileBlobImpl has a couple of lazy member values, but those are called when
the object is cloned in order to be sent to a different thread/process.

Differential Revision: https://phabricator.services.mozilla.com/D58716

--HG--
extra : moz-landing-system : lando
2020-01-07 12:37:12 +00:00
Gabriele Svelto ace6d1063f 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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 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

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Andrea Marchesini 5b2f5ad02d Bug 1513596 - Introduce a Blob.blobImplType attribute, chrome-only, for testing, r=smaug 2018-12-15 21:40:05 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andrea Marchesini 4ebf5b4364 Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj
In the current code there are 3 main issues:

1. nsFileStream is not really thread-safe. There is nothing to protect the
internal members and we see crashes.

2. nsPipeInputStream doesn't implement ::Seek() method and that caused issues
in devtools when a nsHttpChannel sends POST data using a pipe. In order to fix
this, bug 1494176 added a check in nsHttpChannel: if the stream doesn't
implement ::Seek(), let's clone it. This was an hack around nsPipeInputStream,
and it's bad.

3. When nsHttpChannel sends POST data using a file stream, nsFileStream does
I/O on main-thread because of the issue 2. Plus, ::Seek() is called on the
main-thread causing issue 1.

Note that nsPipeInputStream implements only ::Tell(), of the nsISeekableStream
methods. It doesn't implement ::Seek() and it doesn't implement ::SetEOF().

With this patch I want to fix point 2 and point 3 (and consequentially issue 1
- but we need a separate fix for it - follow up). The patch does:

1. it splits nsISeekableStream in 2 interfaces: nsITellableStream and
nsISeekableStream.
2. nsPipeInputStream implements only nsITellableStream.  Doing this, we don't
need the ::Seek() check for point 2 in nsHttpChannel: a simple QI check is
enough.
3. Because we don't call ::Seek() in nsHttpChannel, nsFileStream doesn't do I/O
on the main-thread, and we don't crash doing so.
2018-10-18 13:35:35 +02:00
Andrea Marchesini 9a9a71e436 Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
Boris Zbarsky 9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00
Andrea Marchesini 9067ec472c Bug 1404845 - Renaming BlobImpl::GetInternalStream to BlobImpl::CreateInputStream, r=smaug 2017-10-02 13:53:12 +02:00
Jon Coppeard a4fe4cbe3c Bug 1301863 - Tell the JS engine how much memory blob reflectors hold alive r=baku 2017-09-12 10:46:51 +01:00
Andrea Marchesini 1feb18fd09 Bug 1340921 - Introduce PMemoryStream for having PBlob and Multi-e10s happy - part 5 - Make MemoryBlobImpl::DataOwner cloneable, r=mrbkap 2017-03-29 10:40:39 +02:00
Andrea Marchesini f8737e7e7f Bug 1340921 - Introduce PMemoryStream for having PBlob and Multi-e10s happy - part 1 - Expose DataOwnerAdapter, r=mrbkap 2017-03-29 10:40:38 +02:00
Andrea Marchesini 3043646e52 Bug 1339871 - Splitting dom/file/File.{h,cpp}, r=smaug
--HG--
rename : dom/file/File.cpp => dom/file/BaseBlobImpl.cpp
rename : dom/file/File.h => dom/file/BaseBlobImpl.h
rename : dom/file/File.cpp => dom/file/Blob.cpp
rename : dom/file/File.h => dom/file/Blob.h
rename : dom/file/File.cpp => dom/file/BlobImpl.cpp
rename : dom/file/File.h => dom/file/BlobImpl.h
rename : dom/file/File.cpp => dom/file/EmptyBlobImpl.cpp
rename : dom/file/File.h => dom/file/EmptyBlobImpl.h
rename : dom/file/File.cpp => dom/file/FileBlobImpl.cpp
rename : dom/file/File.h => dom/file/FileBlobImpl.h
rename : dom/file/File.cpp => dom/file/MemoryBlobImpl.cpp
rename : dom/file/File.h => dom/file/MemoryBlobImpl.h
rename : dom/file/File.cpp => dom/file/StreamBlobImpl.cpp
rename : dom/file/File.h => dom/file/StreamBlobImpl.h
rename : dom/file/File.h => dom/file/StringBlobImpl.h
rename : dom/file/File.h => dom/file/TemporaryBlobImpl.h
2017-02-16 18:26:38 +01:00