Chromium Code Reviews
DescriptionSeparate validation failures from other failures in ExecuteCodeFunction.
ExecuteCodeFunction::Init() used to treat all failures as fatal, leading to
validation failures, resulting in renderer kills.
This is likely the cause of high number of tabs.executeScript/tabs.insertCSS
failures we see in UMA.
During shutdown, the browser window can be null or it might not have
any active tabs. Make ExecuteCodeInTabFunction return an error instead
of blowing up the renderer with bad_message.
This CL treats these kind of of errors non-fatal and returns error
from ExtensionFunction instead.
Add unit test to cover one case of non-fatal failure.
BUG=642794
Test=Have an extension keep the browser busy with running scripts [1] and
shutdown the browser (Ctrl-c) while it is running those scripts. Renderer
kill shouldn't happen anymore.
[1] example:
var currentIter = 0;
var runScript = function() {
++currentIter;
if (currentIter > 1000) return;
chrome.tabs.executeScript(undefined, {file:"content.js", runScript);
};
chrome.browserAction.onClicked.addListener(runScript);
Review-Url: https://codereview.chromium.org/2630753003
Cr-Commit-Position: refs/heads/master@{#445887}
Committed: https://chromium.googlesource.com/chromium/src/+/c93597557d1bee873c2e47ad18639d1f1b34d2b2
Patch Set 1 #Patch Set 2 : . #
Total comments: 10
Patch Set 3 : address comments #Patch Set 4 : add comment #
Total comments: 6
Patch Set 5 : address comments #Messages
Total messages: 22 (13 generated)
|