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