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

Unified Diff: chrome/browser/search/local_ntp_source.cc

Issue 2856093004: Generalize content::URLDataSource so that it can be used by the network service. (Closed)
Patch Set: review comments Created 3 years, 8 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/local_ntp_source.cc
diff --git a/chrome/browser/search/local_ntp_source.cc b/chrome/browser/search/local_ntp_source.cc
index 85821bc805245b8f04dc42d5d69acd09c9aacbcf..8f4b7085fb04b103e298781486a92ab68fd78812 100644
--- a/chrome/browser/search/local_ntp_source.cc
+++ b/chrome/browser/search/local_ntp_source.cc
@@ -388,16 +388,20 @@ bool LocalNtpSource::AllowCaching() const {
}
bool LocalNtpSource::ShouldServiceRequest(
- const net::URLRequest* request) const {
+ const GURL& url,
+ content::ResourceContext* resource_context,
+ int render_process_id) const {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- DCHECK(request->url().host_piece() == chrome::kChromeSearchLocalNtpHost);
- if (!InstantIOContext::ShouldServiceRequest(request))
+ DCHECK(url.host_piece() == chrome::kChromeSearchLocalNtpHost);
+ if (!InstantIOContext::ShouldServiceRequest(url, resource_context,
+ render_process_id)) {
return false;
+ }
- if (request->url().SchemeIs(chrome::kChromeSearchScheme)) {
+ if (url.SchemeIs(chrome::kChromeSearchScheme)) {
std::string filename;
- webui::ParsePathAndScale(request->url(), &filename, nullptr);
+ webui::ParsePathAndScale(url, &filename, nullptr);
for (size_t i = 0; i < arraysize(kResources); ++i) {
if (filename == kResources[i].filename)
return true;

Powered by Google App Engine
This is Rietveld 408576698