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/browser/storage_partition_impl.h" | 5 #include "content/browser/storage_partition_impl.h" |
6 | 6 |
7 #include "base/sequenced_task_runner.h" | 7 #include "base/sequenced_task_runner.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/browser/browser_main_loop.h" | 9 #include "content/browser/browser_main_loop.h" |
10 #include "content/browser/fileapi/browser_file_system_helper.h" | 10 #include "content/browser/fileapi/browser_file_system_helper.h" |
11 #include "content/browser/gpu/shader_disk_cache.h" | 11 #include "content/browser/gpu/shader_disk_cache.h" |
| 12 #include "content/browser/net/cookie_store_map.h" |
12 #include "content/common/dom_storage/dom_storage_types.h" | 13 #include "content/common/dom_storage/dom_storage_types.h" |
13 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/dom_storage_context.h" | 16 #include "content/public/browser/dom_storage_context.h" |
16 #include "content/public/browser/indexed_db_context.h" | 17 #include "content/public/browser/indexed_db_context.h" |
17 #include "content/public/browser/local_storage_usage_info.h" | 18 #include "content/public/browser/local_storage_usage_info.h" |
18 #include "content/public/browser/session_storage_usage_info.h" | 19 #include "content/public/browser/session_storage_usage_info.h" |
| 20 #include "content/public/common/url_constants.h" |
19 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
20 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
21 #include "net/cookies/cookie_monster.h" | 23 #include "net/cookies/cookie_monster.h" |
22 #include "net/url_request/url_request_context.h" | 24 #include "net/url_request/url_request_context.h" |
23 #include "net/url_request/url_request_context_getter.h" | 25 #include "net/url_request/url_request_context_getter.h" |
24 #include "webkit/browser/database/database_tracker.h" | 26 #include "webkit/browser/database/database_tracker.h" |
25 #include "webkit/browser/quota/quota_manager.h" | 27 #include "webkit/browser/quota/quota_manager.h" |
26 | 28 |
27 namespace content { | 29 namespace content { |
28 | 30 |
29 namespace { | 31 namespace { |
30 | 32 |
31 int GenerateQuotaClientMask(uint32 remove_mask) { | 33 int GenerateQuotaClientMask(uint32 remove_mask) { |
32 int quota_client_mask = 0; | 34 int quota_client_mask = 0; |
33 | 35 |
34 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS) | 36 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS) |
35 quota_client_mask |= quota::QuotaClient::kFileSystem; | 37 quota_client_mask |= quota::QuotaClient::kFileSystem; |
36 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL) | 38 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL) |
37 quota_client_mask |= quota::QuotaClient::kDatabase; | 39 quota_client_mask |= quota::QuotaClient::kDatabase; |
38 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE) | 40 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE) |
39 quota_client_mask |= quota::QuotaClient::kAppcache; | 41 quota_client_mask |= quota::QuotaClient::kAppcache; |
40 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB) | 42 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB) |
41 quota_client_mask |= quota::QuotaClient::kIndexedDatabase; | 43 quota_client_mask |= quota::QuotaClient::kIndexedDatabase; |
42 | 44 |
43 return quota_client_mask; | 45 return quota_client_mask; |
44 } | 46 } |
45 | 47 |
46 void OnClearedCookies(const base::Closure& callback, int num_deleted) { | |
47 // The final callback needs to happen from UI thread. | |
48 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
49 BrowserThread::PostTask( | |
50 BrowserThread::UI, FROM_HERE, | |
51 base::Bind(&OnClearedCookies, callback, num_deleted)); | |
52 return; | |
53 } | |
54 | |
55 callback.Run(); | |
56 } | |
57 | |
58 void ClearCookiesOnIOThread( | |
59 const scoped_refptr<net::URLRequestContextGetter>& rq_context, | |
60 const base::Time begin, | |
61 const base::Time end, | |
62 const GURL& remove_origin, | |
63 const base::Closure& callback) { | |
64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
65 net::CookieStore* cookie_store = rq_context-> | |
66 GetURLRequestContext()->cookie_store(); | |
67 if (remove_origin.is_empty()) { | |
68 cookie_store->GetCookieMonster()->DeleteAllCreatedBetweenAsync( | |
69 begin, | |
70 end, | |
71 base::Bind(&OnClearedCookies, callback)); | |
72 } else { | |
73 cookie_store->GetCookieMonster()->DeleteAllCreatedBetweenForHostAsync( | |
74 begin, | |
75 end, | |
76 remove_origin, base::Bind(&OnClearedCookies, callback)); | |
77 } | |
78 } | |
79 | |
80 void OnQuotaManagedOriginDeleted(const GURL& origin, | 48 void OnQuotaManagedOriginDeleted(const GURL& origin, |
81 quota::StorageType type, | 49 quota::StorageType type, |
82 size_t* origins_to_delete_count, | 50 size_t* origins_to_delete_count, |
83 const base::Closure& callback, | 51 const base::Closure& callback, |
84 quota::QuotaStatusCode status) { | 52 quota::QuotaStatusCode status) { |
85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
86 DCHECK_GT(*origins_to_delete_count, 0u); | 54 DCHECK_GT(*origins_to_delete_count, 0u); |
87 if (status != quota::kQuotaStatusOk) { | 55 if (status != quota::kQuotaStatusOk) { |
88 DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " | 56 DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " |
89 << origin << ". Status: " << status; | 57 << origin << ". Status: " << status; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 : callback(callback), task_count(0) { | 209 : callback(callback), task_count(0) { |
242 } | 210 } |
243 | 211 |
244 void IncrementTaskCountOnUI(); | 212 void IncrementTaskCountOnUI(); |
245 void DecrementTaskCountOnUI(); | 213 void DecrementTaskCountOnUI(); |
246 | 214 |
247 void ClearDataOnUIThread(uint32 remove_mask, | 215 void ClearDataOnUIThread(uint32 remove_mask, |
248 uint32 quota_storage_remove_mask, | 216 uint32 quota_storage_remove_mask, |
249 const GURL& remove_origin, | 217 const GURL& remove_origin, |
250 const base::FilePath& path, | 218 const base::FilePath& path, |
251 net::URLRequestContextGetter* rq_context, | 219 CookieStoreMap* cookie_store_map, |
252 DOMStorageContextWrapper* dom_storage_context, | 220 DOMStorageContextWrapper* dom_storage_context, |
253 quota::QuotaManager* quota_manager, | 221 quota::QuotaManager* quota_manager, |
254 WebRTCIdentityStore* webrtc_identity_store, | 222 WebRTCIdentityStore* webrtc_identity_store, |
255 const base::Time begin, | 223 const base::Time begin, |
256 const base::Time end); | 224 const base::Time end); |
257 | 225 |
258 // Accessed on UI thread. | 226 // Accessed on UI thread. |
259 const base::Closure callback; | 227 const base::Closure callback; |
260 // Accessed on UI thread. | 228 // Accessed on UI thread. |
261 int task_count; | 229 int task_count; |
(...skipping 15 matching lines...) Expand all Loading... |
277 } | 245 } |
278 | 246 |
279 StoragePartitionImpl::StoragePartitionImpl( | 247 StoragePartitionImpl::StoragePartitionImpl( |
280 const base::FilePath& partition_path, | 248 const base::FilePath& partition_path, |
281 quota::QuotaManager* quota_manager, | 249 quota::QuotaManager* quota_manager, |
282 ChromeAppCacheService* appcache_service, | 250 ChromeAppCacheService* appcache_service, |
283 fileapi::FileSystemContext* filesystem_context, | 251 fileapi::FileSystemContext* filesystem_context, |
284 webkit_database::DatabaseTracker* database_tracker, | 252 webkit_database::DatabaseTracker* database_tracker, |
285 DOMStorageContextWrapper* dom_storage_context, | 253 DOMStorageContextWrapper* dom_storage_context, |
286 IndexedDBContextImpl* indexed_db_context, | 254 IndexedDBContextImpl* indexed_db_context, |
| 255 scoped_ptr<CookieStoreMap> cookie_store_map, |
287 WebRTCIdentityStore* webrtc_identity_store) | 256 WebRTCIdentityStore* webrtc_identity_store) |
288 : partition_path_(partition_path), | 257 : partition_path_(partition_path), |
289 quota_manager_(quota_manager), | 258 quota_manager_(quota_manager), |
290 appcache_service_(appcache_service), | 259 appcache_service_(appcache_service), |
291 filesystem_context_(filesystem_context), | 260 filesystem_context_(filesystem_context), |
292 database_tracker_(database_tracker), | 261 database_tracker_(database_tracker), |
293 dom_storage_context_(dom_storage_context), | 262 dom_storage_context_(dom_storage_context), |
294 indexed_db_context_(indexed_db_context), | 263 indexed_db_context_(indexed_db_context), |
295 webrtc_identity_store_(webrtc_identity_store) {} | 264 cookie_store_map_(cookie_store_map.Pass()), |
| 265 webrtc_identity_store_(webrtc_identity_store) { |
| 266 } |
296 | 267 |
297 StoragePartitionImpl::~StoragePartitionImpl() { | 268 StoragePartitionImpl::~StoragePartitionImpl() { |
298 // These message loop checks are just to avoid leaks in unittests. | 269 // These message loop checks are just to avoid leaks in unittests. |
299 if (GetDatabaseTracker() && | 270 if (GetDatabaseTracker() && |
300 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | 271 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
301 BrowserThread::PostTask( | 272 BrowserThread::PostTask( |
302 BrowserThread::FILE, FROM_HERE, | 273 BrowserThread::FILE, FROM_HERE, |
303 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | 274 base::Bind(&webkit_database::DatabaseTracker::Shutdown, |
304 GetDatabaseTracker())); | 275 GetDatabaseTracker())); |
305 } | 276 } |
306 | 277 |
307 if (GetFileSystemContext()) | 278 if (GetFileSystemContext()) |
308 GetFileSystemContext()->Shutdown(); | 279 GetFileSystemContext()->Shutdown(); |
309 | 280 |
310 if (GetDOMStorageContext()) | 281 if (GetDOMStorageContext()) |
311 GetDOMStorageContext()->Shutdown(); | 282 GetDOMStorageContext()->Shutdown(); |
312 } | 283 } |
313 | 284 |
314 // TODO(ajwong): Break the direct dependency on |context|. We only | 285 // TODO(ajwong): Break the direct dependency on |context|. We only |
315 // need 3 pieces of info from it. | 286 // need 3 pieces of info from it. |
316 StoragePartitionImpl* StoragePartitionImpl::Create( | 287 StoragePartitionImpl* StoragePartitionImpl::Create( |
317 BrowserContext* context, | 288 BrowserContext* context, |
318 bool in_memory, | 289 bool in_memory, |
319 const base::FilePath& partition_path) { | 290 const base::FilePath& partition_path, |
| 291 scoped_ptr<CookieStoreMap> cookie_store_map) { |
320 // Ensure that these methods are called on the UI thread, except for | 292 // Ensure that these methods are called on the UI thread, except for |
321 // unittests where a UI thread might not have been created. | 293 // unittests where a UI thread might not have been created. |
322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || | 294 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
323 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 295 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
324 | 296 |
325 // All of the clients have to be created and registered with the | 297 // All of the clients have to be created and registered with the |
326 // QuotaManager prior to the QuotaManger being used. We do them | 298 // QuotaManager prior to the QuotaManger being used. We do them |
327 // all together here prior to handing out a reference to anything | 299 // all together here prior to handing out a reference to anything |
328 // that utilizes the QuotaManager. | 300 // that utilizes the QuotaManager. |
329 scoped_refptr<quota::QuotaManager> quota_manager = new quota::QuotaManager( | 301 scoped_refptr<quota::QuotaManager> quota_manager = new quota::QuotaManager( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store( | 345 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store( |
374 new WebRTCIdentityStore(path, context->GetSpecialStoragePolicy())); | 346 new WebRTCIdentityStore(path, context->GetSpecialStoragePolicy())); |
375 | 347 |
376 return new StoragePartitionImpl(partition_path, | 348 return new StoragePartitionImpl(partition_path, |
377 quota_manager.get(), | 349 quota_manager.get(), |
378 appcache_service.get(), | 350 appcache_service.get(), |
379 filesystem_context.get(), | 351 filesystem_context.get(), |
380 database_tracker.get(), | 352 database_tracker.get(), |
381 dom_storage_context.get(), | 353 dom_storage_context.get(), |
382 indexed_db_context.get(), | 354 indexed_db_context.get(), |
| 355 cookie_store_map.Pass(), |
383 webrtc_identity_store.get()); | 356 webrtc_identity_store.get()); |
384 } | 357 } |
385 | 358 |
386 base::FilePath StoragePartitionImpl::GetPath() { | 359 base::FilePath StoragePartitionImpl::GetPath() { |
387 return partition_path_; | 360 return partition_path_; |
388 } | 361 } |
389 | 362 |
390 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 363 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
391 return url_request_context_.get(); | 364 return url_request_context_.get(); |
392 } | 365 } |
(...skipping 20 matching lines...) Expand all Loading... |
413 } | 386 } |
414 | 387 |
415 DOMStorageContextWrapper* StoragePartitionImpl::GetDOMStorageContext() { | 388 DOMStorageContextWrapper* StoragePartitionImpl::GetDOMStorageContext() { |
416 return dom_storage_context_.get(); | 389 return dom_storage_context_.get(); |
417 } | 390 } |
418 | 391 |
419 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { | 392 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { |
420 return indexed_db_context_.get(); | 393 return indexed_db_context_.get(); |
421 } | 394 } |
422 | 395 |
| 396 net::CookieStore* StoragePartitionImpl::GetCookieStoreForScheme( |
| 397 const std::string& scheme) { |
| 398 return GetCookieStoreMap().GetForScheme(scheme); |
| 399 } |
| 400 |
423 void StoragePartitionImpl::ClearDataImpl( | 401 void StoragePartitionImpl::ClearDataImpl( |
424 uint32 remove_mask, | 402 uint32 remove_mask, |
425 uint32 quota_storage_remove_mask, | 403 uint32 quota_storage_remove_mask, |
426 const GURL& remove_origin, | 404 const GURL& remove_origin, |
427 net::URLRequestContextGetter* rq_context, | |
428 const base::Time begin, | 405 const base::Time begin, |
429 const base::Time end, | 406 const base::Time end, |
430 const base::Closure& callback) { | 407 const base::Closure& callback) { |
431 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
432 DataDeletionHelper* helper = new DataDeletionHelper(callback); | 409 DataDeletionHelper* helper = new DataDeletionHelper(callback); |
433 // |helper| deletes itself when done in | 410 // |helper| deletes itself when done in |
434 // DataDeletionHelper::DecrementTaskCountOnUI(). | 411 // DataDeletionHelper::DecrementTaskCountOnUI(). |
435 helper->ClearDataOnUIThread( | 412 helper->ClearDataOnUIThread( |
436 remove_mask, quota_storage_remove_mask, remove_origin, | 413 remove_mask, quota_storage_remove_mask, remove_origin, |
437 GetPath(), rq_context, dom_storage_context_, quota_manager_, | 414 GetPath(), cookie_store_map_.get(), dom_storage_context_, quota_manager_, |
438 webrtc_identity_store_, begin, end); | 415 webrtc_identity_store_, begin, end); |
439 } | 416 } |
440 | 417 |
441 void StoragePartitionImpl:: | 418 void StoragePartitionImpl:: |
442 QuotaManagedDataDeletionHelper::IncrementTaskCountOnIO() { | 419 QuotaManagedDataDeletionHelper::IncrementTaskCountOnIO() { |
443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 420 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
444 ++task_count; | 421 ++task_count; |
445 } | 422 } |
446 | 423 |
447 void StoragePartitionImpl:: | 424 void StoragePartitionImpl:: |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 callback.Run(); | 517 callback.Run(); |
541 delete this; | 518 delete this; |
542 } | 519 } |
543 } | 520 } |
544 | 521 |
545 void StoragePartitionImpl::DataDeletionHelper::ClearDataOnUIThread( | 522 void StoragePartitionImpl::DataDeletionHelper::ClearDataOnUIThread( |
546 uint32 remove_mask, | 523 uint32 remove_mask, |
547 uint32 quota_storage_remove_mask, | 524 uint32 quota_storage_remove_mask, |
548 const GURL& remove_origin, | 525 const GURL& remove_origin, |
549 const base::FilePath& path, | 526 const base::FilePath& path, |
550 net::URLRequestContextGetter* rq_context, | 527 CookieStoreMap* cookie_store_map, |
551 DOMStorageContextWrapper* dom_storage_context, | 528 DOMStorageContextWrapper* dom_storage_context, |
552 quota::QuotaManager* quota_manager, | 529 quota::QuotaManager* quota_manager, |
553 WebRTCIdentityStore* webrtc_identity_store, | 530 WebRTCIdentityStore* webrtc_identity_store, |
554 const base::Time begin, | 531 const base::Time begin, |
555 const base::Time end) { | 532 const base::Time end) { |
556 DCHECK_NE(remove_mask, 0u); | 533 DCHECK_NE(remove_mask, 0u); |
557 DCHECK(!callback.is_null()); | 534 DCHECK(!callback.is_null()); |
558 | 535 |
559 IncrementTaskCountOnUI(); | 536 IncrementTaskCountOnUI(); |
560 base::Closure decrement_callback = base::Bind( | 537 base::Closure decrement_callback = base::Bind( |
561 &DataDeletionHelper::DecrementTaskCountOnUI, base::Unretained(this)); | 538 &DataDeletionHelper::DecrementTaskCountOnUI, base::Unretained(this)); |
562 | 539 |
563 if (remove_mask & REMOVE_DATA_MASK_COOKIES) { | 540 if (remove_mask & REMOVE_DATA_MASK_COOKIES) { |
564 // Handle the cookies. | 541 // Handle the cookies. |
565 IncrementTaskCountOnUI(); | 542 IncrementTaskCountOnUI(); |
566 BrowserThread::PostTask( | 543 cookie_store_map->DeleteCookies(remove_origin, begin, end, |
567 BrowserThread::IO, FROM_HERE, | 544 decrement_callback); |
568 base::Bind(&ClearCookiesOnIOThread, | |
569 make_scoped_refptr(rq_context), begin, end, remove_origin, | |
570 decrement_callback)); | |
571 } | 545 } |
572 | 546 |
573 if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB || | 547 if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB || |
574 remove_mask & REMOVE_DATA_MASK_WEBSQL || | 548 remove_mask & REMOVE_DATA_MASK_WEBSQL || |
575 remove_mask & REMOVE_DATA_MASK_APPCACHE || | 549 remove_mask & REMOVE_DATA_MASK_APPCACHE || |
576 remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS) { | 550 remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS) { |
577 IncrementTaskCountOnUI(); | 551 IncrementTaskCountOnUI(); |
578 BrowserThread::PostTask( | 552 BrowserThread::PostTask( |
579 BrowserThread::IO, FROM_HERE, | 553 BrowserThread::IO, FROM_HERE, |
580 base::Bind(&ClearQuotaManagedDataOnIOThread, | 554 base::Bind(&ClearQuotaManagedDataOnIOThread, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 decrement_callback)); | 593 decrement_callback)); |
620 } | 594 } |
621 | 595 |
622 DecrementTaskCountOnUI(); | 596 DecrementTaskCountOnUI(); |
623 } | 597 } |
624 | 598 |
625 | 599 |
626 void StoragePartitionImpl::ClearDataForOrigin( | 600 void StoragePartitionImpl::ClearDataForOrigin( |
627 uint32 remove_mask, | 601 uint32 remove_mask, |
628 uint32 quota_storage_remove_mask, | 602 uint32 quota_storage_remove_mask, |
629 const GURL& storage_origin, | 603 const GURL& storage_origin) { |
630 net::URLRequestContextGetter* request_context_getter) { | |
631 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 604 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
632 ClearDataImpl(remove_mask, quota_storage_remove_mask, storage_origin, | 605 ClearDataImpl(remove_mask, quota_storage_remove_mask, storage_origin, |
633 request_context_getter, base::Time(), base::Time::Max(), | 606 base::Time(), base::Time::Max(), base::Bind(&base::DoNothing)); |
634 base::Bind(&base::DoNothing)); | |
635 } | 607 } |
636 | 608 |
637 void StoragePartitionImpl::ClearDataForUnboundedRange( | 609 void StoragePartitionImpl::ClearDataForUnboundedRange( |
638 uint32 remove_mask, | 610 uint32 remove_mask, |
639 uint32 quota_storage_remove_mask) { | 611 uint32 quota_storage_remove_mask) { |
640 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), | 612 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), |
641 GetURLRequestContext(), base::Time(), base::Time::Max(), | 613 base::Time(), base::Time::Max(), base::Bind(&base::DoNothing)); |
642 base::Bind(&base::DoNothing)); | |
643 } | 614 } |
644 | 615 |
645 void StoragePartitionImpl::ClearDataForRange(uint32 remove_mask, | 616 void StoragePartitionImpl::ClearDataForRange(uint32 remove_mask, |
646 uint32 quota_storage_remove_mask, | 617 uint32 quota_storage_remove_mask, |
647 const base::Time& begin, | 618 const base::Time& begin, |
648 const base::Time& end, | 619 const base::Time& end, |
649 const base::Closure& callback) { | 620 const base::Closure& callback) { |
650 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), | 621 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), begin, end, |
651 GetURLRequestContext(), begin, end, callback); | 622 callback); |
652 } | 623 } |
653 | 624 |
654 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() { | 625 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() { |
655 return webrtc_identity_store_.get(); | 626 return webrtc_identity_store_.get(); |
656 } | 627 } |
657 | 628 |
| 629 const CookieStoreMap& StoragePartitionImpl::GetCookieStoreMap() { |
| 630 return *cookie_store_map_; |
| 631 } |
| 632 |
658 void StoragePartitionImpl::SetURLRequestContext( | 633 void StoragePartitionImpl::SetURLRequestContext( |
659 net::URLRequestContextGetter* url_request_context) { | 634 net::URLRequestContextGetter* url_request_context) { |
660 url_request_context_ = url_request_context; | 635 url_request_context_ = url_request_context; |
661 } | 636 } |
662 | 637 |
663 void StoragePartitionImpl::SetMediaURLRequestContext( | 638 void StoragePartitionImpl::SetMediaURLRequestContext( |
664 net::URLRequestContextGetter* media_url_request_context) { | 639 net::URLRequestContextGetter* media_url_request_context) { |
665 media_url_request_context_ = media_url_request_context; | 640 media_url_request_context_ = media_url_request_context; |
666 } | 641 } |
667 | 642 |
668 } // namespace content | 643 } // namespace content |
OLD | NEW |