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

Unified Diff: extensions/browser/api/web_request/web_request_api_helpers.cc

Issue 2442213003: Remove dead extensions tracking code. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « extensions/browser/api/web_request/web_request_api_helpers.h ('k') | extensions/browser/runtime_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/web_request/web_request_api_helpers.cc
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.cc b/extensions/browser/api/web_request/web_request_api_helpers.cc
index a7e88490401bff6fcb15bf081db787466040766d..a1706d880f207934b52dadfc854af6aa0e809be3 100644
--- a/extensions/browser/api/web_request/web_request_api_helpers.cc
+++ b/extensions/browser/api/web_request/web_request_api_helpers.cc
@@ -1232,50 +1232,6 @@ void ClearCacheOnNavigation() {
}
}
-void NotifyWebRequestAPIUsed(void* browser_context_id,
- const std::string& extension_id) {
- DCHECK(!extension_id.empty());
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- content::BrowserContext* browser_context =
- reinterpret_cast<content::BrowserContext*>(browser_context_id);
- if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(
- browser_context))
- return;
-
- extensions::RuntimeData* runtime_data =
- extensions::ExtensionSystem::Get(browser_context)->runtime_data();
- if (runtime_data->HasUsedWebRequest(extension_id))
- return;
- runtime_data->SetHasUsedWebRequest(extension_id, true);
-
- for (content::RenderProcessHost::iterator it =
- content::RenderProcessHost::AllHostsIterator();
- !it.IsAtEnd(); it.Advance()) {
- content::RenderProcessHost* host = it.GetCurrentValue();
- if (host->GetBrowserContext() == browser_context)
- SendExtensionWebRequestStatusToHost(host);
- }
-}
-
-void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host) {
- content::BrowserContext* browser_context = host->GetBrowserContext();
- if (!browser_context)
- return;
-
- bool webrequest_used = false;
- const extensions::ExtensionSet& extensions =
- extensions::ExtensionRegistry::Get(browser_context)->enabled_extensions();
- extensions::RuntimeData* runtime_data =
- extensions::ExtensionSystem::Get(browser_context)->runtime_data();
- for (extensions::ExtensionSet::const_iterator it = extensions.begin();
- !webrequest_used && it != extensions.end();
- ++it) {
- webrequest_used |= runtime_data->HasUsedWebRequest((*it)->id());
- }
-
- host->Send(new ExtensionMsg_UsingWebRequestAPI(webrequest_used));
-}
-
// Converts the |name|, |value| pair of a http header to a HttpHeaders
// dictionary.
std::unique_ptr<base::DictionaryValue> CreateHeaderDictionary(
« no previous file with comments | « extensions/browser/api/web_request/web_request_api_helpers.h ('k') | extensions/browser/runtime_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698