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 ChromeURLDataManagerBackend; | 18 class ChromeURLDataManagerBackend; |
19 class GURL; | 19 class GURL; |
20 class RefCountedMemory; | 20 class RefCountedMemory; |
21 class URLRequestChromeJob; | 21 class URLRequestChromeJob; |
22 | 22 |
23 namespace appcache { | |
24 class AppCacheService; | |
25 } | |
26 | |
27 namespace net { | 23 namespace net { |
28 class URLRequest; | 24 class URLRequest; |
29 class URLRequestJob; | 25 class URLRequestJob; |
30 } | 26 } |
31 namespace webkit_blob { | |
32 class BlobStorageController; | |
33 } | |
34 | 27 |
35 // ChromeURLDataManagerBackend is used internally by ChromeURLDataManager on the | 28 // ChromeURLDataManagerBackend is used internally by ChromeURLDataManager on the |
36 // IO thread. In most cases you can use the API in ChromeURLDataManager and | 29 // IO thread. In most cases you can use the API in ChromeURLDataManager and |
37 // ignore this class. ChromeURLDataManagerBackend is owned by | 30 // ignore this class. ChromeURLDataManagerBackend is owned by |
38 // ChromeURLRequestContext. | 31 // ChromeURLRequestContext. |
39 class ChromeURLDataManagerBackend { | 32 class ChromeURLDataManagerBackend { |
40 public: | 33 public: |
41 typedef int RequestID; | 34 typedef int RequestID; |
42 | 35 |
43 ChromeURLDataManagerBackend(); | 36 ChromeURLDataManagerBackend(); |
44 ~ChromeURLDataManagerBackend(); | 37 ~ChromeURLDataManagerBackend(); |
45 | 38 |
46 // Invoked to create the protocol handler for chrome://. | 39 // Invoked to create the protocol handler for chrome://. |
47 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( | 40 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( |
48 ChromeURLDataManagerBackend* backend, | 41 ChromeURLDataManagerBackend* backend); |
49 appcache::AppCacheService* appcache_service, | |
50 webkit_blob::BlobStorageController* blob_storage_controller); | |
51 | 42 |
52 // Adds a DataSource to the collection of data sources. | 43 // Adds a DataSource to the collection of data sources. |
53 void AddDataSource(ChromeURLDataManager::DataSource* source); | 44 void AddDataSource(ChromeURLDataManager::DataSource* source); |
54 | 45 |
55 // DataSource invokes this. Sends the data to the URLRequest. | 46 // DataSource invokes this. Sends the data to the URLRequest. |
56 void DataAvailable(RequestID request_id, RefCountedMemory* bytes); | 47 void DataAvailable(RequestID request_id, RefCountedMemory* bytes); |
57 | 48 |
58 static net::URLRequestJob* Factory(net::URLRequest* request, | 49 static net::URLRequestJob* Factory(net::URLRequest* request, |
59 const std::string& scheme); | 50 const std::string& scheme); |
60 | 51 |
(...skipping 27 matching lines...) Expand all Loading... |
88 // The ID we'll use for the next request we receive. | 79 // The ID we'll use for the next request we receive. |
89 RequestID next_request_id_; | 80 RequestID next_request_id_; |
90 | 81 |
91 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerBackend); | 82 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerBackend); |
92 }; | 83 }; |
93 | 84 |
94 net::URLRequestJobFactory::ProtocolHandler* | 85 net::URLRequestJobFactory::ProtocolHandler* |
95 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend); | 86 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend); |
96 | 87 |
97 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ | 88 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ |
OLD | NEW |