Add Blob/File support to xpcshell

RESOLVED FIXED in mozilla24

Status

()

Core
XPConnect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: janv, Assigned: janv)

Tracking

unspecified
mozilla24
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

16.21 KB, patch
Ben Turner (not reading bugmail, use the needinfo flag!)
: review+
Details | Diff | Splinter Review
Comment hidden (empty)
(Assignee)

Updated

5 years ago
Blocks: 785884
(Assignee)

Updated

5 years ago
Blocks: 883614
(Assignee)

Comment 1

5 years ago
Created attachment 764899 [details] [diff] [review]
patch v0.1

The existing test for File objects in JS components is buggy. See |=| vs |==|
Assignee: nobody → Jan.Varga
Status: NEW → ASSIGNED
Attachment #764899 - Flags: review?(bent.mozilla)
Comment on attachment 764899 [details] [diff] [review]
patch v0.1

Review of attachment 764899 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with this:

::: content/base/src/nsDOMBlobBuilder.h
@@ +15,5 @@
> +#define NS_DOMMULTIPARTBLOB_CID \
> +{ 0x47bf0b43, 0xf37e, 0x49ef, \
> +  { 0x81, 0xa0, 0x18, 0xba, 0xc0, 0x57, 0xb5, 0xcc } }
> +#define NS_DOMMULTIPARTBLOB_CONTRACTID \
> +"@mozilla.org/dom/multipart-blob;1"

Nit: two space indent here and below for continued lines

::: js/xpconnect/shell/xpcshell.cpp
@@ +828,5 @@
> +
> +  nsCOMPtr<nsISupports> native =
> +    do_CreateInstance("@mozilla.org/dom/multipart-blob;1");
> +  if (!native) {
> +    return false;

Wherever you return false here and below you should first JS_ReportError something useful, otherwise script won't see the exception.

::: layout/build/nsLayoutModule.cpp
@@ +949,5 @@
>    return commandTable->QueryInterface(aIID, aResult);
>  }
>  
> +static nsresult
> +nsDOMMultipartBlobConstructor(nsISupports* aOuter, REFNSIID aIID,

Let's change these to use the MAKE_CTOR macro instead.
Attachment #764899 - Flags: review?(bent.mozilla) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/a17433f3f2fc
https://hg.mozilla.org/mozilla-central/rev/a17433f3f2fc
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.