Last Comment Bug 777084 - stop returning arrays from DeviceStorage.getDeviceStorage()
: stop returning arrays from DeviceStorage.getDeviceStorage()
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: x86 Mac OS X
-- normal (vote)
: mozilla17
Assigned To: Doug Turner (:dougt)
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2012-07-24 14:40 PDT by Doug Turner (:dougt)
Modified: 2012-08-02 06:20 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch v.1 (22.65 KB, patch)
2012-07-24 14:40 PDT, Doug Turner (:dougt)
bent.mozilla: review+
Details | Diff | Splinter Review

Description User image Doug Turner (:dougt) 2012-07-24 14:40:09 PDT
Created attachment 645511 [details] [diff] [review]
patch v.1

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.
Comment 1 User image Ben Turner (not reading bugmail, use the needinfo flag!) 2012-08-01 17:43:06 PDT
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
Comment 2 User image Doug Turner (:dougt) 2012-08-01 21:11:10 PDT
> 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

Comment 4 User image Ed Morley [:emorley] 2012-08-02 06:20:44 PDT

Note You need to log in before you can comment on or make changes to this bug.