| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H__ | 5 #ifndef BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H__ |
| 6 #define BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H__ | 6 #define BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Translate a chrome resource URL into a local file path if there is one. | 105 // Translate a chrome resource URL into a local file path if there is one. |
| 106 // Returns false if there is no file handler for this URL | 106 // Returns false if there is no file handler for this URL |
| 107 static bool URLToFilePath(const GURL& url, std::wstring* file_path); | 107 static bool URLToFilePath(const GURL& url, std::wstring* file_path); |
| 108 | 108 |
| 109 // Called by the job when it's starting up. | 109 // Called by the job when it's starting up. |
| 110 // Returns false if |url| is not a URL managed by this object. | 110 // Returns false if |url| is not a URL managed by this object. |
| 111 bool StartRequest(const GURL& url, URLRequestChromeJob* job); | 111 bool StartRequest(const GURL& url, URLRequestChromeJob* job); |
| 112 // Remove a request from the list of pending requests. | 112 // Remove a request from the list of pending requests. |
| 113 void RemoveRequest(URLRequestChromeJob* job); | 113 void RemoveRequest(URLRequestChromeJob* job); |
| 114 | 114 |
| 115 // Returns true if the job exists in |pending_requests_|. False otherwise. |
| 116 // Called by ~URLRequestChromeJob to verify that |pending_requests_| is kept |
| 117 // up to date. |
| 118 bool HasPendingJob(URLRequestChromeJob* job) const; |
| 119 |
| 115 // Sent by Request::SendResponse. | 120 // Sent by Request::SendResponse. |
| 116 void DataAvailable(RequestID request_id, | 121 void DataAvailable(RequestID request_id, |
| 117 scoped_refptr<RefCountedBytes> bytes); | 122 scoped_refptr<RefCountedBytes> bytes); |
| 118 | 123 |
| 119 // File sources of data, keyed by source name (e.g. "inspector"). | 124 // File sources of data, keyed by source name (e.g. "inspector"). |
| 120 typedef std::map<std::string, std::wstring> FileSourceMap; | 125 typedef std::map<std::string, std::wstring> FileSourceMap; |
| 121 FileSourceMap file_sources_; | 126 FileSourceMap file_sources_; |
| 122 | 127 |
| 123 // Custom sources of data, keyed by source path (e.g. "favicon"). | 128 // Custom sources of data, keyed by source path (e.g. "favicon"). |
| 124 typedef std::map<std::string, scoped_refptr<DataSource> > DataSourceMap; | 129 typedef std::map<std::string, scoped_refptr<DataSource> > DataSourceMap; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 145 extern ChromeURLDataManager chrome_url_data_manager; | 150 extern ChromeURLDataManager chrome_url_data_manager; |
| 146 | 151 |
| 147 // Register our special URL handler under our special URL scheme. | 152 // Register our special URL handler under our special URL scheme. |
| 148 // Must be done once at startup. | 153 // Must be done once at startup. |
| 149 void RegisterURLRequestChromeJob(); | 154 void RegisterURLRequestChromeJob(); |
| 150 | 155 |
| 151 // Undoes the registration done by RegisterURLRequestChromeJob. | 156 // Undoes the registration done by RegisterURLRequestChromeJob. |
| 152 void UnregisterURLRequestChromeJob(); | 157 void UnregisterURLRequestChromeJob(); |
| 153 | 158 |
| 154 #endif // BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H__ | 159 #endif // BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H__ |
| OLD | NEW |