Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: content/browser/browser_context.cc

Issue 10879075: Shard DatabaseTracker (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "content/browser/appcache/chrome_appcache_service.h" 7 #include "content/browser/appcache/chrome_appcache_service.h"
8 #include "webkit/database/database_tracker.h" 8 #include "webkit/database/database_tracker.h"
9 #include "content/browser/dom_storage/dom_storage_context_impl.h" 9 #include "content/browser/dom_storage/dom_storage_context_impl.h"
10 #include "content/browser/download/download_file_manager.h" 10 #include "content/browser/download/download_file_manager.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 context, kDownloadManagerKeyName); 102 context, kDownloadManagerKeyName);
103 } 103 }
104 104
105 IndexedDBContext* BrowserContext::GetIndexedDBContext( 105 IndexedDBContext* BrowserContext::GetIndexedDBContext(
106 BrowserContext* browser_context) { 106 BrowserContext* browser_context) {
107 // TODO(ajwong): Change this API to require a SiteInstance instead of 107 // TODO(ajwong): Change this API to require a SiteInstance instead of
108 // using GetDefaultStoragePartition(). 108 // using GetDefaultStoragePartition().
109 return GetDefaultStoragePartition(browser_context)->GetIndexedDBContext(); 109 return GetDefaultStoragePartition(browser_context)->GetIndexedDBContext();
110 } 110 }
111 111
112 webkit_database::DatabaseTracker* BrowserContext::GetDatabaseTracker(
113 BrowserContext* browser_context) {
114 // TODO(ajwong): Change this API to require a SiteInstance instead of
115 // using GetDefaultStoragePartition().
116 return GetDefaultStoragePartition(browser_context)->GetDatabaseTracker();
117 }
118
119 appcache::AppCacheService* BrowserContext::GetAppCacheService( 112 appcache::AppCacheService* BrowserContext::GetAppCacheService(
120 BrowserContext* browser_context) { 113 BrowserContext* browser_context) {
121 // TODO(ajwong): Change this API to require a SiteInstance instead of 114 // TODO(ajwong): Change this API to require a SiteInstance instead of
122 // using GetDefaultStoragePartition(). 115 // using GetDefaultStoragePartition().
123 return GetDefaultStoragePartition(browser_context)->GetAppCacheService(); 116 return GetDefaultStoragePartition(browser_context)->GetAppCacheService();
124 } 117 }
125 118
126 fileapi::FileSystemContext* BrowserContext::GetFileSystemContext( 119 fileapi::FileSystemContext* BrowserContext::GetFileSystemContext(
127 BrowserContext* browser_context) { 120 BrowserContext* browser_context) {
128 // TODO(ajwong): Change this API to require a SiteInstance instead of 121 // TODO(ajwong): Change this API to require a SiteInstance instead of
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // ResourceContext::InitializeResourceContext() directly here is that 162 // ResourceContext::InitializeResourceContext() directly here is that
170 // ResourceContext initialization may call back into BrowserContext 163 // ResourceContext initialization may call back into BrowserContext
171 // and when that call returns it'll end rewriting its UserData map. It will 164 // and when that call returns it'll end rewriting its UserData map. It will
172 // end up rewriting the same value but this still causes a race condition. 165 // end up rewriting the same value but this still causes a race condition.
173 // 166 //
174 // See http://crbug.com/115678. 167 // See http://crbug.com/115678.
175 GetDefaultStoragePartition(context); 168 GetDefaultStoragePartition(context);
176 } 169 }
177 170
178 void BrowserContext::SaveSessionState(BrowserContext* browser_context) { 171 void BrowserContext::SaveSessionState(BrowserContext* browser_context) {
179 GetDatabaseTracker(browser_context)->SetForceKeepSessionState(); 172 GetDefaultStoragePartition(browser_context)->GetDatabaseTracker()->
173 SetForceKeepSessionState();
180 174
181 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { 175 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
182 BrowserThread::PostTask( 176 BrowserThread::PostTask(
183 BrowserThread::IO, FROM_HERE, 177 BrowserThread::IO, FROM_HERE,
184 base::Bind( 178 base::Bind(
185 &SaveSessionStateOnIOThread, 179 &SaveSessionStateOnIOThread,
186 make_scoped_refptr(browser_context->GetRequestContext()), 180 make_scoped_refptr(browser_context->GetRequestContext()),
187 BrowserContext::GetDefaultStoragePartition(browser_context)-> 181 BrowserContext::GetDefaultStoragePartition(browser_context)->
188 GetAppCacheService())); 182 GetAppCacheService()));
189 } 183 }
(...skipping 26 matching lines...) Expand all
216 ForEachStoragePartition(browser_context, 210 ForEachStoragePartition(browser_context,
217 base::Bind(&PurgeDOMStorageContextInPartition)); 211 base::Bind(&PurgeDOMStorageContextInPartition));
218 } 212 }
219 213
220 BrowserContext::~BrowserContext() { 214 BrowserContext::~BrowserContext() {
221 if (GetUserData(kDownloadManagerKeyName)) 215 if (GetUserData(kDownloadManagerKeyName))
222 GetDownloadManager(this)->Shutdown(); 216 GetDownloadManager(this)->Shutdown();
223 } 217 }
224 218
225 } // namespace content 219 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698