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

Unified Diff: content/public/browser/url_data_source.h

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: content/public/browser/url_data_source.h
diff --git a/content/public/browser/url_data_source.h b/content/public/browser/url_data_source.h
index ef3f538df0e363bd5662d35f9b8f24784e6e88ac..f6b187c558fd2c74339521db043de1295f886a87 100644
--- a/content/public/browser/url_data_source.h
+++ b/content/public/browser/url_data_source.h
@@ -13,16 +13,14 @@
#include "content/common/content_export.h"
#include "content/public/browser/resource_request_info.h"
+class GURL;
namespace base {
class RefCountedMemory;
}
-namespace net {
-class URLRequest;
-}
-
namespace content {
class BrowserContext;
+class ResourceContext;
// A URLDataSource is an object that can answer requests for WebUI data
// asynchronously. An implementation of URLDataSource should handle calls to
@@ -130,7 +128,9 @@ class CONTENT_EXPORT URLDataSource {
// to implement fancier access control. Typically used in concert with
// ContentBrowserClient::GetAdditionalWebUISchemes() to permit additional
// WebUI scheme support for an embedder.
- virtual bool ShouldServiceRequest(const net::URLRequest* request) const;
+ virtual bool ShouldServiceRequest(const GURL& url,
+ ResourceContext* resource_context,
+ int render_process_id) const;
// By default, Content-Type: header is not sent along with the response.
// To start sending mime type returned by GetMimeType in HTTP headers,
@@ -148,13 +148,6 @@ class CONTENT_EXPORT URLDataSource {
virtual std::string GetAccessControlAllowOriginForOrigin(
const std::string& origin) const;
- // Called to inform the source that StartDataRequest() will be called soon.
- // Gives the source an opportunity to rewrite |path| to incorporate extra
- // information from the URLRequest prior to serving.
- virtual void WillServiceRequest(
- const net::URLRequest* request,
- std::string* path) const {}
-
// Whether |path| is gzipped (and should be transmitted gzipped).
virtual bool IsGzipped(const std::string& path) const;
};

Powered by Google App Engine
This is Rietveld 408576698