Commit 4e06cff8 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Fix crash when ExecuteContextLifecycleStateObserver::SetExecutionContext is given a nullptr

ExecutionContextLifecycleObserver::SetExecutionContext tolerates nullptr, but
this override does not.

Bug: 1061369
Test: fast/media/move-video-to-new-document-crash.html
Change-Id: I0fd35fa5abb550187757cd932102b8e303be39bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103128Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750297}
parent 2684c83e
...@@ -75,6 +75,8 @@ void ExecutionContextLifecycleStateObserver::UpdateStateIfNeeded() { ...@@ -75,6 +75,8 @@ void ExecutionContextLifecycleStateObserver::UpdateStateIfNeeded() {
void ExecutionContextLifecycleStateObserver::SetExecutionContext( void ExecutionContextLifecycleStateObserver::SetExecutionContext(
ExecutionContext* context) { ExecutionContext* context) {
ExecutionContextLifecycleObserver::SetExecutionContext(context); ExecutionContextLifecycleObserver::SetExecutionContext(context);
if (!context)
return;
if (context->IsContextDestroyed()) { if (context->IsContextDestroyed()) {
ContextDestroyed(); ContextDestroyed();
......
<body>
<div>
PASS if no crash.
</div>
<video>
<script>
if (window.testRunner)
testRunner.dumpAsText();
document.execCommand("selectAll");
document.execCommand("Copy");
document.designMode = 'on';
document.execCommand("paste");
</script>
</body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment