Revert "Remove blink::CallExtraOrCrash"
This reverts commit 1977b793. Reason for revert: breaks WebKit Linux Trusty MSAN Tests seem to time out since this CL: https://test-results.appspot.com/data/layout_results/WebKit_Linux_Trusty_MSAN/8393/layout-test-results/results.html https://ci.chromium.org/buildbot/chromium.webkit/WebKit%20Linux%20Trusty%20MSAN/8393 Original change's description: > Remove blink::CallExtraOrCrash > > CallExtraOrCrash is a function to call into V8 Extras and crash if it > fails. Unfortunately, calling into V8 Extras can fail under normal > conditions such as stack overflow and Worker destruction, causing a lot > of unnecessary crashes. Remove CallExtraOrCrash. > > This is a stopgap change designed to be mergable to version 68. It > avoids major code restructuring but as a result lacks robust > encapsulation. > > The general strategy is to pass a boolean pointer to functions in > ReadableStreamOperations that call into V8 Extras. If the internal call > fails, the boolean is set to true, and the call returns a default value. > > BodyStreamBuffer keeps the boolean as member variable. Once a call to a > V8 extra function fails, the boolean is set and no more calls will be > made. This is to avoid us taking action based on information that is > incorrect. > > For Tee() and the from-stream version of the BodyStreamBuffer > constructor, we use an ExceptionState object instead. In these cases, it > is straightforward to pass through ExceptionState object from the Blink > bindings. This allows the failure to be propagated safely back to > Javascript. > > Conversely, DefaultReaderRead() has been switched from using > ExceptionState to using an error-signalling bool. This is because its > callers do not have access to a real ExceptionState object. Previously > callers used a NonThrowableExceptionState, but this was not suitable as > DefaultReaderRead() can throw. > > BodyStreamBuffer mostly wraps access to ReadableStreamOperations, so > some degree of encapsulation has been retained. > > 7 new layout tests exercise each of the deterministically reachable > crashes, using stack overflows. Because they depend on stack layout and > whether DCHECKs are enabled, they only hit the crashes in particular > environments. > > Bug: 829790, 849312 > Change-Id: I47481b33a47b418dc6916e3b4311e60b5fd89e3d > Reviewed-on: https://chromium-review.googlesource.com/1097047 > Commit-Queue: Adam Rice <ricea@chromium.org> > Reviewed-by: Yuki Shiino <yukishiino@chromium.org> > Reviewed-by: Yutaka Hirano <yhirano@chromium.org> > Cr-Commit-Position: refs/heads/master@{#568009} TBR=ricea@chromium.org,yukishiino@chromium.org,yhirano@chromium.org Change-Id: I4234c9a5ebb7bed44f3f0a66b266b65a80efb295 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 829790, 849312 Reviewed-on: https://chromium-review.googlesource.com/1105577Reviewed-by:Giovanni Ortuño Urquidi <ortuno@chromium.org> Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org> Cr-Commit-Position: refs/heads/master@{#568279}
Showing
This diff is collapsed.
Please register or sign in to comment