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

Unified Diff: chrome/browser/profiles/profile_io_data.h

Issue 6825038: Create a content::ResourceContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependencies. Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_io_data.h
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h
index bb1e049bc83159c91f6742b00dc882099c4e3cba..6f921de87741d208be9cb609bfb683f417ea9840 100644
--- a/chrome/browser/profiles/profile_io_data.h
+++ b/chrome/browser/profiles/profile_io_data.h
@@ -6,23 +6,25 @@
#define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_
#pragma once
+#include <set>
#include "base/basictypes.h"
+#include "base/debug/stack_trace.h"
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile.h"
+#include "content/browser/resource_context.h"
#include "net/base/cookie_monster.h"
class CommandLine;
class ChromeAppCacheService;
class ChromeBlobStorageContext;
-class ChromeURLRequestContext;
-class ChromeURLRequestContextGetter;
class ExtensionInfoMap;
namespace fileapi {
class FileSystemContext;
-}
+} // namespace fileapi
class HostContentSettingsMap;
class HostZoomMap;
class IOThread;
@@ -66,6 +68,7 @@ class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> {
scoped_refptr<ChromeURLRequestContext> GetIsolatedAppRequestContext(
scoped_refptr<ChromeURLRequestContext> main_context,
const std::string& app_id) const;
+ const content::ResourceContext& GetResourceContext() const;
protected:
friend class base::RefCountedThreadSafe<ProfileIOData>;
@@ -119,12 +122,20 @@ class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> {
explicit ProfileIOData(bool is_incognito);
virtual ~ProfileIOData();
- // Static helper functions to assist in common operations executed by
- // subtypes.
+ void InitializeProfileParams(Profile* profile);
+ void ApplyProfileParamsToContext(ChromeURLRequestContext* context) const;
- static void InitializeProfileParams(Profile* profile, ProfileParams* params);
- static void ApplyProfileParamsToContext(const ProfileParams& profile_params,
- ChromeURLRequestContext* context);
+ private:
+ class ResourceContext : public content::ResourceContext {
+ public:
+ explicit ResourceContext(const ProfileIOData* io_data);
+ virtual ~ResourceContext();
+
+ private:
+ virtual void EnsureInitialized() const;
+
+ const ProfileIOData* const io_data_;
+ };
// Lazy initializes the ProfileIOData object the first time a request context
// is requested. The lazy logic is implemented here. The actual initialization
@@ -138,7 +149,7 @@ class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> {
// Does the actual initialization of the ProfileIOData subtype. Subtypes
// should use the static helper functions above to implement this.
- virtual void LazyInitializeInternal() const = 0;
+ virtual void LazyInitializeInternal(ProfileParams* profile_params) const = 0;
// Does an on-demand initialization of a RequestContext for the given
// isolated app.
@@ -159,7 +170,10 @@ class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> {
scoped_refptr<ChromeURLRequestContext> main_context,
const std::string& app_id) const = 0;
+
mutable bool initialized_;
+ mutable scoped_ptr<ProfileParams> profile_params_;
+ mutable ResourceContext resource_context_;
DISALLOW_COPY_AND_ASSIGN(ProfileIOData);
};

Powered by Google App Engine
This is Rietveld 408576698