Commit Graph

180 Commits

Author SHA1 Message Date
Andrea Marchesini
669c401203 Bug 1359172 - RemoteInputStream must create a correct inputStream when used and sliced in a separate process, r=smaug 2017-04-25 14:07:31 +02:00
Andrea Marchesini
05ebbc4d1e Bug 1358109 - Use IPCBlob in PFilePicker, r=smaug 2017-04-25 14:07:30 +02:00
Sebastian Hengst
5467076f99 Backed out changeset dec83a85f824 (bug 1358109) for failing mochitest dom/indexedDB/test/test_blob_worker_xhr_read_slice.html. r=backout 2017-04-24 15:44:10 +02:00
Andrea Marchesini
91df0ae011 Bug 1358109 - Use IPCBlob in PFilePicker, r=smaug 2017-04-24 12:16:49 +02:00
Andrea Marchesini
05727f7b0b Bug 1353629 - PBlob refactoring - part 14 - tests, r=smaug 2017-04-24 12:09:41 +02:00
Andrea Marchesini
c350ba13b2 Bug 1353629 - PBlob refactoring - part 13 - IPCBlobInputStream should support remote nsIAsyncInputStream, r=smaug
If a child-to-parent IPCBlob is more than 1mb, we end up using a pipe stream.
If that ipcBlob is sent to a different process, we need to implement asyncWait
correctly: we need to call the remoteStream->AsyncWait().
2017-04-24 12:09:41 +02:00
Andrea Marchesini
c6b96caedb Bug 1353629 - PBlob refactoring - part 11 - Comments, r=smaug 2017-04-24 12:09:41 +02:00
Andrea Marchesini
671ea5169c Bug 1353629 - PBlob refactoring - part 9 - PBlob should use IPCStream in case it is dealing with an IPCBlobInputStream, r=smaug
This patch will go away when I'll finishing the removing of PBlob.  Currently,
when a PBlob is sent from child to parent, we use PMemoryStream in order to
recreate the inputStream on the parent side. PMemoryStream sends the data in
chunks.

But if PBlob is dealing with a IPCBlobInputStream, it doesn't have access to
the real data. In this case, we must send data using IPCStream. In this way,
Note that thisIPCBlobInputStream will send its ID, and the parent will take the
real inputStream from the IPCBlobInputStreamStorage.  Note that I check the
size to be 1mb instead 0. No particular reasons, but better to avoid the use of
PMemoryStream for nothing.
2017-04-24 12:09:40 +02:00
Andrea Marchesini
3d35b17f21 Bug 1353629 - PBlob refactoring - part 7 - IPCBlobInputStream must implement nsIAsyncInputStream, r=smaug
In order to retrieve data from an IPCBlobInputStream, it must be used as
nsIAsyncInputStream.
2017-04-24 12:09:40 +02:00
Andrea Marchesini
34568e6fa9 Bug 1353629 - PBlob refactoring - part 6 - IPCBlobInputStream serialization, r=smaug
IPCBlobInputStream must implement nsIIPCSerializableInputStream interface.
When this is done, the child sends the internal ID of the IPCBlobInputStream to
the parent.
2017-04-24 12:09:40 +02:00
Andrea Marchesini
26d2ebd48e Bug 1353629 - PBlob refactoring - part 5 - IPCBlobInputStreamStorage, r=smaug
An IPCBlobInputStream can be sent back to the parent process (not implemented
in this patch). When this is done, we basically send only the internal ID.
From this ID, we can retrieve the original inputStream because any
IPCBlobInputStreamParent actor has previously registered it into a singleton:
IPCBlobInputStreamStorage.

So, if we have a IPCBlobInputStreamParent, we have an inputStream, and this
inputStream is known by IPCBlobInputStreamStorage. This will be useful in the
next patches.
2017-04-24 12:09:40 +02:00
Andrea Marchesini
b87a2a73d2 Bug 1353629 - PBlob refactoring - part 4 - IPCBlobInputStream, r=smaug
IPCBlobInputStream is a new type of nsIInputStream that is used only in content
process when a Blob is sent from parent to child. This inputStream is for now,
just cloneable.

When the parent process sends a Blob to a content process, it has the Blob and
its inputStream. With its inputStream it creates a IPCBlobInputStreamParent
actor. This actor keeps the inputStream alive for following uses (not part of
this patch).

