summaryrefslogtreecommitdiff
path: root/chromium/content/browser/browser_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/browser_context.cc')
-rw-r--r--chromium/content/browser/browser_context.cc55
1 files changed, 42 insertions, 13 deletions
diff --git a/chromium/content/browser/browser_context.cc b/chromium/content/browser/browser_context.cc
index dbc5949317a..76188331198 100644
--- a/chromium/content/browser/browser_context.cc
+++ b/chromium/content/browser/browser_context.cc
@@ -9,6 +9,7 @@
#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/indexed_db/indexed_db_context_impl.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
+#include "content/browser/push_messaging/push_messaging_router.h"
#include "content/browser/storage_partition_impl_map.h"
#include "content/common/child_process_host_impl.h"
#include "content/public/browser/blob_handle.h"
@@ -17,12 +18,12 @@
#include "content/public/browser/site_instance.h"
#include "net/cookies/cookie_monster.h"
#include "net/cookies/cookie_store.h"
-#include "net/ssl/server_bound_cert_service.h"
-#include "net/ssl/server_bound_cert_store.h"
+#include "net/ssl/channel_id_service.h"
+#include "net/ssl/channel_id_store.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
-#include "webkit/browser/database/database_tracker.h"
-#include "webkit/browser/fileapi/external_mount_points.h"
+#include "storage/browser/database/database_tracker.h"
+#include "storage/browser/fileapi/external_mount_points.h"
#endif // !OS_IOS
using base::UserDataAdapter;
@@ -69,11 +70,11 @@ StoragePartition* GetStoragePartitionFromConfig(
void SaveSessionStateOnIOThread(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
- appcache::AppCacheServiceImpl* appcache_service) {
+ AppCacheServiceImpl* appcache_service) {
net::URLRequestContext* context = context_getter->GetURLRequestContext();
context->cookie_store()->GetCookieMonster()->
SetForceKeepSessionState();
- context->server_bound_cert_service()->GetCertStore()->
+ context->channel_id_service()->GetChannelIDStore()->
SetForceKeepSessionState();
appcache_service->set_force_keep_session_state();
}
@@ -83,6 +84,13 @@ void SaveSessionStateOnIndexedDBThread(
indexed_db_context->SetForceKeepSessionState();
}
+void ShutdownServiceWorkerContext(StoragePartition* partition) {
+ ServiceWorkerContextWrapper* wrapper =
+ static_cast<ServiceWorkerContextWrapper*>(
+ partition->GetServiceWorkerContext());
+ wrapper->process_manager()->Shutdown();
+}
+
} // namespace
// static
@@ -124,7 +132,7 @@ DownloadManager* BrowserContext::GetDownloadManager(
}
// static
-fileapi::ExternalMountPoints* BrowserContext::GetMountPoints(
+storage::ExternalMountPoints* BrowserContext::GetMountPoints(
BrowserContext* context) {
// Ensure that these methods are called on the UI thread, except for
// unittests where a UI thread might not have been created.
@@ -133,15 +141,15 @@ fileapi::ExternalMountPoints* BrowserContext::GetMountPoints(
#if defined(OS_CHROMEOS)
if (!context->GetUserData(kMountPointsKey)) {
- scoped_refptr<fileapi::ExternalMountPoints> mount_points =
- fileapi::ExternalMountPoints::CreateRefCounted();
+ scoped_refptr<storage::ExternalMountPoints> mount_points =
+ storage::ExternalMountPoints::CreateRefCounted();
context->SetUserData(
kMountPointsKey,
- new UserDataAdapter<fileapi::ExternalMountPoints>(mount_points.get()));
+ new UserDataAdapter<storage::ExternalMountPoints>(mount_points.get()));
}
- return UserDataAdapter<fileapi::ExternalMountPoints>::Get(
- context, kMountPointsKey);
+ return UserDataAdapter<storage::ExternalMountPoints>::Get(context,
+ kMountPointsKey);
#else
return NULL;
#endif
@@ -212,6 +220,27 @@ void BrowserContext::CreateMemoryBackedBlob(BrowserContext* browser_context,
callback);
}
+// static
+void BrowserContext::DeliverPushMessage(
+ BrowserContext* browser_context,
+ const GURL& origin,
+ int64 service_worker_registration_id,
+ const std::string& data,
+ const base::Callback<void(PushDeliveryStatus)>& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ PushMessagingRouter::DeliverMessage(
+ browser_context, origin, service_worker_registration_id, data, callback);
+}
+
+// static
+void BrowserContext::NotifyWillBeDestroyed(BrowserContext* browser_context) {
+ // Service Workers must shutdown before the browser context is destroyed,
+ // since they keep render process hosts alive and the codebase assumes that
+ // render process hosts die before their profile (browser context) dies.
+ ForEachStoragePartition(browser_context,
+ base::Bind(ShutdownServiceWorkerContext));
+}
+
void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) {
// This will be enough to tickle initialization of BrowserContext if
// necessary, which initializes ResourceContext. The reason we don't call
@@ -236,7 +265,7 @@ void BrowserContext::SaveSessionState(BrowserContext* browser_context) {
base::Bind(
&SaveSessionStateOnIOThread,
make_scoped_refptr(browser_context->GetRequestContext()),
- static_cast<appcache::AppCacheServiceImpl*>(
+ static_cast<AppCacheServiceImpl*>(
storage_partition->GetAppCacheService())));
}