Last Comment Bug 780691 - DeviceStorage - Add onchange notifications for volume state changes
: DeviceStorage - Add onchange notifications for volume state changes
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: All Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Doug Turner (:dougt)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on: 780693
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-06 12:47 PDT by Doug Turner (:dougt)
Modified: 2012-08-10 01:58 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments
patch v.1 (9.90 KB, patch)
2012-08-06 12:59 PDT, Doug Turner (:dougt)
jonas: review+
Details | Diff | Splinter Review
-w patch - same as v.1 (8.39 KB, patch)
2012-08-06 13:00 PDT, Doug Turner (:dougt)
no flags Details | Diff | Splinter Review

Description Doug Turner (:dougt) 2012-08-06 12:47:05 PDT

    
Comment 1 Doug Turner (:dougt) 2012-08-06 12:59:58 PDT
Created attachment 649365 [details] [diff] [review]
patch v.1
Comment 2 Doug Turner (:dougt) 2012-08-06 13:00:24 PDT
Created attachment 649366 [details] [diff] [review]
-w patch - same as v.1
Comment 3 Jonas Sicking (:sicking) No longer reading bugmail consistently 2012-08-06 16:44:35 PDT
Comment on attachment 649365 [details] [diff] [review]
patch v.1

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

::: dom/devicestorage/nsDeviceStorage.cpp
@@ +1563,5 @@
> +  nsCOMPtr<nsIDOMEvent> event;
> +  NS_NewDOMDeviceStorageChangeEvent(getter_AddRefs(event), nullptr, nullptr);
> +
> +  nsCOMPtr<nsIDOMDeviceStorageChangeEvent> ce = do_QueryInterface(event);
> +  nsresult rv = ce->InitDeviceStorageChangeEvent(NS_LITERAL_STRING("change"),

I actually tend to prefer to fire different events for enabled/disabled-like things, so here separate events for "mounted" and "unmounted". But I think this is fine for now.

@@ +1608,5 @@
> +    NS_NewLocalFile(filepath, false, getter_AddRefs(f));
> + 
> +    nsCString creason;
> +    creason.AssignWithConversion(reason);
> +    CopyUTF16toUTF8(reason, creason);

You're assigning twice. Remove the .AssignWithConversion line.
Comment 5 Ed Morley [:emorley] 2012-08-10 01:58:32 PDT
https://hg.mozilla.org/mozilla-central/rev/cc583bf8519c

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