Bug 196034 - Use WeakPtr instead of storing raw pointers in WebSocket code
Summary: Use WeakPtr instead of storing raw pointers in WebSocket code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-20 14:43 PDT by Alex Christensen
Modified: 2019-03-20 16:31 PDT (History)
3 users (show)

See Also:


Attachments
Patch (10.52 KB, patch)
2019-03-20 14:45 PDT, Alex Christensen
ggaren: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>