RESOLVED FIXED 154183
WebView public APIs should have thread violation checks.
https://bugs.webkit.org/show_bug.cgi?id=154183
Summary WebView public APIs should have thread violation checks.
Mark Lam
Reported 2016-02-12 12:22:40 PST
This will help clients of the API detect the violations sooner rather than having to debug mysterious crashes / failures later.
Attachments
proposed patch. (5.10 KB, patch)
2016-02-12 12:30 PST, Mark Lam
no flags
proposed patch 2: revised to use WebCoreThreadViolationCheckRoundThree(). (6.62 KB, patch)
2016-02-12 16:58 PST, Mark Lam
timothy: review-
proposed patch 3: address Tim's feedback. (8.47 KB, patch)
2016-02-12 17:27 PST, Mark Lam
no flags
Mark Lam
Comment 1 2016-02-12 12:30:10 PST
Created attachment 271202 [details] proposed patch.
Geoffrey Garen
Comment 2 2016-02-12 15:49:41 PST
Comment on attachment 271202 [details] proposed patch. r=me
WebKit Commit Bot
Comment 3 2016-02-12 16:22:55 PST
Comment on attachment 271202 [details] proposed patch. Clearing flags on attachment: 271202 Committed r196527: <http://trac.webkit.org/changeset/196527>
WebKit Commit Bot
Comment 4 2016-02-12 16:22:58 PST
All reviewed patches have been landed. Closing bug.
Timothy Hatcher
Comment 5 2016-02-12 16:26:57 PST
Comment on attachment 271202 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=271202&action=review > Source/WebKit/mac/WebView/WebView.mm:5846 > + WebCoreThreadViolationCheckRoundTwo(); This should have added a WebCoreThreadViolationCheckRoundThree and corresponding ThreadViolationRoundThree along with tagging the WebKit version these were added with a new WebKitLinkedOnOrAfter check in -[WebFrameView initWithFrame:]. Not doing this is a binary compatibility risk, since old app who might be calling these APIs on other threads will start getting exceptions, when they might have worked fine before.
Mark Lam
Comment 6 2016-02-12 16:28:28 PST
(In reply to comment #5) > Comment on attachment 271202 [details] > proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=271202&action=review > > > Source/WebKit/mac/WebView/WebView.mm:5846 > > + WebCoreThreadViolationCheckRoundTwo(); > > This should have added a WebCoreThreadViolationCheckRoundThree and > corresponding ThreadViolationRoundThree along with tagging the WebKit > version these were added with a new WebKitLinkedOnOrAfter check in > -[WebFrameView initWithFrame:]. Not doing this is a binary compatibility > risk, since old app who might be calling these APIs on other threads will > start getting exceptions, when they might have worked fine before. I'll roll out and redo as Round 3.
Mark Lam
Comment 7 2016-02-12 16:58:05 PST
Created attachment 271249 [details] proposed patch 2: revised to use WebCoreThreadViolationCheckRoundThree().
Timothy Hatcher
Comment 8 2016-02-12 17:02:01 PST
Comment on attachment 271249 [details] proposed patch 2: revised to use WebCoreThreadViolationCheckRoundThree(). View in context: https://bugs.webkit.org/attachment.cgi?id=271249&action=review You are missing a call to setDefaultThreadViolationBehavior in -[WebFrameView initWithFrame:]. > Source/WebCore/platform/mac/ThreadCheck.mm:39 > +static ThreadViolationBehavior threadViolationBehavior[MaximumThreadViolationRound] = > + { RaiseExceptionOnThreadViolation, RaiseExceptionOnThreadViolation, RaiseExceptionOnThreadViolation }; I would not have put this on a newline.
Mark Lam
Comment 9 2016-02-12 17:27:52 PST
Created attachment 271253 [details] proposed patch 3: address Tim's feedback.
WebKit Commit Bot
Comment 10 2016-02-13 09:41:12 PST
Comment on attachment 271253 [details] proposed patch 3: address Tim's feedback. Clearing flags on attachment: 271253 Committed r196551: <http://trac.webkit.org/changeset/196551>
WebKit Commit Bot
Comment 11 2016-02-13 09:41:15 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.