[LayerScope] LayerScopeWebSocketManager is not thread safe

RESOLVED FIXED in Firefox 42

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: u459114, Assigned: u459114)

Tracking

(Blocks 1 bug)

unspecified
mozilla42
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

LayerScopeWebSocketManager::AdConnection/ RemoveConnection are called from main thread and change mHandlers.Length()
LayerScopeWebSocketManager::IsConnected is called from compisitor thread and read mHandlers.Length()

It cause LayerScope receive unpaired frame data when click connect/disconnect button quickly at viewer side.
Hi Dan,
Several things done in this patch:
1. (Major) Make LayerScopeWebSocketManager::mHandler thread safe
   We access this object in both main and compositor thread, need a mutex to guarantee thread safe.
2. (Minor) Move LayerScopeWebSocketHander into LayerScopeSocketManager
   Since only LayerScopeSocketManager uses LayerScopeWebSocketHandler, make it as an inline class of it. Since it's a inline class of LayerScopeWebSocketManager, shorten its name to SocketManager
3. (Minot) Move DebugListener into LayerScopeSockeManager
   Reason is the same with #2
Attachment #8642326 - Flags: review?(dglastonbury)
Attachment #8642326 - Flags: review?(dglastonbury) → review+
Attachment #8642326 - Attachment is obsolete: true
Attachment #8642863 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2053b3d500ab
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Blocks: LayerScope
No longer depends on: LayerScope
You need to log in before you can comment on or make changes to this bug.