| 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 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // 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 |
| 33 // ignore this class. ChromeURLDataManagerBackend is owned by | 33 // ignore this class. ChromeURLDataManagerBackend is owned by |
| 34 // ChromeURLRequestContext. | 34 // ChromeURLRequestContext. |
| 35 class ChromeURLDataManagerBackend { | 35 class ChromeURLDataManagerBackend { |
| 36 public: | 36 public: |
| 37 typedef int RequestID; | 37 typedef int RequestID; |
| 38 | 38 |
| 39 ChromeURLDataManagerBackend(); | 39 ChromeURLDataManagerBackend(); |
| 40 ~ChromeURLDataManagerBackend(); | 40 ~ChromeURLDataManagerBackend(); |
| 41 | 41 |
| 42 // Invoked to create the protocol handler for chrome://. | 42 // Invoked to create the protocol handler for chrome://. |is_incognito| should |
| 43 // be set for incognito profiles. |
| 43 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( | 44 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( |
| 44 ChromeURLDataManagerBackend* backend); | 45 ChromeURLDataManagerBackend* backend, |
| 46 bool is_incognito); |
| 45 | 47 |
| 46 // Adds a DataSource to the collection of data sources. | 48 // Adds a DataSource to the collection of data sources. |
| 47 void AddDataSource(URLDataSourceImpl* source); | 49 void AddDataSource(URLDataSourceImpl* source); |
| 48 | 50 |
| 49 // DataSource invokes this. Sends the data to the URLRequest. | 51 // DataSource invokes this. Sends the data to the URLRequest. |
| 50 void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes); | 52 void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes); |
| 51 | 53 |
| 52 static net::URLRequestJob* Factory(net::URLRequest* request, | 54 static net::URLRequestJob* Factory(net::URLRequest* request, |
| 53 const std::string& scheme); | 55 const std::string& scheme); |
| 54 | 56 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // URLRequestChromeJob calls into this object when it's constructed and | 88 // URLRequestChromeJob calls into this object when it's constructed and |
| 87 // destructed to ensure that the pointers in this map remain valid. | 89 // destructed to ensure that the pointers in this map remain valid. |
| 88 PendingRequestMap pending_requests_; | 90 PendingRequestMap pending_requests_; |
| 89 | 91 |
| 90 // The ID we'll use for the next request we receive. | 92 // The ID we'll use for the next request we receive. |
| 91 RequestID next_request_id_; | 93 RequestID next_request_id_; |
| 92 | 94 |
| 93 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerBackend); | 95 DISALLOW_COPY_AND_ASSIGN(ChromeURLDataManagerBackend); |
| 94 }; | 96 }; |
| 95 | 97 |
| 98 // Creates protocol handler for chrome-devtools://. |is_incognito| should be |
| 99 // set for incognito profiles. |
| 96 net::URLRequestJobFactory::ProtocolHandler* | 100 net::URLRequestJobFactory::ProtocolHandler* |
| 97 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend, | 101 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend, |
| 98 net::NetworkDelegate* network_delegate); | 102 net::NetworkDelegate* network_delegate, |
| 103 bool is_incognito); |
| 99 | 104 |
| 100 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ | 105 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_BACKEND_H_ |
| OLD | NEW |