Closed Bug 777084 Opened 8 years ago Closed 8 years ago

stop returning arrays from DeviceStorage.getDeviceStorage()

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file)

Attached patch patch v.1Splinter Review
Passing arrays back from:

 getDeviceStorage(DOMString type);

sounded like it was the right thing to do, but it isn't.  Instead we should have different 'types' for shared directories (like "sharedpictures") or something.

Currently we don't even support anything other than returning one DeviceStorage anyhow.

Lets restore DeviceStorage to what we had.
Assignee: nobody → doug.turner
Attachment #645511 - Flags: review?(jonas)
Attachment #645511 - Flags: review?(jonas) → review?(bent.mozilla)
Comment on attachment 645511 [details] [diff] [review]
patch v.1

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

::: dom/devicestorage/nsDeviceStorage.cpp
@@ +1412,4 @@
>  {
> +  nsRefPtr<nsDOMDeviceStorage> storage = new nsDOMDeviceStorage();
> +  if (NS_SUCCEEDED(storage->Init(aWin, aType))) {
> +    NS_ADDREF(*aStore = storage);

Nit: |storage.forget(aStore)| should work.

::: dom/interfaces/devicestorage/nsIDOMNavigatorDeviceStorage.idl
@@ +7,5 @@
>  
>  /**
>   * Property that extends the navigator object.
>   */
>  [scriptable, uuid(A4B2831D-6065-472F-8A6D-2C9085C74C15)]

Need to bump the IID
Attachment #645511 - Flags: review?(bent.mozilla) → review+
> Nit: |storage.forget(aStore)| should work.


Everywhere in this file we use the macros NS_ADDREF or NS_IF_ADDREF.  Maybe as a follow up we can convert these all over to something more modern?

> Need to bump the IID

Thanks!
https://hg.mozilla.org/mozilla-central/rev/cb017d051029
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.