OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 15 #include "chrome/browser/ui/webui/chrome_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 ChromeAppCacheService; | |
19 class ChromeURLDataManagerBackend; | 18 class ChromeURLDataManagerBackend; |
20 class GURL; | 19 class GURL; |
21 class RefCountedMemory; | 20 class RefCountedMemory; |
22 class URLRequestChromeJob; | 21 class URLRequestChromeJob; |
23 | 22 |
| 23 namespace appcache { |
| 24 class AppCacheService; |
| 25 } |
| 26 |
24 namespace net { | 27 namespace net { |
25 class URLRequest; | 28 class URLRequest; |
26 class URLRequestJob; | 29 class URLRequestJob; |
27 } | 30 } |
28 namespace webkit_blob { | 31 namespace webkit_blob { |
29 class BlobStorageController; | 32 class BlobStorageController; |
30 } | 33 } |
31 | 34 |
32 // ChromeURLDataManagerBackend is used internally by ChromeURLDataManager on the | 35 // ChromeURLDataManagerBackend is used internally by ChromeURLDataManager on the |
33 // IO thread. In most cases you can use the API in ChromeURLDataManager and | 36 // IO thread. In most cases you can use the API in ChromeURLDataManager and |
34 // ignore this class. ChromeURLDataManagerBackend is owned by | 37 // ignore this class. ChromeURLDataManagerBackend is owned by |
35 // ChromeURLRequestContext. | 38 // ChromeURLRequestContext. |
36 class ChromeURLDataManagerBackend { | 39 class ChromeURLDataManagerBackend { |
37 public: | 40 public: |
38 typedef int RequestID; | 41 typedef int RequestID; |
39 | 42 |
40 ChromeURLDataManagerBackend(); | 43 ChromeURLDataManagerBackend(); |
41 ~ChromeURLDataManagerBackend(); | 44 ~ChromeURLDataManagerBackend(); |
42 | 45 |
43 // Invoked to create the protocol handler for chrome://. | 46 // Invoked to create the protocol handler for chrome://. |
44 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( | 47 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( |
45 ChromeURLDataManagerBackend* backend, | 48 ChromeURLDataManagerBackend* backend, |
46 ChromeAppCacheService* appcache_service, | 49 appcache::AppCacheService* appcache_service, |
47 webkit_blob::BlobStorageController* blob_storage_controller); | 50 webkit_blob::BlobStorageController* blob_storage_controller); |
48 | 51 |
49 // Adds a DataSource to the collection of data sources. | 52 // Adds a DataSource to the collection of data sources. |
50 void AddDataSource(ChromeURLDataManager::DataSource* source); | 53 void AddDataSource(ChromeURLDataManager::DataSource* source); |
51 | 54 |
52 // DataSource invokes this. Sends the data to the URLRequest. | 55 // DataSource invokes this. Sends the data to the URLRequest. |
53 void DataAvailable(RequestID request_id, RefCountedMemory* bytes); | 56 void DataAvailable(RequestID request_id, RefCountedMemory* bytes); |
54 | 57 |
55 static net::URLRequestJob* Factory(net::URLRequest* request, | 58 static net::URLRequestJob* Factory(net::URLRequest* request, |
56 const std::string& scheme); | 59 const std::string& scheme); |
(...skipping 28 matching lines...) Expand all Loading... |
85 // The ID we'll use for the next request we receive. | 88 // The ID we'll use for the next request we receive. |
86 RequestID next_request_id_; | 89 RequestID next_request_id_; |
87 | 90 |
88 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerBackend); | 91 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerBackend); |
89 }; | 92 }; |
90 | 93 |
91 net::URLRequestJobFactory::ProtocolHandler* | 94 net::URLRequestJobFactory::ProtocolHandler* |
92 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend); | 95 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend); |
93 | 96 |
94 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ | 97 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ |
OLD | NEW |