Chromium Code Reviews| 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_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 15 #include "chrome/browser/extensions/extension_info_map.h" | 15 #include "chrome/browser/extensions/extension_info_map.h" |
| 16 #include "chrome/browser/extensions/extension_webrequest_api.h" | 16 #include "chrome/browser/extensions/extension_webrequest_api.h" |
| 17 #include "chrome/browser/prefs/pref_change_registrar.h" | 17 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
| 19 #include "chrome/browser/prerender/prerender_manager.h" | 19 #include "chrome/browser/prerender/prerender_manager.h" |
| 20 #include "chrome/common/extensions/extension.h" | |
| 20 #include "chrome/common/extensions/extension_icon_set.h" | 21 #include "chrome/common/extensions/extension_icon_set.h" |
| 21 #include "chrome/common/net/url_request_context_getter.h" | 22 #include "chrome/common/net/url_request_context_getter.h" |
| 22 #include "content/browser/appcache/chrome_appcache_service.h" | 23 #include "content/browser/appcache/chrome_appcache_service.h" |
| 23 #include "content/browser/chrome_blob_storage_context.h" | 24 #include "content/browser/chrome_blob_storage_context.h" |
| 24 #include "content/browser/host_zoom_map.h" | 25 #include "content/browser/host_zoom_map.h" |
| 25 #include "net/base/cookie_policy.h" | 26 #include "net/base/cookie_policy.h" |
| 26 #include "net/url_request/url_request_context.h" | 27 #include "net/url_request/url_request_context.h" |
| 27 #include "webkit/database/database_tracker.h" | 28 #include "webkit/database/database_tracker.h" |
| 28 #include "webkit/fileapi/file_system_context.h" | 29 #include "webkit/fileapi/file_system_context.h" |
| 29 | 30 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 // get called on UI thread. This method takes a profile and reuses the | 216 // get called on UI thread. This method takes a profile and reuses the |
| 216 // 'original' net::URLRequestContext for common files. | 217 // 'original' net::URLRequestContext for common files. |
| 217 static ChromeURLRequestContextGetter* CreateOriginalForMedia( | 218 static ChromeURLRequestContextGetter* CreateOriginalForMedia( |
| 218 Profile* profile, const ProfileIOData* profile_io_data); | 219 Profile* profile, const ProfileIOData* profile_io_data); |
| 219 | 220 |
| 220 // Create an instance for an original profile for extensions. This is expected | 221 // Create an instance for an original profile for extensions. This is expected |
| 221 // to get called on UI thread. | 222 // to get called on UI thread. |
| 222 static ChromeURLRequestContextGetter* CreateOriginalForExtensions( | 223 static ChromeURLRequestContextGetter* CreateOriginalForExtensions( |
| 223 Profile* profile, const ProfileIOData* profile_io_data); | 224 Profile* profile, const ProfileIOData* profile_io_data); |
| 224 | 225 |
| 226 // Create an instance for an original profile for an app with isolated | |
| 227 // storage. This is expected to get called on UI thread. | |
| 228 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp( | |
|
willchan no longer on Chromium
2011/03/01 23:39:24
http://dev.chromium.org/developers/coding-style#Co
Charlie Reis
2011/03/03 01:08:05
Done. Ditto for below.
| |
| 229 Profile* profile, const ProfileIOData* profile_io_data, | |
| 230 const Extension* installed_app); | |
| 231 | |
| 225 // Create an instance for use with an OTR profile. This is expected to get | 232 // Create an instance for use with an OTR profile. This is expected to get |
| 226 // called on the UI thread. | 233 // called on the UI thread. |
| 227 static ChromeURLRequestContextGetter* CreateOffTheRecord( | 234 static ChromeURLRequestContextGetter* CreateOffTheRecord( |
| 228 Profile* profile, const ProfileIOData* profile_io_data); | 235 Profile* profile, const ProfileIOData* profile_io_data); |
| 229 | 236 |
| 230 // Create an instance for an OTR profile for extensions. This is expected | 237 // Create an instance for an OTR profile for extensions. This is expected |
| 231 // to get called on UI thread. | 238 // to get called on UI thread. |
| 232 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions( | 239 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions( |
| 233 Profile* profile, const ProfileIOData* profile_io_data); | 240 Profile* profile, const ProfileIOData* profile_io_data); |
| 234 | 241 |
| 242 // Create an instance for an OTR profile for an app with isolated storage. | |
| 243 // This is expected to get called on UI thread. | |
| 244 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp( | |
| 245 Profile* profile, const ProfileIOData* profile_io_data, | |
| 246 const Extension* installed_app); | |
| 247 | |
| 235 // Clean up UI thread resources. This is expected to get called on the UI | 248 // Clean up UI thread resources. This is expected to get called on the UI |
| 236 // thread before the instance is deleted on the IO thread. | 249 // thread before the instance is deleted on the IO thread. |
| 237 void CleanupOnUIThread(); | 250 void CleanupOnUIThread(); |
| 238 | 251 |
| 239 // NotificationObserver implementation. | 252 // NotificationObserver implementation. |
| 240 virtual void Observe(NotificationType type, | 253 virtual void Observe(NotificationType type, |
| 241 const NotificationSource& source, | 254 const NotificationSource& source, |
| 242 const NotificationDetails& details); | 255 const NotificationDetails& details); |
| 243 | 256 |
| 244 private: | 257 private: |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 271 | 284 |
| 272 // NULL if not yet initialized. Otherwise, it is the net::URLRequestContext | 285 // NULL if not yet initialized. Otherwise, it is the net::URLRequestContext |
| 273 // instance that was lazilly created by GetURLRequestContext. | 286 // instance that was lazilly created by GetURLRequestContext. |
| 274 // Access only from the IO thread. | 287 // Access only from the IO thread. |
| 275 scoped_refptr<net::URLRequestContext> url_request_context_; | 288 scoped_refptr<net::URLRequestContext> url_request_context_; |
| 276 | 289 |
| 277 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); | 290 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); |
| 278 }; | 291 }; |
| 279 | 292 |
| 280 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 293 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |