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