nsIDOMDeviceStorage needs to expose real paths to gecko

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mikeh, Assigned: dougt)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

6 years ago
Mike, do you have any suggestions on the api?  For example, if I add a read-only attribute nsIFile, will that be okay?  Are you only using this from C++?
(In reply to Doug Turner (:dougt) from comment #1)
> Mike, do you have any suggestions on the api?  For example, if I add a
> read-only attribute nsIFile, will that be okay?  Are you only using this
> from C++?

Doug: yep, only from C++.  A read-only attribute would do the trick--something I can get into an ns*String to which I can .Append(videoFilename).
(Assignee)

Comment 3

6 years ago
Just to be completely clear -- 

suppose videos are stored at:

/Users/dougt/Movies

You wouldn't mind having that entire path, right?
(In reply to Doug Turner (:dougt) from comment #3)
> Just to be completely clear -- 
> 
> suppose videos are stored at:
> 
> /Users/dougt/Movies
> 
> You wouldn't mind having that entire path, right?

Correct.  Not sure how you feel about a trailing '/', but that would make my life easier too.
It would be nice if we could hand you ("video", "foo.mp4"), and then get back "/Users/dougt/Movies/foo.mp4".
(Assignee)

Comment 6

6 years ago
Created attachment 666014 [details] [diff] [review]
patch v.1

mikeh, can you give this a try?
Attachment #666014 - Flags: review?(jonas)
Comment on attachment 666014 [details] [diff] [review]
patch v.1

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

::: dom/devicestorage/DeviceStorageRequestChild.cpp
@@ +55,5 @@
>        BlobChild* actor = static_cast<BlobChild*>(r.blobChild());
>        nsCOMPtr<nsIDOMBlob> blob = actor->GetBlob();
>  
> +      nsCOMPtr<nsIDOMFile> file = do_QueryInterface(blob);
> +      jsval result = InterfaceToJsval(mRequest->GetOwner(), file, &NS_GET_IID(nsIDOMFile));

Why do you need this? Interface flattening should ensure that it doesn't matter if you wrap an nsIDOMBlob or an nsIDOMFile
Attachment #666014 - Flags: review?(jonas) → review+
(Assignee)

Comment 8

6 years ago
Comment on attachment 666014 [details] [diff] [review]
patch v.1

nope... i don't want those changes -- part of something else.
(Assignee)

Comment 9

6 years ago
bad form.


This patch landed with bug 776062 without any of the fix ups that Jonas suggested.
(Assignee)

Comment 10

6 years ago
http://hg.mozilla.org/mozilla-central/rev/68c4c30ff6f0
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.