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