Bug 196034

Summary: Use WeakPtr instead of storing raw pointers in WebSocket code
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ggaren: review+, cdumez: commit-queue-

Description Alex Christensen 2019-03-20 14:43:47 PDT
Use WeakPtr instead of storing raw pointers in WebSocket code
Comment 1 Alex Christensen 2019-03-20 14:45:20 PDT
Created attachment 365404 [details]
Patch
Comment 2 Geoffrey Garen 2019-03-20 16:02:28 PDT
Comment on attachment 365404 [details]
Patch

r=me
Comment 3 Chris Dumez 2019-03-20 16:08:46 PDT
Comment on attachment 365404 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=365404&action=review

> Source/WebCore/Modules/websockets/WebSocketHandshake.cpp:126
> +    , m_document(document ? makeWeakPtr(*document) : nullptr)

eh.. we have a makeWeakPtr() which takes in a raw pointer and does this for you.
Comment 4 Alex Christensen 2019-03-20 16:30:23 PDT
Fixed!
https://trac.webkit.org/changeset/243252/webkit
Comment 5 Radar WebKit Bug Importer 2019-03-20 16:31:18 PDT
<rdar://problem/49084881>