Closed Bug 1337016 Opened 7 years ago Closed 7 years ago

XHR should create a Blob in the parent process when run from a file:// URL

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(1 file)

      No description provided.
Attached patch file_xhr.patchSplinter Review
Assignee: nobody → amarchesini
Attachment #8834012 - Flags: review?(bugs)
Comment on attachment 8834012 [details] [diff] [review]
file_xhr.patch

Some explanation about what the patch is doing would have been really nice.
Now I just had to read it through several times.


>+GetLocalFileFromChannel(nsIRequest *request, nsIFile** aFile)
Nit, nsIRequest* aRequest


>+DummyStreamReaderFunc(nsIInputStream* aInputStream,
>+                      void* aClosure,
>+                      const char* aFromRawSegment,
>+                      uint32_t aToOffset,
>+                      uint32_t aCount,
>+                      uint32_t *aWriteCount)

uint32_t* aWriteCount


>+      ErrorResult error;
>+      RefPtr<Promise> promise =
>+        FileCreatorHelper::CreateFile(global, file, bag, true, error);
>+      if (NS_WARN_IF(error.Failed())) {
>+        return error.StealNSResult();
>+      }
>+
>+      FileCreationHandler::Create(promise, this);
>+      waitingForBlobCreation = true;
>+      return NS_OK;
Why you set waitingForBlobCreation to true right before returning?



>+  // We stream data to mBlobStorage when response type is "moz-blob".
>   nsAutoPtr<BlobSet> mBlobSet;
The comment talks about mBlobStorage but the variable name is mBlobSet


I hope we have tests for this. Please ensure that. Tests which run in e10s mode too.
Attachment #8834012 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a75a77d1bb99
XHR should create a Blob in the parent process when run from a file:// URL, r=smaug
https://hg.mozilla.org/mozilla-central/rev/a75a77d1bb99
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Depends on: 1350694
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: