| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 int request_id); | 81 int request_id); |
| 82 | 82 |
| 83 // Remove a request from the list of pending requests. | 83 // Remove a request from the list of pending requests. |
| 84 void RemoveRequest(URLRequestChromeJob* job); | 84 void RemoveRequest(URLRequestChromeJob* job); |
| 85 | 85 |
| 86 // Returns true if the job exists in |pending_requests_|. False otherwise. | 86 // Returns true if the job exists in |pending_requests_|. False otherwise. |
| 87 // Called by ~URLRequestChromeJob to verify that |pending_requests_| is kept | 87 // Called by ~URLRequestChromeJob to verify that |pending_requests_| is kept |
| 88 // up to date. | 88 // up to date. |
| 89 bool HasPendingJob(URLRequestChromeJob* job) const; | 89 bool HasPendingJob(URLRequestChromeJob* job) const; |
| 90 | 90 |
| 91 // Look up the data source for the request. Returns the source if it is found, |
| 92 // else NULL. |
| 93 URLDataSourceImpl* GetDataSourceFromURL(const GURL& url); |
| 94 |
| 91 // Custom sources of data, keyed by source path (e.g. "favicon"). | 95 // Custom sources of data, keyed by source path (e.g. "favicon"). |
| 92 DataSourceMap data_sources_; | 96 DataSourceMap data_sources_; |
| 93 | 97 |
| 94 // All pending URLRequestChromeJobs, keyed by ID of the request. | 98 // All pending URLRequestChromeJobs, keyed by ID of the request. |
| 95 // URLRequestChromeJob calls into this object when it's constructed and | 99 // URLRequestChromeJob calls into this object when it's constructed and |
| 96 // destructed to ensure that the pointers in this map remain valid. | 100 // destructed to ensure that the pointers in this map remain valid. |
| 97 PendingRequestMap pending_requests_; | 101 PendingRequestMap pending_requests_; |
| 98 | 102 |
| 99 // The ID we'll use for the next request we receive. | 103 // The ID we'll use for the next request we receive. |
| 100 RequestID next_request_id_; | 104 RequestID next_request_id_; |
| 101 | 105 |
| 102 DISALLOW_COPY_AND_ASSIGN(URLDataManagerBackend); | 106 DISALLOW_COPY_AND_ASSIGN(URLDataManagerBackend); |
| 103 }; | 107 }; |
| 104 | 108 |
| 105 // Creates protocol handler for chrome-devtools://. |is_incognito| should be | 109 // Creates protocol handler for chrome-devtools://. |is_incognito| should be |
| 106 // set for incognito profiles. | 110 // set for incognito profiles. |
| 107 net::URLRequestJobFactory::ProtocolHandler* | 111 net::URLRequestJobFactory::ProtocolHandler* |
| 108 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 112 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 109 bool is_incognito); | 113 bool is_incognito); |
| 110 | 114 |
| 111 } // namespace content | 115 } // namespace content |
| 112 | 116 |
| 113 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ | 117 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ |
| OLD | NEW |