Closed Bug 795201 Opened 12 years ago Closed 12 years ago

nsIDOMDeviceStorage needs to expose real paths to gecko

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mikeh, Assigned: dougt)

Details

Attachments

(1 file)

      No description provided.
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).
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".
Attached patch patch v.1Splinter Review
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+
Comment on attachment 666014 [details] [diff] [review]
patch v.1

nope... i don't want those changes -- part of something else.
bad form.


This patch landed with bug 776062 without any of the fix ups that Jonas suggested.
http://hg.mozilla.org/mozilla-central/rev/68c4c30ff6f0
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: