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" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 const GURL& remove_origin) { | 448 const GURL& remove_origin) { |
449 std::set<GURL> origins; | 449 std::set<GURL> origins; |
450 if (!remove_origin.is_empty()) | 450 if (!remove_origin.is_empty()) |
451 origins.insert(remove_origin); | 451 origins.insert(remove_origin); |
452 | 452 |
453 IncrementTaskCountOnIO(); | 453 IncrementTaskCountOnIO(); |
454 base::Closure decrement_callback = base::Bind( | 454 base::Closure decrement_callback = base::Bind( |
455 &QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO, | 455 &QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO, |
456 base::Unretained(this)); | 456 base::Unretained(this)); |
457 | 457 |
458 if (quota_storage_remove_mask & kQuotaManagedPersistentStorage) { | 458 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_PERSISTENT) { |
459 IncrementTaskCountOnIO(); | 459 IncrementTaskCountOnIO(); |
460 if (origins.empty()) { // Remove for all origins. | 460 if (origins.empty()) { // Remove for all origins. |
461 // Ask the QuotaManager for all origins with temporary quota modified | 461 // Ask the QuotaManager for all origins with temporary quota modified |
462 // within the user-specified timeframe, and deal with the resulting set in | 462 // within the user-specified timeframe, and deal with the resulting set in |
463 // ClearQuotaManagedOriginsOnIOThread(). | 463 // ClearQuotaManagedOriginsOnIOThread(). |
464 quota_manager->GetOriginsModifiedSince( | 464 quota_manager->GetOriginsModifiedSince( |
465 quota::kStorageTypePersistent, begin, | 465 quota::kStorageTypePersistent, begin, |
466 base::Bind(&ClearQuotaManagedOriginsOnIOThread, | 466 base::Bind(&ClearQuotaManagedOriginsOnIOThread, |
467 quota_manager, remove_mask, decrement_callback)); | 467 quota_manager, remove_mask, decrement_callback)); |
468 } else { | 468 } else { |
469 ClearQuotaManagedOriginsOnIOThread( | 469 ClearQuotaManagedOriginsOnIOThread( |
470 quota_manager, remove_mask, decrement_callback, | 470 quota_manager, remove_mask, decrement_callback, |
471 origins, quota::kStorageTypePersistent); | 471 origins, quota::kStorageTypePersistent); |
472 } | 472 } |
473 } | 473 } |
474 | 474 |
475 // Do the same for temporary quota. | 475 // Do the same for temporary quota. |
476 if (quota_storage_remove_mask & kQuotaManagedTemporaryStorage) { | 476 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_TEMPORARY) { |
477 IncrementTaskCountOnIO(); | 477 IncrementTaskCountOnIO(); |
478 if (origins.empty()) { // Remove for all origins. | 478 if (origins.empty()) { // Remove for all origins. |
479 quota_manager->GetOriginsModifiedSince( | 479 quota_manager->GetOriginsModifiedSince( |
480 quota::kStorageTypeTemporary, begin, | 480 quota::kStorageTypeTemporary, begin, |
481 base::Bind(&ClearQuotaManagedOriginsOnIOThread, | 481 base::Bind(&ClearQuotaManagedOriginsOnIOThread, |
482 quota_manager, remove_mask, decrement_callback)); | 482 quota_manager, remove_mask, decrement_callback)); |
483 } else { | 483 } else { |
484 ClearQuotaManagedOriginsOnIOThread( | 484 ClearQuotaManagedOriginsOnIOThread( |
485 quota_manager, remove_mask, decrement_callback, | 485 quota_manager, remove_mask, decrement_callback, |
486 origins, quota::kStorageTypeTemporary); | 486 origins, quota::kStorageTypeTemporary); |
487 } | 487 } |
488 } | 488 } |
489 | 489 |
490 // Do the same for syncable quota. | 490 // Do the same for syncable quota. |
491 if (quota_storage_remove_mask & kQuotaManagedSyncableStorage) { | 491 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_SYNCABLE) { |
492 IncrementTaskCountOnIO(); | 492 IncrementTaskCountOnIO(); |
493 if (origins.empty()) { // Remove for all origins. | 493 if (origins.empty()) { // Remove for all origins. |
494 quota_manager->GetOriginsModifiedSince( | 494 quota_manager->GetOriginsModifiedSince( |
495 quota::kStorageTypeSyncable, begin, | 495 quota::kStorageTypeSyncable, begin, |
496 base::Bind(&ClearQuotaManagedOriginsOnIOThread, | 496 base::Bind(&ClearQuotaManagedOriginsOnIOThread, |
497 quota_manager, remove_mask, decrement_callback)); | 497 quota_manager, remove_mask, decrement_callback)); |
498 } else { | 498 } else { |
499 ClearQuotaManagedOriginsOnIOThread( | 499 ClearQuotaManagedOriginsOnIOThread( |
500 quota_manager, remove_mask, decrement_callback, | 500 quota_manager, remove_mask, decrement_callback, |
501 origins, quota::kStorageTypeSyncable); | 501 origins, quota::kStorageTypeSyncable); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 net::URLRequestContextGetter* url_request_context) { | 630 net::URLRequestContextGetter* url_request_context) { |
631 url_request_context_ = url_request_context; | 631 url_request_context_ = url_request_context; |
632 } | 632 } |
633 | 633 |
634 void StoragePartitionImpl::SetMediaURLRequestContext( | 634 void StoragePartitionImpl::SetMediaURLRequestContext( |
635 net::URLRequestContextGetter* media_url_request_context) { | 635 net::URLRequestContextGetter* media_url_request_context) { |
636 media_url_request_context_ = media_url_request_context; | 636 media_url_request_context_ = media_url_request_context; |
637 } | 637 } |
638 | 638 |
639 } // namespace content | 639 } // namespace content |
OLD | NEW |