summaryrefslogtreecommitdiffstats
path: root/content/public
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-20 17:38:39 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-20 17:38:39 +0000
commit55eb70e76bd17909cc5202c5a9af3e1c886989e4 (patch)
tree9ea8a13b9f9e1ab0297ea0ff79093dc4c5ad20d0 /content/public
parent7edf30319847892be800a0127fee985a24050166 (diff)
downloadchromium_src-55eb70e76bd17909cc5202c5a9af3e1c886989e4.zip
chromium_src-55eb70e76bd17909cc5202c5a9af3e1c886989e4.tar.gz
chromium_src-55eb70e76bd17909cc5202c5a9af3e1c886989e4.tar.bz2
Move creation of BrowserContext objects that live in content to content, instead of depending on the embedder. Apart from allowing us to hide more of content from embedders, it simplifies the work that every embedder has to do (see the change the shell_browser_context.cc as an example).
BUG=98716 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=122521 Review URL: https://chromiumcodereview.appspot.com/9419033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122768 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r--content/public/browser/browser_context.cc10
-rw-r--r--content/public/browser/browser_context.h25
-rw-r--r--content/public/common/content_constants.cc4
-rw-r--r--content/public/common/content_constants.h5
4 files changed, 24 insertions, 20 deletions
diff --git a/content/public/browser/browser_context.cc b/content/public/browser/browser_context.cc
deleted file mode 100644
index b8f540f..0000000
--- a/content/public/browser/browser_context.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/public/browser/browser_context.h"
-
-namespace content {
-
-
-} // namespace content
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h
index 9618315..dd00b4a 100644
--- a/content/public/browser/browser_context.h
+++ b/content/public/browser/browser_context.h
@@ -20,6 +20,7 @@ class URLRequestContextGetter;
namespace quota {
class QuotaManager;
+class SpecialStoragePolicy;
}
namespace webkit_database {
@@ -43,7 +44,19 @@ class SpeechInputPreferences;
// It lives on the UI thread.
class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
public:
- virtual ~BrowserContext() {}
+ // Getter for the QuotaManager associated with the given BrowserContext.
+ static quota::QuotaManager* GetQuotaManager(BrowserContext* browser_context);
+ static WebKitContext* GetWebKitContext(BrowserContext* browser_context);
+ static webkit_database::DatabaseTracker* GetDatabaseTracker(
+ BrowserContext* browser_context);
+ static ChromeAppCacheService* GetAppCacheService(
+ BrowserContext* browser_context);
+ static fileapi::FileSystemContext* GetFileSystemContext(
+ BrowserContext* browser_context);
+ static ChromeBlobStorageContext* GetBlobStorageContext(
+ BrowserContext* browser_context);
+
+ virtual ~BrowserContext();
// Returns the path of the directory where this context's data is stored.
virtual FilePath GetPath() = 0;
@@ -90,14 +103,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
// This doesn't belong here; http://crbug.com/90737
virtual bool DidLastSessionExitCleanly() = 0;
- // The following getters return references to various storage related
- // contexts associated with this browser context.
- virtual quota::QuotaManager* GetQuotaManager() = 0;
- virtual WebKitContext* GetWebKitContext() = 0;
- virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0;
- virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0;
- virtual ChromeAppCacheService* GetAppCacheService() = 0;
- virtual fileapi::FileSystemContext* GetFileSystemContext() = 0;
+ // Returns a special storage policy implementation, or NULL.
+ virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0;
};
} // namespace content
diff --git a/content/public/common/content_constants.cc b/content/public/common/content_constants.cc
index 743622d5e..b0e3b58 100644
--- a/content/public/common/content_constants.cc
+++ b/content/public/common/content_constants.cc
@@ -3,9 +3,11 @@
// found in the LICENSE file.
#include "content/public/common/content_constants.h"
-
namespace content {
+const FilePath::CharType kAppCacheDirname[] =
+ FILE_PATH_LITERAL("Application Cache");
+
// This number used to be limited to 32 in the past (see b/535234).
const size_t kMaxRendererProcessCount = 82;
const int kMaxSessionHistoryEntries = 50;
diff --git a/content/public/common/content_constants.h b/content/public/common/content_constants.h
index a5e2c53..0df8b8b 100644
--- a/content/public/common/content_constants.h
+++ b/content/public/common/content_constants.h
@@ -10,10 +10,15 @@
#include <stddef.h> // For size_t
+#include "base/file_path.h"
#include "content/common/content_export.h"
namespace content {
+// The name of the directory under BrowserContext::GetPath where the AppCache is
+// put.
+CONTENT_EXPORT extern const FilePath::CharType kAppCacheDirname[];
+
CONTENT_EXPORT extern const size_t kMaxRendererProcessCount;
// The maximum number of session history entries per tab.