| 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 "net/url_request/url_request_job_factory.h" | 16 #include "net/url_request/url_request_job_factory.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 | 19 |
| 20 namespace appcache { |
| 21 class AppCacheService; |
| 22 } |
| 23 |
| 20 namespace base { | 24 namespace base { |
| 21 class RefCountedMemory; | 25 class RefCountedMemory; |
| 22 } | 26 } |
| 23 | 27 |
| 24 namespace content { | 28 namespace content { |
| 29 class ChromeBlobStorageContext; |
| 25 class ResourceContext; | 30 class ResourceContext; |
| 26 class URLDataManagerBackend; | 31 class URLDataManagerBackend; |
| 27 class URLDataSourceImpl; | 32 class URLDataSourceImpl; |
| 28 class URLRequestChromeJob; | 33 class URLRequestChromeJob; |
| 29 | 34 |
| 30 // URLDataManagerBackend is used internally by ChromeURLDataManager on the IO | 35 // URLDataManagerBackend is used internally by ChromeURLDataManager on the IO |
| 31 // thread. In most cases you can use the API in ChromeURLDataManager and ignore | 36 // thread. In most cases you can use the API in ChromeURLDataManager and ignore |
| 32 // this class. URLDataManagerBackend is owned by ResourceContext. | 37 // this class. URLDataManagerBackend is owned by ResourceContext. |
| 33 class URLDataManagerBackend : public base::SupportsUserData::Data { | 38 class URLDataManagerBackend : public base::SupportsUserData::Data { |
| 34 public: | 39 public: |
| 35 typedef int RequestID; | 40 typedef int RequestID; |
| 36 | 41 |
| 37 URLDataManagerBackend(); | 42 URLDataManagerBackend(); |
| 38 virtual ~URLDataManagerBackend(); | 43 virtual ~URLDataManagerBackend(); |
| 39 | 44 |
| 40 // Invoked to create the protocol handler for chrome://. |is_incognito| should | 45 // Invoked to create the protocol handler for chrome://. |is_incognito| should |
| 41 // be set for incognito profiles. Called on the UI thread. | 46 // be set for incognito profiles. Called on the UI thread. |
| 42 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( | 47 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( |
| 43 content::ResourceContext* resource_context, | 48 content::ResourceContext* resource_context, |
| 44 bool is_incognito); | 49 bool is_incognito, |
| 50 appcache::AppCacheService* appcache_service, |
| 51 ChromeBlobStorageContext* blob_storage_context); |
| 45 | 52 |
| 46 // Adds a DataSource to the collection of data sources. | 53 // Adds a DataSource to the collection of data sources. |
| 47 void AddDataSource(URLDataSourceImpl* source); | 54 void AddDataSource(URLDataSourceImpl* source); |
| 48 | 55 |
| 49 // DataSource invokes this. Sends the data to the URLRequest. | 56 // DataSource invokes this. Sends the data to the URLRequest. |
| 50 void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes); | 57 void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes); |
| 51 | 58 |
| 52 static net::URLRequestJob* Factory(net::URLRequest* request, | 59 static net::URLRequestJob* Factory(net::URLRequest* request, |
| 53 const std::string& scheme); | 60 const std::string& scheme); |
| 54 | 61 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 102 |
| 96 // Creates protocol handler for chrome-devtools://. |is_incognito| should be | 103 // Creates protocol handler for chrome-devtools://. |is_incognito| should be |
| 97 // set for incognito profiles. | 104 // set for incognito profiles. |
| 98 net::URLRequestJobFactory::ProtocolHandler* | 105 net::URLRequestJobFactory::ProtocolHandler* |
| 99 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 106 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 100 bool is_incognito); | 107 bool is_incognito); |
| 101 | 108 |
| 102 } // namespace content | 109 } // namespace content |
| 103 | 110 |
| 104 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ | 111 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ |
| OLD | NEW |