| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "content/public/browser/browser_context.h" | 5 #include "content/public/browser/browser_context.h" | 
| 6 | 6 | 
| 7 #if !defined(OS_IOS) | 7 #if !defined(OS_IOS) | 
| 8 #include "content/browser/download/download_manager_impl.h" | 8 #include "content/browser/download/download_manager_impl.h" | 
| 9 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 9 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 
| 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 62       GetStoragePartitionMap(browser_context); | 62       GetStoragePartitionMap(browser_context); | 
| 63 | 63 | 
| 64   if (browser_context->IsOffTheRecord()) | 64   if (browser_context->IsOffTheRecord()) | 
| 65     in_memory = true; | 65     in_memory = true; | 
| 66 | 66 | 
| 67   return partition_map->Get(partition_domain, partition_name, in_memory); | 67   return partition_map->Get(partition_domain, partition_name, in_memory); | 
| 68 } | 68 } | 
| 69 | 69 | 
| 70 void SaveSessionStateOnIOThread( | 70 void SaveSessionStateOnIOThread( | 
| 71     const scoped_refptr<net::URLRequestContextGetter>& context_getter, | 71     const scoped_refptr<net::URLRequestContextGetter>& context_getter, | 
| 72     appcache::AppCacheServiceImpl* appcache_service) { | 72     AppCacheServiceImpl* appcache_service) { | 
| 73   net::URLRequestContext* context = context_getter->GetURLRequestContext(); | 73   net::URLRequestContext* context = context_getter->GetURLRequestContext(); | 
| 74   context->cookie_store()->GetCookieMonster()-> | 74   context->cookie_store()->GetCookieMonster()-> | 
| 75       SetForceKeepSessionState(); | 75       SetForceKeepSessionState(); | 
| 76   context->server_bound_cert_service()->GetCertStore()-> | 76   context->server_bound_cert_service()->GetCertStore()-> | 
| 77       SetForceKeepSessionState(); | 77       SetForceKeepSessionState(); | 
| 78   appcache_service->set_force_keep_session_state(); | 78   appcache_service->set_force_keep_session_state(); | 
| 79 } | 79 } | 
| 80 | 80 | 
| 81 void SaveSessionStateOnIndexedDBThread( | 81 void SaveSessionStateOnIndexedDBThread( | 
| 82     scoped_refptr<IndexedDBContextImpl> indexed_db_context) { | 82     scoped_refptr<IndexedDBContextImpl> indexed_db_context) { | 
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 229       SetForceKeepSessionState(); | 229       SetForceKeepSessionState(); | 
| 230   StoragePartition* storage_partition = | 230   StoragePartition* storage_partition = | 
| 231       BrowserContext::GetDefaultStoragePartition(browser_context); | 231       BrowserContext::GetDefaultStoragePartition(browser_context); | 
| 232 | 232 | 
| 233   if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | 233   if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | 
| 234     BrowserThread::PostTask( | 234     BrowserThread::PostTask( | 
| 235         BrowserThread::IO, FROM_HERE, | 235         BrowserThread::IO, FROM_HERE, | 
| 236         base::Bind( | 236         base::Bind( | 
| 237             &SaveSessionStateOnIOThread, | 237             &SaveSessionStateOnIOThread, | 
| 238             make_scoped_refptr(browser_context->GetRequestContext()), | 238             make_scoped_refptr(browser_context->GetRequestContext()), | 
| 239             static_cast<appcache::AppCacheServiceImpl*>( | 239             static_cast<AppCacheServiceImpl*>( | 
| 240                 storage_partition->GetAppCacheService()))); | 240                 storage_partition->GetAppCacheService()))); | 
| 241   } | 241   } | 
| 242 | 242 | 
| 243   DOMStorageContextWrapper* dom_storage_context_proxy = | 243   DOMStorageContextWrapper* dom_storage_context_proxy = | 
| 244       static_cast<DOMStorageContextWrapper*>( | 244       static_cast<DOMStorageContextWrapper*>( | 
| 245           storage_partition->GetDOMStorageContext()); | 245           storage_partition->GetDOMStorageContext()); | 
| 246   dom_storage_context_proxy->SetForceKeepSessionState(); | 246   dom_storage_context_proxy->SetForceKeepSessionState(); | 
| 247 | 247 | 
| 248   IndexedDBContextImpl* indexed_db_context_impl = | 248   IndexedDBContextImpl* indexed_db_context_impl = | 
| 249       static_cast<IndexedDBContextImpl*>( | 249       static_cast<IndexedDBContextImpl*>( | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 260 #endif  // !OS_IOS | 260 #endif  // !OS_IOS | 
| 261 | 261 | 
| 262 BrowserContext::~BrowserContext() { | 262 BrowserContext::~BrowserContext() { | 
| 263 #if !defined(OS_IOS) | 263 #if !defined(OS_IOS) | 
| 264   if (GetUserData(kDownloadManagerKeyName)) | 264   if (GetUserData(kDownloadManagerKeyName)) | 
| 265     GetDownloadManager(this)->Shutdown(); | 265     GetDownloadManager(this)->Shutdown(); | 
| 266 #endif | 266 #endif | 
| 267 } | 267 } | 
| 268 | 268 | 
| 269 }  // namespace content | 269 }  // namespace content | 
| OLD | NEW | 
|---|