Closed Bug 1186750 Opened 9 years ago Closed 9 years ago

Clean up smart pointer usage of device storage events

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox42 --- affected
firefox45 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

References

(Blocks 1 open bug)

Details

Attachments

(7 files, 8 obsolete files)

40 bytes, text/x-review-board-request
dhylands
: review+
Details
40 bytes, text/x-review-board-request
dhylands
: review+
Details
40 bytes, text/x-review-board-request
dhylands
: review+
Details
40 bytes, text/x-review-board-request
dhylands
: review+
Details
40 bytes, text/x-review-board-request
dhylands
: review+
Details
40 bytes, text/x-review-board-request
dhylands
: review+
Details
40 bytes, text/x-review-board-request
dhylands
: review+
Details
When working on bug 1184729, I noticed that the device storage part has some smart pointer usages on event dispatch which need non-trivial fix, which I'm going to fix first.
Bug 1186750 part 1 - Inlinize trivial constructors and destructors of events in DeviceStorageRequestParent.
Attachment #8637840 - Flags: review?(dhylands)
Bug 1186750 part 2 - Remove some unused member fields in events in DeviceStorageRequestParent.
Attachment #8637841 - Flags: review?(dhylands)
Bug 1186750 part 3 - Abstract CancelableFileEvent in DeviceStorageReqeustParent and use already_AddRefed&& for passing DeviceStorageFile parameter.
Attachment #8637842 - Flags: review?(dhylands)
Bug 1186750 part 4 - Clear runnable list in DeviceStorageRequestParent when being destroyed.
Attachment #8637843 - Flags: review?(dhylands)
Bug 1186750 part 5 - Convert DeviceStorageUsedSpaceCache::Dispatch to use already_AddRef&&.
Attachment #8637844 - Flags: review?(dhylands)
Bug 1186750 part 6 - Use already_AddRefed&& to initialize most smart pointer fields of device storage events.
Attachment #8637845 - Flags: review?(dhylands)
Bug 1186750 part 7 - Simplify code in DeviceStorageRequestParent::Dispatch.
Attachment #8637846 - Flags: review?(dhylands)
Bug 1186750 part 8 - Convert all usage of Dispatch/NS_DispatchTo{Main,Current}Thread in dom/devicestorage to pass in either already_AddRefed or raw pointer.
Attachment #8637847 - Flags: review?(dhylands)
Attachment #8637840 - Flags: review?(dhylands) → review+
Comment on attachment 8637840 [details]
MozReview Request: Bug 1186750 part 1 - Inlinize trivial constructors and destructors of events in DeviceStorageRequestParent.

https://reviewboard.mozilla.org/r/13981/#review12567

Ship It!
Comment on attachment 8637841 [details]
MozReview Request: Bug 1186750 part 2 - Remove some unused member fields in events in DeviceStorageRequestParent.

https://reviewboard.mozilla.org/r/13983/#review12571

Ship It!
Attachment #8637841 - Flags: review?(dhylands) → review+
Attachment #8637842 - Flags: review?(dhylands) → review+
Comment on attachment 8637842 [details]
MozReview Request: Bug 1186750 part 3 - Abstract CancelableFileEvent in DeviceStorageReqeustParent and use already_AddRefed&& for passing DeviceStorageFile parameter.

https://reviewboard.mozilla.org/r/13985/#review12577

Ship It!
Comment on attachment 8637843 [details]
MozReview Request: Bug 1186750 part 4 - Clear runnable list in DeviceStorageRequestParent when being destroyed.

https://reviewboard.mozilla.org/r/13987/#review12579

Learning lots of C++11 features here :)
Attachment #8637843 - Flags: review?(dhylands) → review+
Comment on attachment 8637844 [details]
MozReview Request: Bug 1186750 part 5 - Convert DeviceStorageUsedSpaceCache::Dispatch to use already_AddRef&&.

https://reviewboard.mozilla.org/r/13989/#review12581

Ship It!
Attachment #8637844 - Flags: review?(dhylands) → review+
Comment on attachment 8637845 [details]
MozReview Request: Bug 1186750 part 6 - Use already_AddRefed&& to initialize most smart pointer fields of device storage events.

https://reviewboard.mozilla.org/r/13991/#review12583

