Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/browser/profiles/profile_io_data.h

Issue 10736066: Adding histograms showing fraction of page load times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.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/io_thread.h"
17 #include "chrome/browser/net/chrome_url_request_context.h" 18 #include "chrome/browser/net/chrome_url_request_context.h"
18 #include "chrome/browser/prefs/pref_member.h" 19 #include "chrome/browser/prefs/pref_member.h"
19 #include "content/public/browser/resource_context.h" 20 #include "content/public/browser/resource_context.h"
20 #include "net/cookies/cookie_monster.h" 21 #include "net/cookies/cookie_monster.h"
21 #include "net/url_request/url_request_job_factory.h" 22 #include "net/url_request/url_request_job_factory.h"
22 23
23 class CookieSettings; 24 class CookieSettings;
24 class DesktopNotificationService; 25 class DesktopNotificationService;
25 class ExtensionInfoMap; 26 class ExtensionInfoMap;
26 class HostContentSettingsMap; 27 class HostContentSettingsMap;
27 class IOThread;
28 class Profile; 28 class Profile;
29 class ProtocolHandlerRegistry; 29 class ProtocolHandlerRegistry;
30 class TransportSecurityPersister; 30 class TransportSecurityPersister;
31 31
32 namespace chrome_browser_net { 32 namespace chrome_browser_net {
33 class CacheStats;
33 class HttpServerPropertiesManager; 34 class HttpServerPropertiesManager;
34 class ResourcePrefetchPredictorObserver; 35 class ResourcePrefetchPredictorObserver;
35 } 36 }
36 37
37 namespace net { 38 namespace net {
38 class CookieStore; 39 class CookieStore;
39 class FraudulentCertificateReporter; 40 class FraudulentCertificateReporter;
40 class HttpTransactionFactory; 41 class HttpTransactionFactory;
41 class ServerBoundCertService; 42 class ServerBoundCertService;
42 class ProxyConfigService; 43 class ProxyConfigService;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void InitializeMetricsEnabledStateOnUIThread(); 126 void InitializeMetricsEnabledStateOnUIThread();
126 127
127 // Returns whether or not metrics reporting is enabled in the browser instance 128 // Returns whether or not metrics reporting is enabled in the browser instance
128 // on which this profile resides. This is safe for use from the IO thread, and 129 // on which this profile resides. This is safe for use from the IO thread, and
129 // should only be called from there. 130 // should only be called from there.
130 bool GetMetricsEnabledStateOnIOThread() const; 131 bool GetMetricsEnabledStateOnIOThread() const;
131 132
132 protected: 133 protected:
133 class AppRequestContext : public ChromeURLRequestContext { 134 class AppRequestContext : public ChromeURLRequestContext {
134 public: 135 public:
135 AppRequestContext(); 136 explicit AppRequestContext(chrome_browser_net::CacheStats* cache_stats);
136 137
137 void SetCookieStore(net::CookieStore* cookie_store); 138 void SetCookieStore(net::CookieStore* cookie_store);
138 void SetHttpTransactionFactory(net::HttpTransactionFactory* http_factory); 139 void SetHttpTransactionFactory(net::HttpTransactionFactory* http_factory);
139 140
140 private: 141 private:
141 virtual ~AppRequestContext(); 142 virtual ~AppRequestContext();
142 143
143 scoped_refptr<net::CookieStore> cookie_store_; 144 scoped_refptr<net::CookieStore> cookie_store_;
144 scoped_ptr<net::HttpTransactionFactory> http_factory_; 145 scoped_ptr<net::HttpTransactionFactory> http_factory_;
145 }; 146 };
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return proxy_service_.get(); 229 return proxy_service_.get();
229 } 230 }
230 231
231 void set_http_server_properties_manager( 232 void set_http_server_properties_manager(
232 chrome_browser_net::HttpServerPropertiesManager* manager) const; 233 chrome_browser_net::HttpServerPropertiesManager* manager) const;
233 234
234 ChromeURLRequestContext* main_request_context() const { 235 ChromeURLRequestContext* main_request_context() const {
235 return main_request_context_.get(); 236 return main_request_context_.get();
236 } 237 }
237 238
239 chrome_browser_net::CacheStats* cache_stats() const {
240 return cache_stats_;
241 }
242
238 // Destroys the ResourceContext first, to cancel any URLRequests that are 243 // Destroys the ResourceContext first, to cancel any URLRequests that are
239 // using it still, before we destroy the member variables that those 244 // using it still, before we destroy the member variables that those
240 // URLRequests may be accessing. 245 // URLRequests may be accessing.
241 void DestroyResourceContext(); 246 void DestroyResourceContext();
242 247
243 private: 248 private:
244 class ResourceContext : public content::ResourceContext { 249 class ResourceContext : public content::ResourceContext {
245 public: 250 public:
246 explicit ResourceContext(ProfileIOData* io_data); 251 explicit ResourceContext(ProfileIOData* io_data);
247 virtual ~ResourceContext(); 252 virtual ~ResourceContext();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 285
281 // These functions are used to transfer ownership of the lazily initialized 286 // These functions are used to transfer ownership of the lazily initialized
282 // context from ProfileIOData to the URLRequestContextGetter. 287 // context from ProfileIOData to the URLRequestContextGetter.
283 virtual ChromeURLRequestContext* 288 virtual ChromeURLRequestContext*
284 AcquireMediaRequestContext() const = 0; 289 AcquireMediaRequestContext() const = 0;
285 virtual ChromeURLRequestContext* 290 virtual ChromeURLRequestContext*
286 AcquireIsolatedAppRequestContext( 291 AcquireIsolatedAppRequestContext(
287 ChromeURLRequestContext* main_context, 292 ChromeURLRequestContext* main_context,
288 const std::string& app_id) const = 0; 293 const std::string& app_id) const = 0;
289 294
295 // Returns the CacheStats object to be used for this profile.
296 virtual chrome_browser_net::CacheStats* GetCacheStats(
297 IOThread::Globals* io_thread_globals) const = 0;
298
290 // The order *DOES* matter for the majority of these member variables, so 299 // The order *DOES* matter for the majority of these member variables, so
291 // don't move them around unless you know what you're doing! 300 // don't move them around unless you know what you're doing!
292 // General rules: 301 // General rules:
293 // * ResourceContext references the URLRequestContexts, so 302 // * ResourceContext references the URLRequestContexts, so
294 // URLRequestContexts must outlive ResourceContext, hence ResourceContext 303 // URLRequestContexts must outlive ResourceContext, hence ResourceContext
295 // should be destroyed first. 304 // should be destroyed first.
296 // * URLRequestContexts reference a whole bunch of members, so 305 // * URLRequestContexts reference a whole bunch of members, so
297 // URLRequestContext needs to be destroyed before them. 306 // URLRequestContext needs to be destroyed before them.
298 // * Therefore, ResourceContext should be listed last, and then the 307 // * Therefore, ResourceContext should be listed last, and then the
299 // URLRequestContexts, and then the URLRequestContext members. 308 // URLRequestContexts, and then the URLRequestContext members.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 mutable AppRequestContextMap app_request_context_map_; 361 mutable AppRequestContextMap app_request_context_map_;
353 362
354 mutable scoped_ptr<ResourceContext> resource_context_; 363 mutable scoped_ptr<ResourceContext> resource_context_;
355 364
356 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_; 365 mutable scoped_refptr<ExtensionInfoMap> extension_info_map_;
357 mutable scoped_refptr<CookieSettings> cookie_settings_; 366 mutable scoped_refptr<CookieSettings> cookie_settings_;
358 367
359 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> 368 mutable scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver>
360 resource_prefetch_predictor_observer_; 369 resource_prefetch_predictor_observer_;
361 370
371 mutable chrome_browser_net::CacheStats* cache_stats_;
372
362 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 373 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
363 bool initialized_on_UI_thread_; 374 bool initialized_on_UI_thread_;
364 375
365 bool is_incognito_; 376 bool is_incognito_;
366 377
367 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); 378 DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
368 }; 379 };
369 380
370 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ 381 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698