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 "content/browser/dom_storage/dom_storage_context_impl.h" | 9 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
9 #include "content/browser/download/download_file_manager.h" | 10 #include "content/browser/download/download_file_manager.h" |
10 #include "content/browser/download/download_manager_impl.h" | 11 #include "content/browser/download/download_manager_impl.h" |
11 #include "content/browser/fileapi/browser_file_system_helper.h" | |
12 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" | 12 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" |
13 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 13 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
14 #include "content/browser/resource_context_impl.h" | 14 #include "content/public/browser/resource_context.h" |
| 15 #include "content/browser/storage_partition.h" |
| 16 #include "content/browser/storage_partition_map.h" |
| 17 #include "content/common/child_process_host_impl.h" |
15 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/content_browser_client.h" | 19 #include "content/public/browser/content_browser_client.h" |
17 #include "content/public/common/content_constants.h" | |
18 #include "net/base/server_bound_cert_service.h" | 20 #include "net/base/server_bound_cert_service.h" |
19 #include "net/base/server_bound_cert_store.h" | 21 #include "net/base/server_bound_cert_store.h" |
20 #include "net/cookies/cookie_monster.h" | 22 #include "net/cookies/cookie_monster.h" |
21 #include "net/cookies/cookie_store.h" | 23 #include "net/cookies/cookie_store.h" |
22 #include "net/url_request/url_request_context.h" | 24 #include "net/url_request/url_request_context.h" |
23 #include "webkit/database/database_tracker.h" | |
24 #include "webkit/quota/quota_manager.h" | |
25 | 25 |
26 using appcache::AppCacheService; | |
27 using base::UserDataAdapter; | 26 using base::UserDataAdapter; |
28 using content::BrowserThread; | 27 using content::BrowserThread; |
29 using fileapi::FileSystemContext; | |
30 using quota::QuotaManager; | |
31 using webkit_database::DatabaseTracker; | |
32 | 28 |
33 // Key names on BrowserContext. | 29 // Key names on BrowserContext. |
34 static const char* kAppCacheServicKeyName = "content_appcache_service_tracker"; | |
35 static const char* kDatabaseTrackerKeyName = "content_database_tracker"; | |
36 static const char* kDOMStorageContextKeyName = "content_dom_storage_context"; | |
37 static const char* kDownloadManagerKeyName = "download_manager"; | 30 static const char* kDownloadManagerKeyName = "download_manager"; |
38 static const char* kFileSystemContextKeyName = "content_file_system_context"; | 31 static const char* kStorageParitionMapKeyName = "content_storage_partition_map"; |
39 static const char* kIndexedDBContextKeyName = "content_indexed_db_context"; | |
40 static const char* kQuotaManagerKeyName = "content_quota_manager"; | |
41 | 32 |
42 namespace content { | 33 namespace content { |
43 | 34 |
44 namespace { | 35 namespace { |
45 | 36 |
46 void CreateQuotaManagerAndClients(BrowserContext* context) { | 37 StoragePartition* GetStoragePartition(BrowserContext* browser_context, |
47 // Ensure that these methods are called on the UI thread, except for unittests | 38 int renderer_child_id) { |
48 // where a UI thread might not have been created. | 39 StoragePartitionMap* partition_map = static_cast<StoragePartitionMap*>( |
49 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || | 40 browser_context->GetUserData(kStorageParitionMapKeyName)); |
50 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 41 if (!partition_map) { |
51 if (context->GetUserData(kQuotaManagerKeyName)) { | 42 partition_map = new StoragePartitionMap(browser_context); |
52 DCHECK(context->GetUserData(kDatabaseTrackerKeyName)); | 43 browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); |
53 DCHECK(context->GetUserData(kDOMStorageContextKeyName)); | 44 } |
54 DCHECK(context->GetUserData(kFileSystemContextKeyName)); | 45 |
55 DCHECK(context->GetUserData(kIndexedDBContextKeyName)); | 46 const std::string& partition_id = |
| 47 GetContentClient()->browser()->GetStoragePartitionIdForChildProcess( |
| 48 browser_context, |
| 49 renderer_child_id); |
| 50 |
| 51 return partition_map->Get(partition_id); |
| 52 } |
| 53 |
| 54 // Run |callback| on each storage partition in |browser_context|. |
| 55 void ForEachStoragePartition( |
| 56 BrowserContext* browser_context, |
| 57 const base::Callback<void(StoragePartition*)>& callback) { |
| 58 StoragePartitionMap* partition_map = static_cast<StoragePartitionMap*>( |
| 59 browser_context->GetUserData(kStorageParitionMapKeyName)); |
| 60 if (!partition_map) { |
56 return; | 61 return; |
57 } | 62 } |
58 | 63 |
59 // All of the clients have to be created and registered with the | 64 partition_map->ForEach(callback); |
60 // QuotaManager prior to the QuotaManger being used. So we do them | 65 } |
61 // all together here prior to handing out a reference to anything | |
62 // that utlizes the QuotaManager. | |
63 scoped_refptr<QuotaManager> quota_manager = new quota::QuotaManager( | |
64 context->IsOffTheRecord(), context->GetPath(), | |
65 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | |
66 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), | |
67 context->GetSpecialStoragePolicy()); | |
68 context->SetUserData(kQuotaManagerKeyName, | |
69 new UserDataAdapter<QuotaManager>(quota_manager)); | |
70 | 66 |
71 // Each consumer is responsible for registering its QuotaClient during | 67 // Used to convert a callback meant to take a DOMStorageContextImpl* into one |
72 // its construction. | 68 // that can take a StoragePartition*. |
73 scoped_refptr<FileSystemContext> filesystem_context = CreateFileSystemContext( | 69 void ProcessDOMStorageContext( |
74 context->GetPath(), context->IsOffTheRecord(), | 70 const base::Callback<void(DOMStorageContextImpl*)>& callback, |
75 context->GetSpecialStoragePolicy(), quota_manager->proxy()); | 71 StoragePartition* partition) { |
76 context->SetUserData( | 72 callback.Run(partition->dom_storage_context()); |
77 kFileSystemContextKeyName, | 73 } |
78 new UserDataAdapter<FileSystemContext>(filesystem_context)); | |
79 | 74 |
80 scoped_refptr<DatabaseTracker> db_tracker = new DatabaseTracker( | 75 // Run |callback| on each DOMStorageContextImpl in |browser_context|. |
81 context->GetPath(), context->IsOffTheRecord(), | 76 void ForEachDOMStorageContext( |
82 context->GetSpecialStoragePolicy(), quota_manager->proxy(), | 77 BrowserContext* browser_context, |
83 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 78 const base::Callback<void(DOMStorageContextImpl*)>& callback) { |
84 context->SetUserData(kDatabaseTrackerKeyName, | 79 ForEachStoragePartition(browser_context, |
85 new UserDataAdapter<DatabaseTracker>(db_tracker)); | 80 base::Bind(&ProcessDOMStorageContext, callback)); |
86 | |
87 FilePath path = context->IsOffTheRecord() ? FilePath() : context->GetPath(); | |
88 scoped_refptr<DOMStorageContextImpl> dom_storage_context = | |
89 new DOMStorageContextImpl(path, context->GetSpecialStoragePolicy()); | |
90 context->SetUserData( | |
91 kDOMStorageContextKeyName, | |
92 new UserDataAdapter<DOMStorageContextImpl>(dom_storage_context)); | |
93 | |
94 scoped_refptr<IndexedDBContext> indexed_db_context = new IndexedDBContextImpl( | |
95 path, context->GetSpecialStoragePolicy(), quota_manager->proxy(), | |
96 BrowserThread::GetMessageLoopProxyForThread( | |
97 BrowserThread::WEBKIT_DEPRECATED)); | |
98 context->SetUserData( | |
99 kIndexedDBContextKeyName, | |
100 new UserDataAdapter<IndexedDBContext>(indexed_db_context)); | |
101 | |
102 scoped_refptr<ChromeAppCacheService> appcache_service = | |
103 new ChromeAppCacheService(quota_manager->proxy()); | |
104 context->SetUserData( | |
105 kAppCacheServicKeyName, | |
106 new UserDataAdapter<ChromeAppCacheService>(appcache_service)); | |
107 | |
108 InitializeResourceContext(context); | |
109 | |
110 // Check first to avoid memory leak in unittests. | |
111 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | |
112 BrowserThread::PostTask( | |
113 BrowserThread::IO, FROM_HERE, | |
114 base::Bind(&ChromeAppCacheService::InitializeOnIOThread, | |
115 appcache_service, | |
116 context->IsOffTheRecord() ? FilePath() : | |
117 context->GetPath().Append(content::kAppCacheDirname), | |
118 context->GetResourceContext(), | |
119 make_scoped_refptr(context->GetSpecialStoragePolicy()))); | |
120 } | |
121 } | 81 } |
122 | 82 |
123 void SaveSessionStateOnIOThread(ResourceContext* resource_context) { | 83 void SaveSessionStateOnIOThread(ResourceContext* resource_context) { |
124 resource_context->GetRequestContext()->cookie_store()->GetCookieMonster()-> | 84 resource_context->GetRequestContext()->cookie_store()->GetCookieMonster()-> |
125 SetForceKeepSessionState(); | 85 SetForceKeepSessionState(); |
126 resource_context->GetRequestContext()->server_bound_cert_service()-> | 86 resource_context->GetRequestContext()->server_bound_cert_service()-> |
127 GetCertStore()->SetForceKeepSessionState(); | 87 GetCertStore()->SetForceKeepSessionState(); |
128 ResourceContext::GetAppCacheService(resource_context)-> | 88 ResourceContext::GetAppCacheService(resource_context)-> |
129 set_force_keep_session_state(); | 89 set_force_keep_session_state(); |
130 } | 90 } |
131 | 91 |
132 void SaveSessionStateOnWebkitThread( | 92 void SaveSessionStateOnWebkitThread( |
133 scoped_refptr<IndexedDBContextImpl> indexed_db_context) { | 93 scoped_refptr<IndexedDBContextImpl> indexed_db_context) { |
134 indexed_db_context->SetForceKeepSessionState(); | 94 indexed_db_context->SetForceKeepSessionState(); |
135 } | 95 } |
136 | 96 |
137 void PurgeMemoryOnIOThread(ResourceContext* resource_context) { | 97 void PurgeMemoryOnIOThread(ResourceContext* resource_context) { |
138 ResourceContext::GetAppCacheService(resource_context)->PurgeMemory(); | 98 ResourceContext::GetAppCacheService(resource_context)->PurgeMemory(); |
139 } | 99 } |
140 | 100 |
141 DOMStorageContextImpl* GetDOMStorageContextImpl(BrowserContext* context) { | 101 DOMStorageContextImpl* GetDefaultDOMStorageContextImpl( |
| 102 BrowserContext* context) { |
142 return static_cast<DOMStorageContextImpl*>( | 103 return static_cast<DOMStorageContextImpl*>( |
143 BrowserContext::GetDOMStorageContext(context)); | 104 BrowserContext::GetDefaultDOMStorageContext(context)); |
144 } | 105 } |
145 | 106 |
146 } // namespace | 107 } // namespace |
147 | 108 |
148 DownloadManager* BrowserContext::GetDownloadManager( | 109 DownloadManager* BrowserContext::GetDownloadManager( |
149 BrowserContext* context) { | 110 BrowserContext* context) { |
150 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
151 if (!context->GetUserData(kDownloadManagerKeyName)) { | 112 if (!context->GetUserData(kDownloadManagerKeyName)) { |
152 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); | 113 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); |
153 DCHECK(rdh); | 114 DCHECK(rdh); |
154 DownloadFileManager* file_manager = rdh->download_file_manager(); | 115 DownloadFileManager* file_manager = rdh->download_file_manager(); |
155 DCHECK(file_manager); | 116 DCHECK(file_manager); |
156 scoped_refptr<DownloadManager> download_manager = | 117 scoped_refptr<DownloadManager> download_manager = |
157 new DownloadManagerImpl( | 118 new DownloadManagerImpl( |
158 file_manager, | 119 file_manager, |
159 scoped_ptr<DownloadItemFactory>(), | 120 scoped_ptr<DownloadItemFactory>(), |
160 GetContentClient()->browser()->GetNetLog()); | 121 GetContentClient()->browser()->GetNetLog()); |
161 | 122 |
162 context->SetUserData( | 123 context->SetUserData( |
163 kDownloadManagerKeyName, | 124 kDownloadManagerKeyName, |
164 new UserDataAdapter<DownloadManager>(download_manager)); | 125 new UserDataAdapter<DownloadManager>(download_manager)); |
165 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); | 126 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); |
166 download_manager->Init(context); | 127 download_manager->Init(context); |
167 } | 128 } |
168 | 129 |
169 return UserDataAdapter<DownloadManager>::Get( | 130 return UserDataAdapter<DownloadManager>::Get( |
170 context, kDownloadManagerKeyName); | 131 context, kDownloadManagerKeyName); |
171 } | 132 } |
172 | 133 |
173 QuotaManager* BrowserContext::GetQuotaManager(BrowserContext* context) { | 134 quota::QuotaManager* BrowserContext::GetQuotaManager( |
174 CreateQuotaManagerAndClients(context); | 135 BrowserContext* browser_context) { |
175 return UserDataAdapter<QuotaManager>::Get(context, kQuotaManagerKeyName); | 136 // TODO(ajwong): Change this API to require a process id instead of using |
| 137 // kInvalidChildProcessId. |
| 138 StoragePartition* partition = |
| 139 GetStoragePartition(browser_context, |
| 140 ChildProcessHostImpl::kInvalidChildProcessId); |
| 141 return partition->quota_manager(); |
| 142 } |
| 143 |
| 144 DOMStorageContext* BrowserContext::GetDefaultDOMStorageContext( |
| 145 BrowserContext* browser_context) { |
| 146 // TODO(ajwong): Force all users to know which process id they are performing |
| 147 // actions on behalf of, migrate them to GetDOMStorageContext(), and then |
| 148 // delete this function. |
| 149 return GetDOMStorageContext(browser_context, |
| 150 ChildProcessHostImpl::kInvalidChildProcessId); |
176 } | 151 } |
177 | 152 |
178 DOMStorageContext* BrowserContext::GetDOMStorageContext( | 153 DOMStorageContext* BrowserContext::GetDOMStorageContext( |
179 BrowserContext* context) { | 154 BrowserContext* browser_context, |
180 CreateQuotaManagerAndClients(context); | 155 int render_child_id) { |
181 return UserDataAdapter<DOMStorageContextImpl>::Get( | 156 StoragePartition* partition = |
182 context, kDOMStorageContextKeyName); | 157 GetStoragePartition(browser_context, render_child_id); |
| 158 return partition->dom_storage_context(); |
183 } | 159 } |
184 | 160 |
185 IndexedDBContext* BrowserContext::GetIndexedDBContext(BrowserContext* context) { | 161 IndexedDBContext* BrowserContext::GetIndexedDBContext( |
186 CreateQuotaManagerAndClients(context); | 162 BrowserContext* browser_context) { |
187 return UserDataAdapter<IndexedDBContext>::Get( | 163 // TODO(ajwong): Change this API to require a process id instead of using |
188 context, kIndexedDBContextKeyName); | 164 // kInvalidChildProcessId. |
| 165 StoragePartition* partition = |
| 166 GetStoragePartition(browser_context, |
| 167 ChildProcessHostImpl::kInvalidChildProcessId); |
| 168 return partition->indexed_db_context(); |
189 } | 169 } |
190 | 170 |
191 DatabaseTracker* BrowserContext::GetDatabaseTracker(BrowserContext* context) { | 171 webkit_database::DatabaseTracker* BrowserContext::GetDatabaseTracker( |
192 CreateQuotaManagerAndClients(context); | 172 BrowserContext* browser_context) { |
193 return UserDataAdapter<DatabaseTracker>::Get( | 173 // TODO(ajwong): Change this API to require a process id instead of using |
194 context, kDatabaseTrackerKeyName); | 174 // kInvalidChildProcessId. |
| 175 StoragePartition* partition = |
| 176 GetStoragePartition(browser_context, |
| 177 ChildProcessHostImpl::kInvalidChildProcessId); |
| 178 return partition->database_tracker(); |
195 } | 179 } |
196 | 180 |
197 AppCacheService* BrowserContext::GetAppCacheService( | 181 appcache::AppCacheService* BrowserContext::GetAppCacheService( |
198 BrowserContext* browser_context) { | 182 BrowserContext* browser_context) { |
199 CreateQuotaManagerAndClients(browser_context); | 183 // TODO(ajwong): Change this API to require a process id instead of using |
200 return UserDataAdapter<ChromeAppCacheService>::Get( | 184 // kInvalidChildProcessId. |
201 browser_context, kAppCacheServicKeyName); | 185 StoragePartition* partition = |
| 186 GetStoragePartition(browser_context, |
| 187 ChildProcessHostImpl::kInvalidChildProcessId); |
| 188 return partition->appcache_service(); |
202 } | 189 } |
203 | 190 |
204 FileSystemContext* BrowserContext::GetFileSystemContext( | 191 fileapi::FileSystemContext* BrowserContext::GetFileSystemContext( |
205 BrowserContext* browser_context) { | 192 BrowserContext* browser_context) { |
206 CreateQuotaManagerAndClients(browser_context); | 193 // TODO(ajwong): Change this API to require a process id instead of using |
207 return UserDataAdapter<FileSystemContext>::Get( | 194 // kInvalidChildProcessId. |
208 browser_context, kFileSystemContextKeyName); | 195 StoragePartition* partition = |
| 196 GetStoragePartition(browser_context, |
| 197 ChildProcessHostImpl::kInvalidChildProcessId); |
| 198 return partition->filesystem_context(); |
209 } | 199 } |
210 | 200 |
211 void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) { | 201 void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) { |
212 // This will be enough to tickle initialization of BrowserContext if | 202 // This will be enough to tickle initialization of BrowserContext if |
213 // necessary, which initializes ResourceContext. The reason we don't call | 203 // necessary, which initializes ResourceContext. The reason we don't call |
214 // ResourceContext::InitializeResourceContext directly here is that if | 204 // ResourceContext::InitializeResourceContext directly here is that if |
215 // ResourceContext ends up initializing it will call back into BrowserContext | 205 // ResourceContext ends up initializing it will call back into BrowserContext |
216 // and when that call return it'll end rewriting its UserData map (with the | 206 // and when that call returns it'll end rewriting its UserData map (with the |
217 // same value) but this causes a race condition. See http://crbug.com/115678. | 207 // same value) but this causes a race condition. See http://crbug.com/115678. |
218 CreateQuotaManagerAndClients(context); | 208 GetStoragePartition(context, ChildProcessHostImpl::kInvalidChildProcessId); |
219 } | 209 } |
220 | 210 |
221 void BrowserContext::SaveSessionState(BrowserContext* browser_context) { | 211 void BrowserContext::SaveSessionState(BrowserContext* browser_context) { |
222 GetDatabaseTracker(browser_context)->SetForceKeepSessionState(); | 212 GetDatabaseTracker(browser_context)->SetForceKeepSessionState(); |
223 | 213 |
224 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | 214 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { |
225 BrowserThread::PostTask( | 215 BrowserThread::PostTask( |
226 BrowserThread::IO, FROM_HERE, | 216 BrowserThread::IO, FROM_HERE, |
227 base::Bind(&SaveSessionStateOnIOThread, | 217 base::Bind(&SaveSessionStateOnIOThread, |
228 browser_context->GetResourceContext())); | 218 browser_context->GetResourceContext())); |
229 } | 219 } |
230 | 220 |
231 GetDOMStorageContextImpl(browser_context)->SetForceKeepSessionState(); | 221 // TODO(ajwong): This is the only usage of GetDefaultDOMStorageContextImpl(). |
| 222 // After we migrate this to support multiple DOMStorageContexts, don't forget |
| 223 // to remove the GetDefaultDOMStorageContextImpl() function as well. |
| 224 GetDefaultDOMStorageContextImpl(browser_context)->SetForceKeepSessionState(); |
232 | 225 |
233 if (BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)) { | 226 if (BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)) { |
234 IndexedDBContextImpl* indexed_db = static_cast<IndexedDBContextImpl*>( | 227 IndexedDBContextImpl* indexed_db = static_cast<IndexedDBContextImpl*>( |
235 GetIndexedDBContext(browser_context)); | 228 GetIndexedDBContext(browser_context)); |
236 BrowserThread::PostTask( | 229 BrowserThread::PostTask( |
237 BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, | 230 BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, |
238 base::Bind(&SaveSessionStateOnWebkitThread, | 231 base::Bind(&SaveSessionStateOnWebkitThread, |
239 make_scoped_refptr(indexed_db))); | 232 make_scoped_refptr(indexed_db))); |
240 } | 233 } |
241 } | 234 } |
242 | 235 |
243 void BrowserContext::PurgeMemory(BrowserContext* browser_context) { | 236 void BrowserContext::PurgeMemory(BrowserContext* browser_context) { |
244 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | 237 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { |
245 BrowserThread::PostTask( | 238 BrowserThread::PostTask( |
246 BrowserThread::IO, FROM_HERE, | 239 BrowserThread::IO, FROM_HERE, |
247 base::Bind(&PurgeMemoryOnIOThread, | 240 base::Bind(&PurgeMemoryOnIOThread, |
248 browser_context->GetResourceContext())); | 241 browser_context->GetResourceContext())); |
249 } | 242 } |
250 | 243 |
251 GetDOMStorageContextImpl(browser_context)->PurgeMemory(); | 244 ForEachDOMStorageContext(browser_context, |
| 245 base::Bind(&DOMStorageContextImpl::PurgeMemory)); |
252 } | 246 } |
253 | 247 |
254 BrowserContext::~BrowserContext() { | 248 BrowserContext::~BrowserContext() { |
255 // These message loop checks are just to avoid leaks in unittests. | |
256 if (GetUserData(kDatabaseTrackerKeyName) && | |
257 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | |
258 BrowserThread::PostTask( | |
259 BrowserThread::FILE, FROM_HERE, | |
260 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | |
261 GetDatabaseTracker(this))); | |
262 } | |
263 | |
264 if (GetUserData(kDOMStorageContextKeyName)) | |
265 GetDOMStorageContextImpl(this)->Shutdown(); | |
266 | |
267 if (GetUserData(kDownloadManagerKeyName)) | 249 if (GetUserData(kDownloadManagerKeyName)) |
268 GetDownloadManager(this)->Shutdown(); | 250 GetDownloadManager(this)->Shutdown(); |
269 } | 251 } |
270 | 252 |
271 } // namespace content | 253 } // namespace content |
OLD | NEW |