Ship It!
Attachment #8637845 - Flags: review?(dhylands) → review+
Comment on attachment 8637846 [details]
MozReview Request: Bug 1186750 part 7 - Simplify code in DeviceStorageRequestParent::Dispatch.

https://reviewboard.mozilla.org/r/13993/#review12585

Ship It!
Attachment #8637846 - Flags: review?(dhylands) → review+
Attachment #8637847 - Flags: review?(dhylands) → review+
Comment on attachment 8637847 [details]
MozReview Request: Bug 1186750 part 8 - Convert all usage of Dispatch/NS_DispatchTo{Main,Current}Thread in dom/devicestorage to pass in either already_AddRefed or raw pointer.

https://reviewboard.mozilla.org/r/13995/#review12587

Ship It!
P.S. - thanks for splitting the patches up the way you. This made it super easy to review.
Sorry for the delay. It took a long time to land bug 1186745, and then I was stuck in some other things. It seems there was some significant change during this period, and patch 5~8 are no longer able to be applied cleanly. (And it also seems all NS_DispatchToCurrentThread uses were removed.)

I'm going to land patch 1~4 soon (which are mostly trivial changes) and request review for the rest of patches.

Sorry again for wasting your time reviewing patches which were not landed.
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0a9cf2fb44acff1bdeb8852997de649546c0a1f
Bug 1186750 part 1 - Inlinize trivial constructors and destructors of events in DeviceStorageRequestParent. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/ef5f9a2a41a47d4f61ee7c8c5fcce6ea5784ed39
Bug 1186750 part 2 - Remove some unused member fields in events in DeviceStorageRequestParent. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/5add786777f33f60445a5658ba9e3459e7eec84a
Bug 1186750 part 3 - Abstract CancelableFileEvent in DeviceStorageReqeustParent and use already_AddRefed&& for passing DeviceStorageFile parameter. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/fa9922692623cea44fb2fb29064e24380372aafb
Bug 1186750 part 4 - Clear runnable list in DeviceStorageRequestParent when being destroyed. r=dhylands
Keywords: leave-open
Attachment #8637840 - Attachment is obsolete: true
Attachment #8637841 - Attachment is obsolete: true
Attachment #8637842 - Attachment is obsolete: true
Attachment #8637843 - Attachment is obsolete: true
Attachment #8637844 - Attachment is obsolete: true
Attachment #8637845 - Attachment is obsolete: true
Attachment #8637846 - Attachment is obsolete: true
Attachment #8637847 - Attachment is obsolete: true
Bug 1186750 part 5 - Convert nsDOMDeviceStorage::CheckPermission to take already_AddRefed&&.
Attachment #8689441 - Flags: review?(dhylands)
Bug 1186750 part 6 - Remove unused and unimplemented method nsDOMDeviceStorage::StorePermission.
Attachment #8689442 - Flags: review?(dhylands)
Bug 1186750 part 7 - Convert DispatchToOwningThread and DispatchOrAbandon to take already_AddRefed&&.
Attachment #8689443 - Flags: review?(dhylands)
Bug 1186750 part 8 - Convert DeviceStorageUsedSpaceCache::Dispatch to use already_AddRef&&.
Attachment #8689444 - Flags: review?(dhylands)
Bug 1186750 part 9 - Use already_AddRefed&& to initialize mFile of device storage requests.
Attachment #8689445 - Flags: review?(dhylands)
Bug 1186750 part 10 - Simplify code in DeviceStorageRequestParent::Dispatch.
Attachment #8689446 - Flags: review?(dhylands)
Bug 1186750 part 11 - Convert all usage of Dispatch/NS_DispatchToMainThread in dom/devicestorage to pass in either already_AddRefed or raw pointer.
Attachment #8689447 - Flags: review?(dhylands)
Part 10 seems to be identical to the old part 7, so you probably can r+ directly.
Comment on attachment 8689441 [details]
MozReview Request: Bug 1186750 part 5 - Convert nsDOMDeviceStorage::CheckPermission to take already_AddRefed&&.

https://reviewboard.mozilla.org/r/25635/#review23155
Attachment #8689441 - Flags: review?(dhylands) → review+
Attachment #8689442 - Flags: review?(dhylands) → review+
Comment on attachment 8689442 [details]
MozReview Request: Bug 1186750 part 6 - Remove unused and unimplemented method nsDOMDeviceStorage::StorePermission.

