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

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

Issue 566413002: Remove dependencies of chrome in web_request_api_helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
index 38b1760483857a1f1d48182599896cedc128db83..5a2a67236f224ff1e63ad69732a3f690a5f2c46e 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
@@ -12,9 +12,7 @@
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "base/values.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/web_request/web_request_api.h"
-#include "chrome/browser/profiles/profile_manager.h"
#include "components/web_cache/browser/web_cache_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
@@ -1156,20 +1154,21 @@ void ClearCacheOnNavigation() {
}
void NotifyWebRequestAPIUsed(
- void* profile_id,
+ void* browser_context_id,
scoped_refptr<const extensions::Extension> extension) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- Profile* profile = reinterpret_cast<Profile*>(profile_id);
- if (!g_browser_process->profile_manager()->IsValidProfile(profile))
+ 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(profile)->runtime_data();
+ extensions::ExtensionSystem::Get(browser_context)->runtime_data();
if (runtime_data->HasUsedWebRequest(extension.get()))
return;
runtime_data->SetHasUsedWebRequest(extension.get(), true);
- content::BrowserContext* browser_context = profile;
for (content::RenderProcessHost::iterator it =
content::RenderProcessHost::AllHostsIterator();
!it.IsAtEnd(); it.Advance()) {
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698