Closed
      
        Bug 871287
      
      
        Opened 12 years ago
          Closed 12 years ago
      
        
    
  
Move DeviceStorage to WebIDL  
    Categories
(Core :: DOM: Device Interfaces, defect)
        Core
          
        
        
      
        
    
        DOM: Device Interfaces
          
        
        
      
        
    Tracking
()
        RESOLVED
        FIXED
        
    
  
        
            mozilla24
        
    
  
People
(Reporter: Ms2ger, Assigned: Ms2ger)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
| 19.61 KB,
          patch         | dhylands
:
              
              review+ | Details | Diff | Splinter Review | 
| 32.02 KB,
          patch         | smaug
:
              
              review+ | Details | Diff | Splinter Review | 
| 16.61 KB,
          patch         | dhylands
:
              
              review+ | Details | Diff | Splinter Review | 
      No description provided.
| Assignee | ||
| Comment 1•12 years ago
           | ||
        Attachment #748716 -
        Flags: review?(doug.turner)
| Updated•12 years ago
           | 
        Attachment #748716 -
        Flags: review?(doug.turner) → review?(bugs)
| Comment 2•12 years ago
           | ||
Comment on attachment 748716 [details] [diff] [review]
Patch v1
> class nsDOMDeviceStorage MOZ_FINAL
>   : public nsDOMEventTargetHelper
>   , public nsIDOMDeviceStorage
>   , public nsIObserver
> {
>+  typedef mozilla::ErrorResult ErrorResult;
>+  typedef mozilla::dom::DeviceStorageEnumerationParameters
>+    EnumerationParameters;
>+  typedef mozilla::dom::DOMCursor DOMCursor;
>+  typedef mozilla::dom::DOMRequest DOMRequest;
Not sure I like these typedefs, but ok.
>+  already_AddRefed<DOMRequest>
>+  FreeSpace(ErrorResult& aRv);
>+  already_AddRefed<DOMRequest>
>+  UsedSpace(ErrorResult& aRv);
>+  already_AddRefed<DOMRequest>
>+  Available(ErrorResult& aRv);
This is hard to read. Please add some newlines, or just put return value to the same line with method name, if there is enough space.
> NS_IMETHODIMP
> nsDOMDeviceStorage::Add(nsIDOMBlob *aBlob, nsIDOMDOMRequest * *_retval)
Could you rename _retval
> nsDOMDeviceStorage::AddNamed(nsIDOMBlob *aBlob,
>                              const nsAString & aPath,
>                              nsIDOMDOMRequest * *_retval)
ditto
> nsDOMDeviceStorage::FreeSpace(nsIDOMDOMRequest** aRetval)
> {
>+  ErrorResult rv;
>+  nsRefPtr<DOMRequest> request = FreeSpace(rv);
>+  request.forget(aRetval);
I think I'd write this and other similar cases like
*aRetVal = FreeSpace(rv).get();
But if you prefer using forget, that is ok.
>+++ b/dom/interfaces/devicestorage/nsIDOMDeviceStorage.idl
update uuid
but apparently new patch coming.
        Attachment #748716 -
        Flags: review?(bugs)
| Assignee | ||
| Comment 3•12 years ago
           | ||
        Attachment #753821 -
        Flags: review?(doug.turner)
| Assignee | ||
| Comment 4•12 years ago
           | ||
Second try
        Attachment #748716 -
        Attachment is obsolete: true
        Attachment #753826 -
        Flags: review?(bugs)
| Assignee | ||
| Comment 5•12 years ago
           | ||
Comment on attachment 753826 [details] [diff] [review]
Part c: Move DeviceStorage to Paris bindings (v2)
Still not right... Apparently
nsRefPtr<DOMRequest> request = new DOMRequest(win);
nsCOMPtr<nsIRunnable> r = new PostErrorEvent(request, POST_ERROR_EVENT_UNKNOWN);
will leave |request| null.
        Attachment #753826 -
        Flags: review?(bugs)
| Assignee | ||
| Updated•12 years ago
           | 
        Attachment #753826 -
        Attachment description: Part b: Move DeviceStorage to Paris bindings (v2) → Part c: Move DeviceStorage to Paris bindings (v2)
        Attachment #753826 -
        Flags: review?(bugs)
| Assignee | ||
| Comment 6•12 years ago
           | ||
        Attachment #754222 -
        Flags: review?(doug.turner)
| Updated•12 years ago
           | 
        Attachment #754222 -
        Flags: review?(doug.turner) → review?(dhylands)
| Updated•12 years ago
           | 
        Attachment #753821 -
        Flags: review?(doug.turner) → review?(dhylands)
| Comment 7•12 years ago
           | ||
Comment on attachment 753826 [details] [diff] [review]
Part c: Move DeviceStorage to Paris bindings (v2)
I hope we have some tests for enumerate*
        Attachment #753826 -
        Flags: review?(bugs) → review+
| Comment 8•12 years ago
           | ||
Comment on attachment 753821 [details] [diff] [review]
Part a: Random cleanup
Review of attachment 753821 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with prototype cleanup
::: dom/devicestorage/DeviceStorage.h
@@ +194,5 @@
>                         nsIDOMDOMRequest** aRetval,
>                         bool aEditable);
>  
> +  void
> +  GetInternal(nsPIDOMWindow* aWin, const nsAString& aPath, DOMRequest* aRequest,
nit: The other prototypes here have the return type on the same line as the function name. This should follow suit.
        Attachment #753821 -
        Flags: review?(dhylands) → review+
| Updated•12 years ago
           | 
        Attachment #754222 -
        Flags: review?(dhylands) → review+
| Assignee | ||
| Comment 9•12 years ago
           | ||
https://hg.mozilla.org/mozilla-central/rev/9f0b6d606468
https://hg.mozilla.org/mozilla-central/rev/468594dc72a1
https://hg.mozilla.org/mozilla-central/rev/49c962578899
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
          You need to log in
          before you can comment on or make changes to this bug.
        
Description
•