https://reviewboard.mozilla.org/r/25637/#review23157
Comment on attachment 8689443 [details]
MozReview Request: Bug 1186750 part 7 - Convert DispatchToOwningThread and DispatchOrAbandon to take already_AddRefed&&.

https://reviewboard.mozilla.org/r/25639/#review23159
Attachment #8689443 - Flags: review?(dhylands) → review+
Comment on attachment 8689444 [details]
MozReview Request: Bug 1186750 part 8 - Convert DeviceStorageUsedSpaceCache::Dispatch to use already_AddRef&&.

https://reviewboard.mozilla.org/r/25641/#review23161
Attachment #8689444 - Flags: review?(dhylands) → review+
Comment on attachment 8689445 [details]
MozReview Request: Bug 1186750 part 9 - Use already_AddRefed&& to initialize mFile of device storage requests.

https://reviewboard.mozilla.org/r/25643/#review23163
Attachment #8689445 - Flags: review?(dhylands) → review+
Comment on attachment 8689446 [details]
MozReview Request: Bug 1186750 part 10 - Simplify code in DeviceStorageRequestParent::Dispatch.

https://reviewboard.mozilla.org/r/25645/#review23165
Attachment #8689446 - Flags: review?(dhylands) → review+
Comment on attachment 8689447 [details]
MozReview Request: Bug 1186750 part 11 - Convert all usage of Dispatch/NS_DispatchToMainThread in dom/devicestorage to pass in either already_AddRefed or raw pointer.

https://reviewboard.mozilla.org/r/25647/#review23153

r=me if you address the XPCOM_NO_SMARTPOINTER_DISPATCH define. I couldn't see any reason for it to be defined.

::: dom/devicestorage/moz.build:52
(Diff revision 1)
> +CXXFLAGS += ['-DXPCOM_NO_SMARTPOINTER_DISPATCH']

What does this do? I couldn't find any references to this in the codebase.
Attachment #8689447 - Flags: review?(dhylands) → review+
(In reply to Dave Hylands [:dhylands] from comment #39)
> Comment on attachment 8689447 [details]
> MozReview Request: Bug 1186750 part 11 - Convert all usage of
> Dispatch/NS_DispatchToMainThread in dom/devicestorage to pass in either
> already_AddRefed or raw pointer.
> 
> https://reviewboard.mozilla.org/r/25647/#review23153
> 
> r=me if you address the XPCOM_NO_SMARTPOINTER_DISPATCH define. I couldn't
> see any reason for it to be defined.
> 
> ::: dom/devicestorage/moz.build:52
> (Diff revision 1)
> > +CXXFLAGS += ['-DXPCOM_NO_SMARTPOINTER_DISPATCH']
> 
> What does this do? I couldn't find any references to this in the codebase.

It is something I want to introduce in bug 1226073. Since that bug gets stuck, I'm going to land this patchset without this line. Thanks for the fast reviewing.
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd192633b5e49db4b88e31ffd11157be6d446ae8
Bug 1186750 part 5 - Convert nsDOMDeviceStorage::CheckPermission to take already_AddRefed&&. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/dc63519e3cae242606a1009f707af3d0f6943344
Bug 1186750 part 6 - Remove unused and unimplemented method nsDOMDeviceStorage::StorePermission. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/cbd3f6d49362e867b8e9e9bdfea3a18c970d3a6b
Bug 1186750 part 7 - Convert DispatchToOwningThread and DispatchOrAbandon to take already_AddRefed&&. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/ebb8a91b830ab636683df1aa684f002caef9438e
Bug 1186750 part 8 - Convert DeviceStorageUsedSpaceCache::Dispatch to use already_AddRef&&. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/c5aa32cc038f734fe2b41caced968fb15a692405
Bug 1186750 part 9 - Use already_AddRefed&& to initialize mFile of device storage requests. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/0fb7145a9eecf6e26a33217fa665ad5b6b330258
Bug 1186750 part 10 - Simplify code in DeviceStorageRequestParent::Dispatch. r=dhylands

https://hg.mozilla.org/integration/mozilla-inbound/rev/41db68696ad0434455ac585e522be98e43a119d3
Bug 1186750 part 11 - Convert all usage of Dispatch/NS_DispatchToMainThread in dom/devicestorage to pass in either already_AddRefed or raw pointer. r=dhylands
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: