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" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "content/browser/resource_context.h" | 20 #include "content/browser/resource_context.h" |
21 #include "net/base/cookie_monster.h" | 21 #include "net/base/cookie_monster.h" |
22 | 22 |
23 class CommandLine; | 23 class CommandLine; |
24 class ChromeAppCacheService; | 24 class ChromeAppCacheService; |
25 class ChromeBlobStorageContext; | 25 class ChromeBlobStorageContext; |
26 class DesktopNotificationService; | |
26 class ExtensionInfoMap; | 27 class ExtensionInfoMap; |
28 class HostContentSettingsMap; | |
29 class HostZoomMap; | |
30 class IOThread; | |
31 class ProtocolHandlerRegistry; | |
32 | |
27 namespace fileapi { | 33 namespace fileapi { |
28 class FileSystemContext; | 34 class FileSystemContext; |
29 } // namespace fileapi | 35 } // namespace fileapi |
30 class HostContentSettingsMap; | 36 |
31 class HostZoomMap; | |
32 class IOThread; | |
33 namespace net { | 37 namespace net { |
34 class DnsCertProvenanceChecker; | 38 class DnsCertProvenanceChecker; |
35 class NetLog; | 39 class NetLog; |
36 class ProxyConfigService; | 40 class ProxyConfigService; |
37 class ProxyService; | 41 class ProxyService; |
38 class SSLConfigService; | 42 class SSLConfigService; |
39 class TransportSecurityState; | 43 class TransportSecurityState; |
40 } // namespace net | 44 } // namespace net |
45 | |
41 namespace prerender { | 46 namespace prerender { |
42 class PrerenderManager; | 47 class PrerenderManager; |
43 }; // namespace prerender | 48 }; // namespace prerender |
44 class ProtocolHandlerRegistry; | 49 |
45 namespace quota { | 50 namespace quota { |
46 class QuotaManager; | 51 class QuotaManager; |
47 }; // namespace quota | 52 }; // namespace quota |
53 | |
48 namespace webkit_database { | 54 namespace webkit_database { |
49 class DatabaseTracker; | 55 class DatabaseTracker; |
50 } // webkit_database | 56 } // webkit_database |
51 | 57 |
52 // Conceptually speaking, the ProfileIOData represents data that lives on the IO | 58 // Conceptually speaking, the ProfileIOData represents data that lives on the IO |
53 // thread that is owned by a Profile, such as, but not limited to, network | 59 // thread that is owned by a Profile, such as, but not limited to, network |
54 // objects like CookieMonster, HttpTransactionFactory, etc. The Profile | 60 // objects like CookieMonster, HttpTransactionFactory, etc. The Profile |
55 // implementation will maintain a reference to the ProfileIOData. The | 61 // implementation will maintain a reference to the ProfileIOData. The |
56 // ProfileIOData will originally own a reference to the ChromeURLRequestContexts | 62 // ProfileIOData will originally own a reference to the ChromeURLRequestContexts |
57 // that reference its members. When an accessor for a ChromeURLRequestContext is | 63 // that reference its members. When an accessor for a ChromeURLRequestContext is |
(...skipping 21 matching lines...) Expand all Loading... | |
79 scoped_refptr<ChromeURLRequestContext> GetMediaRequestContext() const; | 85 scoped_refptr<ChromeURLRequestContext> GetMediaRequestContext() const; |
80 scoped_refptr<ChromeURLRequestContext> GetExtensionsRequestContext() const; | 86 scoped_refptr<ChromeURLRequestContext> GetExtensionsRequestContext() const; |
81 scoped_refptr<ChromeURLRequestContext> GetIsolatedAppRequestContext( | 87 scoped_refptr<ChromeURLRequestContext> GetIsolatedAppRequestContext( |
82 scoped_refptr<ChromeURLRequestContext> main_context, | 88 scoped_refptr<ChromeURLRequestContext> main_context, |
83 const std::string& app_id) const; | 89 const std::string& app_id) const; |
84 const content::ResourceContext& GetResourceContext() const; | 90 const content::ResourceContext& GetResourceContext() const; |
85 | 91 |
86 // These are useful when the Chrome layer is called from the content layer | 92 // These are useful when the Chrome layer is called from the content layer |
87 // with a content::ResourceContext, and they want access to Chrome data for | 93 // with a content::ResourceContext, and they want access to Chrome data for |
88 // that profile. | 94 // that profile. |
95 ExtensionInfoMap* GetExtensionInfoMap() const; | |
89 HostContentSettingsMap* GetHostContentSettingsMap() const; | 96 HostContentSettingsMap* GetHostContentSettingsMap() const; |
97 DesktopNotificationService* GetNotificationService() const; | |
90 | 98 |
91 protected: | 99 protected: |
92 friend class base::RefCountedThreadSafe<ProfileIOData>; | 100 friend class base::RefCountedThreadSafe<ProfileIOData>; |
93 | 101 |
94 class RequestContext : public ChromeURLRequestContext { | 102 class RequestContext : public ChromeURLRequestContext { |
95 public: | 103 public: |
96 RequestContext(); | 104 RequestContext(); |
97 virtual ~RequestContext(); | 105 virtual ~RequestContext(); |
98 | 106 |
99 // Setter is used to transfer ownership of the ProfileIOData to the context. | 107 // Setter is used to transfer ownership of the ProfileIOData to the context. |
(...skipping 21 matching lines...) Expand all Loading... | |
121 scoped_refptr<HostZoomMap> host_zoom_map; | 129 scoped_refptr<HostZoomMap> host_zoom_map; |
122 scoped_refptr<net::TransportSecurityState> transport_security_state; | 130 scoped_refptr<net::TransportSecurityState> transport_security_state; |
123 scoped_refptr<net::SSLConfigService> ssl_config_service; | 131 scoped_refptr<net::SSLConfigService> ssl_config_service; |
124 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; | 132 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; |
125 scoped_refptr<webkit_database::DatabaseTracker> database_tracker; | 133 scoped_refptr<webkit_database::DatabaseTracker> database_tracker; |
126 scoped_refptr<ChromeAppCacheService> appcache_service; | 134 scoped_refptr<ChromeAppCacheService> appcache_service; |
127 scoped_refptr<ChromeBlobStorageContext> blob_storage_context; | 135 scoped_refptr<ChromeBlobStorageContext> blob_storage_context; |
128 scoped_refptr<fileapi::FileSystemContext> file_system_context; | 136 scoped_refptr<fileapi::FileSystemContext> file_system_context; |
129 scoped_refptr<quota::QuotaManager> quota_manager; | 137 scoped_refptr<quota::QuotaManager> quota_manager; |
130 scoped_refptr<ExtensionInfoMap> extension_info_map; | 138 scoped_refptr<ExtensionInfoMap> extension_info_map; |
139 DesktopNotificationService* notification_service; | |
131 base::WeakPtr<prerender::PrerenderManager> prerender_manager; | 140 base::WeakPtr<prerender::PrerenderManager> prerender_manager; |
132 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; | 141 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; |
133 // We need to initialize the ProxyConfigService from the UI thread | 142 // We need to initialize the ProxyConfigService from the UI thread |
134 // because on linux it relies on initializing things through gconf, | 143 // because on linux it relies on initializing things through gconf, |
135 // and needs to be on the main thread. | 144 // and needs to be on the main thread. |
136 scoped_ptr<net::ProxyConfigService> proxy_config_service; | 145 scoped_ptr<net::ProxyConfigService> proxy_config_service; |
137 // The profile this struct was populated from. | 146 // The profile this struct was populated from. |
138 ProfileId profile_id; | 147 ProfileId profile_id; |
139 }; | 148 }; |
140 | 149 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 | 249 |
241 // Pointed to by ResourceContext. | 250 // Pointed to by ResourceContext. |
242 mutable scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 251 mutable scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
243 mutable scoped_refptr<ChromeAppCacheService> appcache_service_; | 252 mutable scoped_refptr<ChromeAppCacheService> appcache_service_; |
244 mutable scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 253 mutable scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
245 mutable scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 254 mutable scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
246 mutable scoped_refptr<quota::QuotaManager> quota_manager_; | 255 mutable scoped_refptr<quota::QuotaManager> quota_manager_; |
247 mutable scoped_refptr<HostZoomMap> host_zoom_map_; | 256 mutable scoped_refptr<HostZoomMap> host_zoom_map_; |
248 | 257 |
249 // TODO(willchan): Remove from ResourceContext. | 258 // TODO(willchan): Remove from ResourceContext. |
259 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; | |
250 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 260 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
251 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; | 261 mutable DesktopNotificationService* notification_service_; |
willchan no longer on Chromium
2011/06/28 09:08:40
Isn't this a bug? DesktopNotificationService is ow
| |
252 mutable base::WeakPtr<prerender::PrerenderManager> prerender_manager_; | 262 mutable base::WeakPtr<prerender::PrerenderManager> prerender_manager_; |
253 | 263 |
254 mutable ResourceContext resource_context_; | 264 mutable ResourceContext resource_context_; |
255 | 265 |
256 // These are only valid in between LazyInitialize() and their accessor being | 266 // These are only valid in between LazyInitialize() and their accessor being |
257 // called. | 267 // called. |
258 mutable scoped_refptr<RequestContext> main_request_context_; | 268 mutable scoped_refptr<RequestContext> main_request_context_; |
259 mutable scoped_refptr<RequestContext> extensions_request_context_; | 269 mutable scoped_refptr<RequestContext> extensions_request_context_; |
260 | 270 |
261 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 271 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
262 }; | 272 }; |
263 | 273 |
264 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 274 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |