summaryrefslogtreecommitdiffstats
path: root/content/public
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-21 03:57:42 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-21 03:57:42 +0000
commit314c3e2d86a4595db7b1ab02b2acd4decf21d65f (patch)
tree593431d4dad2fa3c944d8e8f97da3f6fc56140f6 /content/public
parentc537090136d23d0064488c27de3bb2ba0f1ac120 (diff)
downloadchromium_src-314c3e2d86a4595db7b1ab02b2acd4decf21d65f.zip
chromium_src-314c3e2d86a4595db7b1ab02b2acd4decf21d65f.tar.gz
chromium_src-314c3e2d86a4595db7b1ab02b2acd4decf21d65f.tar.bz2
Remove getters for HTML5 related objects from the ResourceContext interface. Half of them weren't used by chrome, so they can be hidden from chrome. The rest were accessed by chrome, but we don't need every embedder to store this data on their ResourceContext implementation. Instead have content associate the data itself to simplify the work for embedders.
BUG=98716 Review URL: https://chromiumcodereview.appspot.com/9425026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r--content/public/browser/browser_context.h17
-rw-r--r--content/public/browser/resource_context.h44
2 files changed, 36 insertions, 25 deletions
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h
index dd00b4a..7a5e2e5 100644
--- a/content/public/browser/browser_context.h
+++ b/content/public/browser/browser_context.h
@@ -10,6 +10,10 @@
#include "base/supports_user_data.h"
#include "content/common/content_export.h"
+namespace appcache {
+class AppCacheService;
+}
+
namespace fileapi {
class FileSystemContext;
}
@@ -27,8 +31,6 @@ namespace webkit_database {
class DatabaseTracker;
}
-class ChromeAppCacheService;
-class ChromeBlobStorageContext;
class FilePath;
class WebKitContext;
@@ -49,12 +51,17 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
static WebKitContext* GetWebKitContext(BrowserContext* browser_context);
static webkit_database::DatabaseTracker* GetDatabaseTracker(
BrowserContext* browser_context);
- static ChromeAppCacheService* GetAppCacheService(
+ static appcache::AppCacheService* GetAppCacheService(
BrowserContext* browser_context);
static fileapi::FileSystemContext* GetFileSystemContext(
BrowserContext* browser_context);
- static ChromeBlobStorageContext* GetBlobStorageContext(
- BrowserContext* browser_context);
+
+ // Ensures that the corresponding ResourceContext is initialized. Normally the
+ // BrowserContext initializs the corresponding getters when its objects are
+ // created, but if the embedder wants to pass the ResourceContext to another
+ // thread before they use BrowserContext, they should call this to make sure
+ // that the ResourceContext is ready.
+ static void EnsureResourceContextInitialized(BrowserContext* browser_context);
virtual ~BrowserContext();
diff --git a/content/public/browser/resource_context.h b/content/public/browser/resource_context.h
index 7ad6097..94b36fc 100644
--- a/content/public/browser/resource_context.h
+++ b/content/public/browser/resource_context.h
@@ -6,28 +6,32 @@
#define CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_
#include "base/basictypes.h"
+#include "base/supports_user_data.h"
+#include "content/common/content_export.h"
class AudioManager;
-class ChromeAppCacheService;
-class ChromeBlobStorageContext;
class MediaObserver;
-class WebKitContext;
+
+namespace appcache {
+class AppCacheService;
+}
+
namespace fileapi {
class FileSystemContext;
-} // namespace fileapi
+}
+
namespace media_stream {
class MediaStreamManager;
-} // namespace media_stream
+}
+
namespace net {
class HostResolver;
class URLRequestContext;
-} // namespace net
-namespace quota {
-class QuotaManager;
-}; // namespace quota
-namespace webkit_database {
-class DatabaseTracker;
-} // namespace webkit_database
+}
+
+namespace webkit_blob {
+class BlobStorageController;
+}
namespace content {
@@ -36,22 +40,22 @@ class HostZoomMap;
// ResourceContext contains the relevant context information required for
// resource loading. It lives on the IO thread, although it is constructed on
// the UI thread.
-class ResourceContext {
+class CONTENT_EXPORT ResourceContext : public base::SupportsUserData {
public:
- virtual ~ResourceContext() {}
+ static appcache::AppCacheService* GetAppCacheService(
+ ResourceContext* resource_context);
+ static fileapi::FileSystemContext* GetFileSystemContext(
+ ResourceContext* resource_context);
+ static webkit_blob::BlobStorageController* GetBlobStorageController(
+ ResourceContext* resource_context);
+ virtual ~ResourceContext() {}
virtual net::HostResolver* GetHostResolver() = 0;
virtual net::URLRequestContext* GetRequestContext() = 0;
- virtual ChromeAppCacheService* GetAppCacheService() = 0;
- virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0;
- virtual fileapi::FileSystemContext* GetFileSystemContext() = 0;
- virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0;
- virtual quota::QuotaManager* GetQuotaManager() = 0;
virtual HostZoomMap* GetHostZoomMap() = 0;
virtual MediaObserver* GetMediaObserver() = 0;
virtual media_stream::MediaStreamManager* GetMediaStreamManager() = 0;
virtual AudioManager* GetAudioManager() = 0;
- virtual WebKitContext* GetWebKitContext() = 0;
};
} // namespace content