| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ |
| 6 #define CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ | 6 #define CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const std::string& path, | 70 const std::string& path, |
| 71 const std::string& origin); | 71 const std::string& origin); |
| 72 | 72 |
| 73 // Returns whether |url| passes some sanity checks and is a valid GURL. | 73 // Returns whether |url| passes some sanity checks and is a valid GURL. |
| 74 static bool CheckURLIsValid(const GURL& url); | 74 static bool CheckURLIsValid(const GURL& url); |
| 75 | 75 |
| 76 // Parse |url| to get the path which will be used to resolve the request. The | 76 // Parse |url| to get the path which will be used to resolve the request. The |
| 77 // path is the remaining portion after the scheme and hostname. | 77 // path is the remaining portion after the scheme and hostname. |
| 78 static void URLToRequestPath(const GURL& url, std::string* path); | 78 static void URLToRequestPath(const GURL& url, std::string* path); |
| 79 | 79 |
| 80 // Returns the schemes that are used by WebUI (i.e. the set from content and |
| 81 // its embedder). |
| 82 static std::vector<std::string> GetWebUISchemes(); |
| 83 |
| 80 private: | 84 private: |
| 81 friend class URLRequestChromeJob; | 85 friend class URLRequestChromeJob; |
| 82 | 86 |
| 83 typedef std::map<std::string, | 87 typedef std::map<std::string, |
| 84 scoped_refptr<URLDataSourceImpl> > DataSourceMap; | 88 scoped_refptr<URLDataSourceImpl> > DataSourceMap; |
| 85 typedef std::map<RequestID, URLRequestChromeJob*> PendingRequestMap; | 89 typedef std::map<RequestID, URLRequestChromeJob*> PendingRequestMap; |
| 86 | 90 |
| 87 // Called by the job when it's starting up. | 91 // Called by the job when it's starting up. |
| 88 // Returns false if |url| is not a URL managed by this object. | 92 // Returns false if |url| is not a URL managed by this object. |
| 89 bool StartRequest(const net::URLRequest* request, URLRequestChromeJob* job); | 93 bool StartRequest(const net::URLRequest* request, URLRequestChromeJob* job); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 119 DISALLOW_COPY_AND_ASSIGN(URLDataManagerBackend); | 123 DISALLOW_COPY_AND_ASSIGN(URLDataManagerBackend); |
| 120 }; | 124 }; |
| 121 | 125 |
| 122 // Creates protocol handler for chrome-devtools://. | 126 // Creates protocol handler for chrome-devtools://. |
| 123 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( | 127 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
| 124 ResourceContext* resource_context); | 128 ResourceContext* resource_context); |
| 125 | 129 |
| 126 } // namespace content | 130 } // namespace content |
| 127 | 131 |
| 128 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ | 132 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ |
| OLD | NEW |