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

Unified Diff: chrome/browser/search_engines/template_url_fetcher.cc

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestShellNetworkDelegate Created 8 years, 10 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/search_engines/template_url_fetcher.cc
diff --git a/chrome/browser/search_engines/template_url_fetcher.cc b/chrome/browser/search_engines/template_url_fetcher.cc
index d943699f54eedbd4bbfb1e5225eccb8ea3f7e269..e03ae9b4dcb2bd595ee81817cd31371812c62699 100644
--- a/chrome/browser/search_engines/template_url_fetcher.cc
+++ b/chrome/browser/search_engines/template_url_fetcher.cc
@@ -15,9 +15,12 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/template_url_parser.h"
#include "chrome/common/chrome_notification_types.h"
+#include "content/browser/renderer_host/render_view_host.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/url_fetcher.h"
#include "content/public/common/url_fetcher_delegate.h"
#include "net/base/load_flags.h"
@@ -33,6 +36,7 @@ class TemplateURLFetcher::RequestDelegate
const string16& keyword,
const GURL& osdd_url,
const GURL& favicon_url,
+ content::WebContents* web_contents,
TemplateURLFetcherCallbacks* callbacks,
ProviderType provider_type);
@@ -78,6 +82,7 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate(
const string16& keyword,
const GURL& osdd_url,
const GURL& favicon_url,
+ content::WebContents* web_contents,
TemplateURLFetcherCallbacks* callbacks,
ProviderType provider_type)
: ALLOW_THIS_IN_INITIALIZER_LIST(url_fetcher_(content::URLFetcher::Create(
@@ -101,7 +106,13 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate(
}
url_fetcher_->SetRequestContext(fetcher->profile()->GetRequestContext());
- url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
+ // Can be NULL during tests.
+ if (web_contents) {
+ url_fetcher_->AssociateWithRenderView(
+ web_contents->GetRenderProcessHost()->GetID(),
+ web_contents->GetRenderViewHost()->routing_id());
+ }
+
url_fetcher_->Start();
}
@@ -240,6 +251,7 @@ void TemplateURLFetcher::ScheduleDownload(
const string16& keyword,
const GURL& osdd_url,
const GURL& favicon_url,
+ content::WebContents* web_contents,
TemplateURLFetcherCallbacks* callbacks,
ProviderType provider_type) {
DCHECK(osdd_url.is_valid());
@@ -281,7 +293,7 @@ void TemplateURLFetcher::ScheduleDownload(
}
requests_->push_back(
- new RequestDelegate(this, keyword, osdd_url, favicon_url,
+ new RequestDelegate(this, keyword, osdd_url, favicon_url, web_contents,
owned_callbacks.release(), provider_type));
}

Powered by Google App Engine
This is Rietveld 408576698