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

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: patch for landing Created 8 years, 9 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..0be74e7dd4e4c8616ebd7ea2870eef87e95e87e8 100644
--- a/chrome/browser/search_engines/template_url_fetcher.cc
+++ b/chrome/browser/search_engines/template_url_fetcher.cc
@@ -18,6 +18,9 @@
#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/render_view_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,14 @@ 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->GetURL(),
+ web_contents->GetRenderProcessHost()->GetID(),
+ web_contents->GetRenderViewHost()->GetRoutingID());
+ }
+
url_fetcher_->Start();
}
@@ -240,6 +252,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 +294,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));
}
« no previous file with comments | « chrome/browser/search_engines/template_url_fetcher.h ('k') | chrome/browser/search_engines/template_url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698