| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/supports_user_data.h" | 14 #include "base/supports_user_data.h" |
| 15 #include "content/browser/webui/url_data_manager.h" | 15 #include "content/browser/webui/url_data_manager.h" |
| 16 #include "content/public/browser/url_data_source.h" |
| 16 #include "net/url_request/url_request_job_factory.h" | 17 #include "net/url_request/url_request_job_factory.h" |
| 17 | 18 |
| 18 class GURL; | 19 class GURL; |
| 19 | 20 |
| 20 namespace appcache { | 21 namespace appcache { |
| 21 class AppCacheService; | 22 class AppCacheService; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class RefCountedMemory; | 26 class RefCountedMemory; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 // Called by the job when it's starting up. | 70 // Called by the job when it's starting up. |
| 70 // Returns false if |url| is not a URL managed by this object. | 71 // Returns false if |url| is not a URL managed by this object. |
| 71 bool StartRequest(const net::URLRequest* request, URLRequestChromeJob* job); | 72 bool StartRequest(const net::URLRequest* request, URLRequestChromeJob* job); |
| 72 | 73 |
| 73 // Helper function to call StartDataRequest on |source|'s delegate. This is | 74 // Helper function to call StartDataRequest on |source|'s delegate. This is |
| 74 // needed because while we want to call URLDataSourceDelegate's method, we | 75 // needed because while we want to call URLDataSourceDelegate's method, we |
| 75 // need to add a refcount on the source. | 76 // need to add a refcount on the source. |
| 76 static void CallStartRequest(scoped_refptr<URLDataSourceImpl> source, | 77 static void CallStartRequest(scoped_refptr<URLDataSourceImpl> source, |
| 77 const std::string& path, | 78 const std::string& path, |
| 78 bool is_incognito, | 79 const URLDataSource::ExtraRequestInfo& info, |
| 79 int request_id); | 80 int request_id); |
| 80 | 81 |
| 81 // Remove a request from the list of pending requests. | 82 // Remove a request from the list of pending requests. |
| 82 void RemoveRequest(URLRequestChromeJob* job); | 83 void RemoveRequest(URLRequestChromeJob* job); |
| 83 | 84 |
| 84 // Returns true if the job exists in |pending_requests_|. False otherwise. | 85 // Returns true if the job exists in |pending_requests_|. False otherwise. |
| 85 // Called by ~URLRequestChromeJob to verify that |pending_requests_| is kept | 86 // Called by ~URLRequestChromeJob to verify that |pending_requests_| is kept |
| 86 // up to date. | 87 // up to date. |
| 87 bool HasPendingJob(URLRequestChromeJob* job) const; | 88 bool HasPendingJob(URLRequestChromeJob* job) const; |
| 88 | 89 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 102 | 103 |
| 103 // Creates protocol handler for chrome-devtools://. |is_incognito| should be | 104 // Creates protocol handler for chrome-devtools://. |is_incognito| should be |
| 104 // set for incognito profiles. | 105 // set for incognito profiles. |
| 105 net::URLRequestJobFactory::ProtocolHandler* | 106 net::URLRequestJobFactory::ProtocolHandler* |
| 106 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 107 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 107 bool is_incognito); | 108 bool is_incognito); |
| 108 | 109 |
| 109 } // namespace content | 110 } // namespace content |
| 110 | 111 |
| 111 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ | 112 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ |
| OLD | NEW |