Chromium Code Reviews| Index: content/browser/webui/url_data_manager_backend.h |
| diff --git a/content/browser/webui/url_data_manager_backend.h b/content/browser/webui/url_data_manager_backend.h |
| index 20002c794cb2fc7ca009b7f582a45bad670be7cc..a0144b9f4e291af754b0ea1ac2885fe82bf644c3 100644 |
| --- a/content/browser/webui/url_data_manager_backend.h |
| +++ b/content/browser/webui/url_data_manager_backend.h |
| @@ -16,6 +16,7 @@ |
| #include "base/values.h" |
| #include "content/browser/webui/url_data_manager.h" |
| #include "content/public/browser/url_data_source.h" |
| +#include "net/http/http_response_headers.h" |
| #include "net/url_request/url_request_job_factory.h" |
| class GURL; |
| @@ -42,12 +43,11 @@ class URLDataManagerBackend : public base::SupportsUserData::Data { |
| URLDataManagerBackend(); |
| ~URLDataManagerBackend() override; |
| - // Invoked to create the protocol handler for chrome://. |is_incognito| should |
| - // be set for incognito profiles. Called on the UI thread. |
| + // Invoked to create the protocol handler for chrome://. Called on the UI |
| + // thread. |
| CONTENT_EXPORT static std::unique_ptr< |
| net::URLRequestJobFactory::ProtocolHandler> |
| CreateProtocolHandler(content::ResourceContext* resource_context, |
|
scottmg
2017/05/05 19:27:42
remove content::
jam
2017/05/05 22:19:39
Done.
|
| - bool is_incognito, |
| ChromeBlobStorageContext* blob_storage_context); |
| // Adds a DataSource to the collection of data sources. |
| @@ -60,8 +60,22 @@ class URLDataManagerBackend : public base::SupportsUserData::Data { |
| // null, which signals an error handling the request. |
| void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes); |
| - static net::URLRequestJob* Factory(net::URLRequest* request, |
| - const std::string& scheme); |
| + // Look up the data source for the request. Returns the source if it is found, |
| + // else NULL. |
| + URLDataSourceImpl* GetDataSourceFromURL(const GURL& url); |
| + |
| + // Creates and sets the response headers for the given request. |
| + static scoped_refptr<net::HttpResponseHeaders> GetHeaders( |
| + URLDataSourceImpl* source, |
| + const std::string& path, |
| + const std::string& origin); |
| + |
| + // Returns whether |url| passes some sanity checks and is a valid GURL. |
| + static bool CheckURLIsValid(const GURL& url); |
| + |
| + // Parse |url| to get the path which will be used to resolve the request. The |
| + // path is the remaining portion after the scheme and hostname. |
| + static void URLToRequestPath(const GURL& url, std::string* path); |
| private: |
| friend class URLRequestChromeJob; |
| @@ -91,10 +105,6 @@ class URLDataManagerBackend : public base::SupportsUserData::Data { |
| // up to date. |
| bool HasPendingJob(URLRequestChromeJob* job) const; |
| - // Look up the data source for the request. Returns the source if it is found, |
| - // else NULL. |
| - URLDataSourceImpl* GetDataSourceFromURL(const GURL& url); |
| - |
| // Custom sources of data, keyed by source path (e.g. "favicon"). |
| DataSourceMap data_sources_; |
| @@ -109,11 +119,9 @@ class URLDataManagerBackend : public base::SupportsUserData::Data { |
| DISALLOW_COPY_AND_ASSIGN(URLDataManagerBackend); |
| }; |
| -// Creates protocol handler for chrome-devtools://. |is_incognito| should be |
| -// set for incognito profiles. |
| -net::URLRequestJobFactory::ProtocolHandler* |
| -CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| - bool is_incognito); |
| +// Creates protocol handler for chrome-devtools://. |
| +net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
| + content::ResourceContext* resource_context); |
|
scottmg
2017/05/05 19:27:42
remove content::
jam
2017/05/05 22:19:39
Done.
|
| } // namespace content |