Rate limit programmatic update checks for extensions (reland)
Previously extensions could call the runtime.requestUpdateCheck method
as often as every 5 seconds. This CL introduces a more restrictive
policy of around one extra check per autoupdate period, and changes the
implementation location of the rate limiting from within the
ExtensionUpdater code itself to the ChromeRuntimeAPIDelegate, and makes
it more flexible by using net::BackoffEntry.
This is a reland of https://codereview.chromium.org/1887253002, with
the removal of a static initializer.
BUG=599310
Review URL: https://codereview.chromium.org/1897293005
Cr-Commit-Position: refs/heads/master@{#388654}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 43f3ca0..a16b493 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -518,7 +518,8 @@
<< " because it is not installed or pending";
// Delete extension_path since we're not creating a CrxInstaller
// that would do it for us.
- if (!GetFileTaskRunner()->PostTask(
+ if (file_ownership_passed &&
+ !GetFileTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&extensions::file_util::DeleteFile, file.path, false)))
NOTREACHED();
@@ -691,12 +692,12 @@
}
void ExtensionService::ReloadExtension(const std::string& extension_id) {
- ReloadExtensionImpl(extension_id, true); // be_noisy
+ ReloadExtensionImpl(extension_id, true); // be_noisy
}
void ExtensionService::ReloadExtensionWithQuietFailure(
const std::string& extension_id) {
- ReloadExtensionImpl(extension_id, false); // be_noisy
+ ReloadExtensionImpl(extension_id, false); // be_noisy
}
bool ExtensionService::UninstallExtension(