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/callback.h" | 11 #include "base/callback.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 "content/browser/resource_context.h" | 19 #include "content/browser/resource_context.h" |
20 #include "net/base/cookie_monster.h" | 20 #include "net/base/cookie_monster.h" |
| 21 #include "chrome/browser/download/download_manager.h" |
21 | 22 |
22 class CommandLine; | 23 class CommandLine; |
23 class ChromeAppCacheService; | 24 class ChromeAppCacheService; |
24 class ChromeBlobStorageContext; | 25 class ChromeBlobStorageContext; |
25 class DesktopNotificationService; | 26 class DesktopNotificationService; |
26 class ExtensionInfoMap; | 27 class ExtensionInfoMap; |
27 class HostContentSettingsMap; | 28 class HostContentSettingsMap; |
28 class HostZoomMap; | 29 class HostZoomMap; |
29 class IOThread; | 30 class IOThread; |
30 class Profile; | 31 class Profile; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 107 } |
107 | 108 |
108 ChromeURLRequestContext* extensions_request_context() const { | 109 ChromeURLRequestContext* extensions_request_context() const { |
109 return weak_extensions_request_context_.get(); | 110 return weak_extensions_request_context_.get(); |
110 } | 111 } |
111 | 112 |
112 BooleanPrefMember* safe_browsing_enabled() const { | 113 BooleanPrefMember* safe_browsing_enabled() const { |
113 return &safe_browsing_enabled_; | 114 return &safe_browsing_enabled_; |
114 } | 115 } |
115 | 116 |
| 117 const DownloadManager::GetNextIdThunkType& next_download_id_thunk() const { |
| 118 return next_download_id_thunk_; |
| 119 } |
| 120 |
116 protected: | 121 protected: |
117 friend class base::RefCountedThreadSafe<ProfileIOData>; | 122 friend class base::RefCountedThreadSafe<ProfileIOData>; |
118 | 123 |
119 class RequestContext : public ChromeURLRequestContext { | 124 class RequestContext : public ChromeURLRequestContext { |
120 public: | 125 public: |
121 RequestContext(); | 126 RequestContext(); |
122 virtual ~RequestContext(); | 127 virtual ~RequestContext(); |
123 | 128 |
124 // Setter is used to transfer ownership of the ProfileIOData to the context. | 129 // Setter is used to transfer ownership of the ProfileIOData to the context. |
125 void set_profile_io_data(ProfileIOData* profile_io_data) { | 130 void set_profile_io_data(ProfileIOData* profile_io_data) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 275 |
271 // Data from the UI thread from the Profile, used to initialize ProfileIOData. | 276 // Data from the UI thread from the Profile, used to initialize ProfileIOData. |
272 // Deleted after lazy initialization. | 277 // Deleted after lazy initialization. |
273 mutable scoped_ptr<ProfileParams> profile_params_; | 278 mutable scoped_ptr<ProfileParams> profile_params_; |
274 | 279 |
275 // Member variables which are pointed to by the various context objects. | 280 // Member variables which are pointed to by the various context objects. |
276 mutable BooleanPrefMember enable_referrers_; | 281 mutable BooleanPrefMember enable_referrers_; |
277 mutable BooleanPrefMember clear_local_state_on_exit_; | 282 mutable BooleanPrefMember clear_local_state_on_exit_; |
278 mutable BooleanPrefMember safe_browsing_enabled_; | 283 mutable BooleanPrefMember safe_browsing_enabled_; |
279 | 284 |
| 285 mutable DownloadManager::GetNextIdThunkType next_download_id_thunk_; |
| 286 |
280 // Pointed to by URLRequestContext. | 287 // Pointed to by URLRequestContext. |
281 mutable scoped_ptr<ChromeURLDataManagerBackend> | 288 mutable scoped_ptr<ChromeURLDataManagerBackend> |
282 chrome_url_data_manager_backend_; | 289 chrome_url_data_manager_backend_; |
283 mutable scoped_ptr<net::NetworkDelegate> network_delegate_; | 290 mutable scoped_ptr<net::NetworkDelegate> network_delegate_; |
284 mutable scoped_ptr<net::DnsCertProvenanceChecker> dns_cert_checker_; | 291 mutable scoped_ptr<net::DnsCertProvenanceChecker> dns_cert_checker_; |
285 mutable scoped_ptr<net::ProxyService> proxy_service_; | 292 mutable scoped_ptr<net::ProxyService> proxy_service_; |
286 mutable scoped_ptr<net::URLRequestJobFactory> job_factory_; | 293 mutable scoped_ptr<net::URLRequestJobFactory> job_factory_; |
287 | 294 |
288 // Pointed to by ResourceContext. | 295 // Pointed to by ResourceContext. |
289 mutable scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 296 mutable scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
(...skipping 22 matching lines...) Expand all Loading... |
312 // Weak pointers to the request contexts. Only valid after LazyInitialize. | 319 // Weak pointers to the request contexts. Only valid after LazyInitialize. |
313 // These are weak so that they don't hold a reference to the RequestContext, | 320 // These are weak so that they don't hold a reference to the RequestContext, |
314 // because that holds a reference back to ProfileIOData. | 321 // because that holds a reference back to ProfileIOData. |
315 mutable base::WeakPtr<ChromeURLRequestContext> | 322 mutable base::WeakPtr<ChromeURLRequestContext> |
316 weak_extensions_request_context_; | 323 weak_extensions_request_context_; |
317 | 324 |
318 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 325 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
319 }; | 326 }; |
320 | 327 |
321 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 328 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |