| 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_PROFILES_PROFILE_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/debug/stack_trace.h" | 11 #include "base/debug/stack_trace.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "chrome/browser/net/chrome_url_request_context.h" | 17 #include "chrome/browser/net/chrome_url_request_context.h" |
| 18 #include "chrome/browser/prefs/pref_member.h" | 18 #include "chrome/browser/prefs/pref_member.h" |
| 19 #include "chrome/browser/profiles/profile.h" | |
| 20 #include "content/browser/resource_context.h" | 19 #include "content/browser/resource_context.h" |
| 21 #include "net/base/cookie_monster.h" | 20 #include "net/base/cookie_monster.h" |
| 22 | 21 |
| 23 class CommandLine; | 22 class CommandLine; |
| 24 class ChromeAppCacheService; | 23 class ChromeAppCacheService; |
| 25 class ChromeBlobStorageContext; | 24 class ChromeBlobStorageContext; |
| 26 class DesktopNotificationService; | 25 class DesktopNotificationService; |
| 27 class ExtensionInfoMap; | 26 class ExtensionInfoMap; |
| 28 class HostContentSettingsMap; | 27 class HostContentSettingsMap; |
| 29 class HostZoomMap; | 28 class HostZoomMap; |
| 30 class IOThread; | 29 class IOThread; |
| 30 class Profile; |
| 31 class ProtocolHandlerRegistry; | 31 class ProtocolHandlerRegistry; |
| 32 | 32 |
| 33 namespace fileapi { | 33 namespace fileapi { |
| 34 class FileSystemContext; | 34 class FileSystemContext; |
| 35 } // namespace fileapi | 35 } // namespace fileapi |
| 36 | 36 |
| 37 namespace net { | 37 namespace net { |
| 38 class CookieStore; | 38 class CookieStore; |
| 39 class DnsCertProvenanceChecker; | 39 class DnsCertProvenanceChecker; |
| 40 class HttpTransactionFactory; | 40 class HttpTransactionFactory; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 scoped_refptr<fileapi::FileSystemContext> file_system_context; | 163 scoped_refptr<fileapi::FileSystemContext> file_system_context; |
| 164 scoped_refptr<quota::QuotaManager> quota_manager; | 164 scoped_refptr<quota::QuotaManager> quota_manager; |
| 165 scoped_refptr<ExtensionInfoMap> extension_info_map; | 165 scoped_refptr<ExtensionInfoMap> extension_info_map; |
| 166 DesktopNotificationService* notification_service; | 166 DesktopNotificationService* notification_service; |
| 167 base::WeakPtr<prerender::PrerenderManager> prerender_manager; | 167 base::WeakPtr<prerender::PrerenderManager> prerender_manager; |
| 168 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; | 168 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; |
| 169 // We need to initialize the ProxyConfigService from the UI thread | 169 // We need to initialize the ProxyConfigService from the UI thread |
| 170 // because on linux it relies on initializing things through gconf, | 170 // because on linux it relies on initializing things through gconf, |
| 171 // and needs to be on the main thread. | 171 // and needs to be on the main thread. |
| 172 scoped_ptr<net::ProxyConfigService> proxy_config_service; | 172 scoped_ptr<net::ProxyConfigService> proxy_config_service; |
| 173 // The profile this struct was populated from. | 173 // The profile this struct was populated from. It's passed as a void* to |
| 174 ProfileId profile_id; | 174 // ensure it's not accidently used on the IO thread. Before using it on the |
| 175 // UI thread, call ProfileManager::IsValidProfile to ensure it's alive. |
| 176 void* profile; |
| 175 }; | 177 }; |
| 176 | 178 |
| 177 explicit ProfileIOData(bool is_incognito); | 179 explicit ProfileIOData(bool is_incognito); |
| 178 virtual ~ProfileIOData(); | 180 virtual ~ProfileIOData(); |
| 179 | 181 |
| 180 void InitializeProfileParams(Profile* profile); | 182 void InitializeProfileParams(Profile* profile); |
| 181 void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const; | 183 void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const; |
| 182 | 184 |
| 183 // Lazy initializes the ProfileIOData object the first time a request context | 185 // Lazy initializes the ProfileIOData object the first time a request context |
| 184 // is requested. The lazy logic is implemented here. The actual initialization | 186 // is requested. The lazy logic is implemented here. The actual initialization |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Weak pointers to the request contexts. Only valid after LazyInitialize. | 302 // Weak pointers to the request contexts. Only valid after LazyInitialize. |
| 301 // These are weak so that they don't hold a reference to the RequestContext, | 303 // These are weak so that they don't hold a reference to the RequestContext, |
| 302 // because that holds a reference back to ProfileIOData. | 304 // because that holds a reference back to ProfileIOData. |
| 303 mutable base::WeakPtr<ChromeURLRequestContext> | 305 mutable base::WeakPtr<ChromeURLRequestContext> |
| 304 weak_extensions_request_context_; | 306 weak_extensions_request_context_; |
| 305 | 307 |
| 306 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 308 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 307 }; | 309 }; |
| 308 | 310 |
| 309 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 311 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |