Closed
Bug 825836
Opened 12 years ago
Closed 12 years ago
Support Blob in JS components
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
People
(Reporter: ctai, Assigned: ctai)
References
Details
(Keywords: dev-doc-needed)
Attachments
(2 files, 2 obsolete files)
(deleted),
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Hook Blob constructor in JSComponentsLoader, then we can use blob in JS component like MmsService.js.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → ctai
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #697797 -
Flags: feedback?(vyang)
Comment on attachment 697797 [details] [diff] [review]
Support Blob in JS component
Review of attachment 697797 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the below fixed.
Thanks for writing this!
::: js/xpconnect/loader/mozJSComponentLoader.cpp
@@ +288,5 @@
> + nsresult rv;
> +
> + if (!argc) {
> + XPCThrower::Throw(NS_ERROR_UNEXPECTED, cx);
> + return false;
I don't think you need to add this. The call to Initialize will ensure that we throw appropriately if no arguments are passed.
::: js/xpconnect/tests/unit/component-blob.js
@@ +30,5 @@
> + var f2 = new Blob([testContent], {"type" : "text/xml"});
> +
> + // do some tests
> + do_check_true(f1 instanceof Ci.nsIDOMBlob, "Should be a DOM Blob");
> + do_check_true(f2 instanceof Ci.nsIDOMBlob, "Should be a DOM Blob");
Please also add
do_check_true(!(f1 instanceof Ci.nsIDOMFile), "Should not be a DOM File");
do_check_true(!(f2 instanceof Ci.nsIDOMFile), "Should not be a DOM File");
Attachment #697797 -
Flags: review+
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #697797 -
Attachment is obsolete: true
Attachment #697797 -
Flags: feedback?(vyang)
Assignee | ||
Comment 4•12 years ago
|
||
I try to remove below codes, but it will cause do_check_true(threw, "No ctor arguments should throw"); fail.
So I don't remove below codes(!argc check).
::: js/xpconnect/loader/mozJSComponentLoader.cpp
@@ +288,5 @@
> + nsresult rv;
> +
> + if (!argc) {
> + XPCThrower::Throw(NS_ERROR_UNEXPECTED, cx);
> + return false;
Status: NEW → ASSIGNED
Ah, indeed, per spec |new Blob()| is totally valid. It should *not* throw.
So change the test to check that |new Blob()| doesn't throw and that it returns a blob with .length set to 0.
See spec here: http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob
Assignee | ||
Comment 6•12 years ago
|
||
Thanks for reviewing.
You are right. I change the test.
And make sure the type is empty string.
do_check_true(f3.type == "", "Wrong type");
Attachment #697815 -
Attachment is obsolete: true
Attachment #697822 -
Flags: review+
Assignee | ||
Comment 7•12 years ago
|
||
Try server...
https://tbpl.mozilla.org/?tree=Try&rev=348f4eba48a1
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 8•12 years ago
|
||
Keywords: checkin-needed
Updated•12 years ago
|
Component: DOM: Device Interfaces → XPCOM
Keywords: dev-doc-needed
OS: Gonk (Firefox OS) → All
Hardware: ARM → All
Comment 9•12 years ago
|
||
Would you mind filing a followup to remove this and replace with an initialization of the WebIDL Blob constructor in components once Blob is converted to WebIDL?
Assignee | ||
Comment 10•12 years ago
|
||
I file a bug 827723 for WebIDL Blob constructor in JS components.
Comment 11•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Updated•12 years ago
|
blocking-b2g: leo? → leo+
Assignee | ||
Comment 13•12 years ago
|
||
Comment 14•12 years ago
|
||
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → fixed
Comment 15•12 years ago
|
||
The entire set of clian's pushes was backed out for multiple reasons.
https://tbpl.mozilla.org/?tree=Mozilla-B2g18&rev=a0b06192f882
1.) The tree rules are clear that you are not to land on top of bustage. At the time you pushed, both B2G Mn and B2G xpcshell had bustage from prior commits that hadn't been backed out yet.
2.) The tree rules are also clear that you are to watch your pushes for any bustage and handle them accordingly. mozilla-inbound is the ONLY tree where this rule does not apply.
3.) Even after the earlier bustage was backed out, something in one of your many pushes was causing further B2G Mn failures as shown in the log below.
https://tbpl.mozilla.org/php/getParsedLog.php?id=20424173&tree=Mozilla-B2g18
4.) This isn't cause for backout by itself, but it is also strongly preferred to not push each commit individually as our build and testing resources are limited and doing so stretches them even thinner. Please limit your number of pushes as much as possible unless you have good reason for keeping them separate.
status-firefox20:
--- → wontfix
Comment 16•12 years ago
|
||
Updated•11 years ago
|
Flags: in-moztrap-
You need to log in
before you can comment on or make changes to this bug.
Description
•