Closed
Bug 910808
Opened 12 years ago
Closed 12 years ago
DeviceStorage uses preferences off the main thread
Categories
(Core :: DOM: Device Interfaces, defect)
Core
DOM: Device Interfaces
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: khuey, Assigned: dhylands)
References
Details
Attachments
(2 files)
3.82 KB,
text/plain
|
Details | |
2.67 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
http://hg.mozilla.org/mozilla-central/annotate/21b5af569ca2/dom/devicestorage/nsDeviceStorage.cpp#l768
Preferences can only be safely used from the main thread. We need to get the value on the main thread and store it somewhere.
Assignee | ||
Comment 1•12 years ago
|
||
So I guess the question is who is calling this off the main thread?
Reporter | ||
Comment 2•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → dhylands
Assignee | ||
Comment 3•12 years ago
|
||
Assignee | ||
Comment 4•12 years ago
|
||
Comment on attachment 797578 [details] [diff] [review]
Remove call to request preference.
Added asserts to the places which call GetBool
Removed call to GetBool, since it can be infered from the sDirs->temp which is calculated in InitDirs, which does run on the main thread (there is an assert at the top).
Attachment #797578 -
Flags: review?(khuey)
Reporter | ||
Comment 5•12 years ago
|
||
Comment on attachment 797578 [details] [diff] [review]
Remove call to request preference.
Review of attachment 797578 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/devicestorage/nsDeviceStorage.cpp
@@ +1342,5 @@
> void
> nsDOMDeviceStorage::SetRootDirectoryForType(const nsAString& aStorageType,
> const nsAString& aStorageName)
> {
> + NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
MOZ_ASSERT.
@@ +2143,5 @@
> NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(DeviceStorageRequest,
> nsIContentPermissionRequest)
>
> NS_IMETHOD Run() {
> + NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
MOZ_ASSERT.
@@ +3141,5 @@
> nsDOMDeviceStorage::EnumerateInternal(const nsAString& aPath,
> const EnumerationParameters& aOptions,
> bool aEditable, ErrorResult& aRv)
> {
> + NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
MOZ_ASSERT.
Attachment #797578 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 6•12 years ago
|
||
Reporter | ||
Comment 7•12 years ago
|
||
Looks good. Can you land this?
Assignee | ||
Comment 8•12 years ago
|
||
Oh - thanks for the reminder. I had tried to a few times but the tree was closed.
Assignee | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•