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

Unified Diff: content/browser/browser_url_handler.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: works now Created 9 years, 5 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: content/browser/browser_url_handler.cc
diff --git a/content/browser/browser_url_handler.cc b/content/browser/browser_url_handler.cc
index e6e76a0095d7b6d5235d0bb22f680bd6919594a0..c094f7470798f307f60a9092f19e25182b1599f0 100644
--- a/content/browser/browser_url_handler.cc
+++ b/content/browser/browser_url_handler.cc
@@ -11,7 +11,7 @@
#include "googleurl/src/gurl.h"
// Handles rewriting view-source URLs for what we'll actually load.
-static bool HandleViewSource(GURL* url, Profile* profile) {
+static bool HandleViewSource(GURL* url, content::BrowserContext* context) {
if (url->SchemeIs(chrome::kViewSourceScheme)) {
// Load the inner URL instead.
*url = GURL(url->path());
@@ -43,7 +43,7 @@ static bool HandleViewSource(GURL* url, Profile* profile) {
}
// Turns a non view-source URL into the corresponding view-source URL.
-static bool ReverseViewSource(GURL* url, Profile* profile) {
+static bool ReverseViewSource(GURL* url, content::BrowserContext* context) {
// No action necessary if the URL is already view-source:
if (url->SchemeIs(chrome::kViewSourceScheme))
return false;
@@ -89,11 +89,12 @@ void BrowserURLHandler::AddHandlerPair(URLHandler handler,
url_handlers_.push_back(HandlerPair(handler, reverse_handler));
}
-void BrowserURLHandler::RewriteURLIfNecessary(GURL* url, Profile* profile,
+void BrowserURLHandler::RewriteURLIfNecessary(GURL* url,
+ content::BrowserContext* context,
bool* reverse_on_redirect) {
for (size_t i = 0; i < url_handlers_.size(); ++i) {
URLHandler handler = *url_handlers_[i].first;
- if (handler && handler(url, profile)) {
+ if (handler && handler(url, context)) {
*reverse_on_redirect = (url_handlers_[i].second != NULL);
return;
}
@@ -101,17 +102,17 @@ void BrowserURLHandler::RewriteURLIfNecessary(GURL* url, Profile* profile,
}
bool BrowserURLHandler::ReverseURLRewrite(
- GURL* url, const GURL& original, Profile* profile) {
+ GURL* url, const GURL& original, content::BrowserContext* context) {
for (size_t i = 0; i < url_handlers_.size(); ++i) {
URLHandler reverse_rewriter = *url_handlers_[i].second;
if (reverse_rewriter) {
GURL test_url(original);
URLHandler handler = *url_handlers_[i].first;
if (!handler) {
- if (reverse_rewriter(url, profile))
+ if (reverse_rewriter(url, context))
return true;
- } else if (handler(&test_url, profile)) {
- return reverse_rewriter(url, profile);
+ } else if (handler(&test_url, context)) {
+ return reverse_rewriter(url, context);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698