Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1045)

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 8205001: (Owner approval for) Delay network requests on startup if any webRequest ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_service.cc
===================================================================
--- chrome/browser/extensions/extension_service.cc (revision 104705)
+++ chrome/browser/extensions/extension_service.cc (working copy)
@@ -667,6 +667,15 @@
return &terminated_extensions_;
}
+void ExtensionService::SetDelaysNetworkRequests(const Extension* extension,
+ bool delays) {
+ extension_prefs_->SetDelaysNetworkRequests(extension->id(), delays);
+}
+
+bool ExtensionService::DelaysNetworkRequests(const Extension* extension) const {
+ return extension_prefs_->DelaysNetworkRequests(extension->id());
+}
+
PendingExtensionManager* ExtensionService::pending_extension_manager() {
return &pending_extension_manager_;
}
@@ -2501,6 +2510,12 @@
extension_prefs_->SetAllowFileAccess(id, true);
}
+ // If the extension should automatically block network startup (e.g., it uses
+ // the webRequest API), set the preference. Otherwise clear it, in case the
+ // extension stopped using a relevant API.
+ SetDelaysNetworkRequests(extension,
Aaron Boodman 2011/10/10 22:59:29 This will definitely clear (as in remove from the
Pam (message me for reviews) 2011/10/12 14:28:12 Yes, if false it removes the pref from the Extensi
+ extension->ImplicitlyDelaysNetworkStartup());
+
NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_INSTALLED,
Source<Profile>(profile_),

Powered by Google App Engine
This is Rietveld 408576698