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 #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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 kDownloadManagerKeyName, | 123 kDownloadManagerKeyName, |
124 new UserDataAdapter<DownloadManager>(download_manager)); | 124 new UserDataAdapter<DownloadManager>(download_manager)); |
125 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); | 125 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); |
126 download_manager->Init(context); | 126 download_manager->Init(context); |
127 } | 127 } |
128 | 128 |
129 return UserDataAdapter<DownloadManager>::Get( | 129 return UserDataAdapter<DownloadManager>::Get( |
130 context, kDownloadManagerKeyName); | 130 context, kDownloadManagerKeyName); |
131 } | 131 } |
132 | 132 |
133 quota::QuotaManager* BrowserContext::GetQuotaManager( | 133 quota::QuotaManager* BrowserContext::GetDefaultQuotaManager( |
134 BrowserContext* browser_context) { | 134 BrowserContext* browser_context) { |
135 // TODO(ajwong): Change this API to require a process id instead of using | 135 return GetQuotaManagerForRenderProcess( |
136 // kInvalidChildProcessId. | 136 browser_context, ChildProcessHostImpl::kInvalidChildProcessId); |
137 StoragePartition* partition = | 137 } |
138 GetStoragePartition(browser_context, | 138 |
139 ChildProcessHostImpl::kInvalidChildProcessId); | 139 quota::QuotaManager* BrowserContext::GetQuotaManagerForRenderProcess( |
| 140 BrowserContext* browser_context, int renderer_child_id) { |
| 141 StoragePartition* partition = GetStoragePartition( |
| 142 browser_context, renderer_child_id); |
140 return partition->quota_manager(); | 143 return partition->quota_manager(); |
141 } | 144 } |
142 | 145 |
143 DOMStorageContext* BrowserContext::GetDefaultDOMStorageContext( | 146 DOMStorageContext* BrowserContext::GetDefaultDOMStorageContext( |
144 BrowserContext* browser_context) { | 147 BrowserContext* browser_context) { |
145 // TODO(ajwong): Force all users to know which process id they are performing | 148 // TODO(ajwong): Force all users to know which process id they are performing |
146 // actions on behalf of, migrate them to GetDOMStorageContext(), and then | 149 // actions on behalf of, migrate them to GetDOMStorageContext(), and then |
147 // delete this function. | 150 // delete this function. |
148 return GetDOMStorageContext(browser_context, | 151 return GetDOMStorageContext(browser_context, |
149 ChildProcessHostImpl::kInvalidChildProcessId); | 152 ChildProcessHostImpl::kInvalidChildProcessId); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 ForEachDOMStorageContext(browser_context, | 246 ForEachDOMStorageContext(browser_context, |
244 base::Bind(&DOMStorageContextImpl::PurgeMemory)); | 247 base::Bind(&DOMStorageContextImpl::PurgeMemory)); |
245 } | 248 } |
246 | 249 |
247 BrowserContext::~BrowserContext() { | 250 BrowserContext::~BrowserContext() { |
248 if (GetUserData(kDownloadManagerKeyName)) | 251 if (GetUserData(kDownloadManagerKeyName)) |
249 GetDownloadManager(this)->Shutdown(); | 252 GetDownloadManager(this)->Shutdown(); |
250 } | 253 } |
251 | 254 |
252 } // namespace content | 255 } // namespace content |
OLD | NEW |