Closed Bug 1190176 Opened 5 years ago Closed 5 years ago

[LayerScope] LayerScopeWebSocketManager is not thread safe

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: u459114, Assigned: u459114)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

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: 5 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.