Closed Bug 733696 Opened 8 years ago Closed 8 years ago

ObserversManager might report invalid cached value if notification is disabled

Categories

(Core :: Hardware Abstraction Layer (HAL), defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: kanru, Assigned: mounir)

Details

(Whiteboard: [needs review])

Attachments

(1 file)

As discussed in bug 697132 comment 133,

if we call GetCurrentInformation and notifications are disabled, we'll set mHasValidCache to true, which doesn't seem right.  If notifications are disabled, the cache is invalid the moment GetCurrentInformationInternal returns.
You should not call GetCurrentInformation if notifications are disabled. At least, it was not planned when designing this. Why do you want to do that?
(In reply to Mounir Lamouri (:volkmar) (:mounir) from comment #1)
> You should not call GetCurrentInformation if notifications are disabled. At
> least, it was not planned when designing this. Why do you want to do that?

Well, I didn't know the original intention so only looked at the interface and guess I can call it. And it is reasonable that one might want to implement a one-shot query API based on that.
Attached patch Patch v1Splinter Review
I think that |mHasValidCache = true;| is indeed wrong.
Assignee: nobody → mounir
Status: NEW → ASSIGNED
Attachment #603714 - Flags: review?(justin.lebar+bug)
Whiteboard: [needs review]
Version: unspecified → Trunk
Attachment #603714 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/mozilla-central/rev/31176cfa4ff1
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.