Commit 5d0e3432 authored by rockot's avatar rockot Committed by Commit bot

Permissions: Avoid poking at the heap after Blink shutdown

Changes serviceConnectionError() to be a no-op if Platform::current()
is null. This can happen because MessageLoop destruction may invoke
the callback after Blink shutdown.

TBRing since this precise change was recommended by haraken@ and I'd
like to make sure the fix lands ASAP.

BUG=650637
TBR=haraken@chromium.org

Review-Url: https://codereview.chromium.org/2446723002
Cr-Commit-Position: refs/heads/master@{#427190}
parent c7d2c5a9
...@@ -264,6 +264,13 @@ PermissionService* Permissions::getService(ExecutionContext* executionContext) { ...@@ -264,6 +264,13 @@ PermissionService* Permissions::getService(ExecutionContext* executionContext) {
} }
void Permissions::serviceConnectionError() { void Permissions::serviceConnectionError() {
if (!Platform::current()) {
// TODO(rockot): Remove this hack once renderer shutdown sequence is fixed.
// Note that reaching this code indicates that the MessageLoop has already
// been torn down, so it's impossible for any pending reply callbacks on
// |m_service| to fire beyond this point anyway.
return;
}
m_service.reset(); m_service.reset();
} }
......
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