On the child side we will have, of course, a IPCBlobInputStreamChild actor.
This actor is able to create a IPCBlobInputStream when CreateStream() is
called.  This means that 1 IPCBlobInputStreamChild can manage multiple
IPCBlobInputStreams each time one of them is cloned. When the last one of this
stream is released, the child actor sends a __delete__ request to the parent
side; the parent will be deleted, and the original inputStream, on the parent
side, will be released as well.

IPCBlobInputStream is a special inputStream because each method, except for
Available() fails. Basically, this inputStream cannot be used on the content
process for nothing else than knowing the size of the original stream.

In the following patches, I'll introduce an async way to use it.
2017-04-24 12:09:40 +02:00
Andrea Marchesini
31db2acc5b Bug 1353629 - PBlob refactoring - part 0 - IPCBlob, r=smaug
This first patch introduces the basic idea of the refactoring. Instead of
having a PBlob protocol, here we have a simple IPC struct: IPCBlob.
When a Blob is sent to a different process, we move an IPCBlob struct with
type, size, some specific File properties, and an inputStream as IPCStream.
2017-04-24 12:09:40 +02:00
Andrea Marchesini
dab3e63b51 Bug 1356580 - Better check of PMemoryStream actor creation in Blob code, r=qdot 2017-04-18 22:16:04 +02:00
Andrea Marchesini
4741f0d8f4 Bug 1343172 - PBlob should not create a remoteInputStream if that already exists, r=smaug 2017-04-18 13:54:15 +02:00
Andrea Marchesini
2020234faf Bug 1340921 - Introduce PMemoryStream for having PBlob and Multi-e10s happy - part 4 - Delete of the PMemoryStream actor, r=mrbkap 2017-03-29 10:40:38 +02:00
Andrea Marchesini
541d61789f Bug 1340921 - Introduce PMemoryStream for having PBlob and Multi-e10s happy - part 3 - PMemoryStream and PBlob, r=mrbkap 2017-03-29 10:40:38 +02:00
Andrea Marchesini
4bb8d9c667 Bug 1340921 - Introduce PMemoryStream for having PBlob and Multi-e10s happy - part 2 - PMemoryStream actor, r=mrbkap 2017-03-29 10:40:38 +02:00
Andrea Marchesini
8dcd278c86 Bug 1347557 - Move 2 static methods about the IPC serialization of streams into an helper class, r=qdot 2017-03-21 07:47:25 +01:00
Andrea Marchesini
30bbbae2fc Bug 1274343 - Add parent-to-child pipe streaming to IPCStream - part 2 - PParentToChild, r=smuag 2017-03-14 12:29:43 +01:00
Andrea Marchesini
a8870babfb Bug 1274343 - Add parent-to-child pipe streaming to IPCStream - part 1 - renaming PSendStream to PChildToParentStream, r=smaug 2017-03-14 12:28:58 +01:00
Andrea Marchesini
b33bddd386 Bug 1331854 - Create the PBlob actor on current thread if doesn't exist yet, r=bkelly 2017-02-17 15:40:57 +01:00
Andrea Marchesini
c048b4585c Bug 1339871 - Splitting dom/file/File.{h,cpp}, r=smaug 2017-02-16 18:26:38 +01:00
Andrea Marchesini
243d776c7f Bug 1336091 - File.relativeWebkitPath should not start with '/', r=smaug 2017-02-06 11:07:54 +01:00
Boris Zbarsky
b6929f4521 Bug 1335368 part 13. Remove the use of IsCallerChrome in dom/file. r=baku 2017-02-01 15:43:37 -05:00
Andrea Marchesini
37766315d4 Bug 1321261 - create dom/file for File APIs, r=qdot 2016-12-01 15:12:42 +01:00
Sebastian Hengst
903cc3ec3c Backed out changeset d3ef6f3e9193 (bug 1321261) for build bustage (calling missing file BlobParent.h from dom/ipc/TabParent.cpp). r=backout on a CLOSED TREE 2016-12-01 12:27:28 +01:00
Andrea Marchesini
4982909415 Bug 1321261 - create dom/file for File APIs, r=qdot 2016-12-01 11:43:18 +01:00
Sebastian Hengst
abf5b533a9 Backed out changeset 806c3d121dd4 (bug 1321261) for timing out in test_fileapi.html, test_mozfiledataurl.html and test_nonascii_blob_url.html on Linux x64 asan and debug. r=backout 2016-12-01 11:05:56 +01:00
Andrea Marchesini
1837b28622 Bug 1321261 - create dom/file for File APIs, r=qdot 2016-12-01 09:21:54 +01:00