summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/browser_context.cc6
-rw-r--r--content/browser/resource_context_impl.cc7
-rw-r--r--content/browser/resource_context_impl.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index d56e797..cabf7a2 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -79,7 +79,7 @@ void CreateQuotaManagerAndClients(BrowserContext* context) {
kAppCacheServicKeyName,
new UserDataAdapter<ChromeAppCacheService>(appcache_service));
- InitializeResourceContext(context);
+ EnsureResourceContextInitialized(context);
// Check first to avoid memory leak in unittests.
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
@@ -125,9 +125,7 @@ FileSystemContext* BrowserContext::GetFileSystemContext(
}
void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) {
- if (context->GetResourceContext()->GetUserData(kWebKitContextKeyName))
- return;
- InitializeResourceContext(context);
+ content::EnsureResourceContextInitialized(context);
}
BrowserContext::~BrowserContext() {
diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc
index 525a10a..8a2adfb3 100644
--- a/content/browser/resource_context_impl.cc
+++ b/content/browser/resource_context_impl.cc
@@ -79,9 +79,12 @@ HostZoomMap* GetHostZoomMapForResourceContext(ResourceContext* context) {
context->GetUserData(kHostZoomMapKeyName))->host_zoom_map();
}
-void InitializeResourceContext(BrowserContext* browser_context) {
+void EnsureResourceContextInitialized(BrowserContext* browser_context) {
ResourceContext* resource_context = browser_context->GetResourceContext();
- DCHECK(!resource_context->GetUserData(kWebKitContextKeyName));
+
+ if (resource_context->GetUserData(kWebKitContextKeyName))
+ return;
+
resource_context->SetUserData(
kWebKitContextKeyName,
new UserDataAdapter<WebKitContext>(
diff --git a/content/browser/resource_context_impl.h b/content/browser/resource_context_impl.h
index 6d914ac..984456a 100644
--- a/content/browser/resource_context_impl.h
+++ b/content/browser/resource_context_impl.h
@@ -31,7 +31,7 @@ ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext(
HostZoomMap* GetHostZoomMapForResourceContext(ResourceContext* context);
// Initialize the above data on the ResourceContext from a given BrowserContext.
-void InitializeResourceContext(BrowserContext* browser_context);
+void EnsureResourceContextInitialized(BrowserContext* browser_context);
} // namespace content