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_map.h" | 5 #include "content/browser/storage_partition_impl_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } | 513 } |
514 | 514 |
515 // Start a best-effort delete of the on-disk storage excluding paths that are | 515 // Start a best-effort delete of the on-disk storage excluding paths that are |
516 // known to still be in use. This is to delete any previously created | 516 // known to still be in use. This is to delete any previously created |
517 // StoragePartition state that just happens to not have been used during this | 517 // StoragePartition state that just happens to not have been used during this |
518 // run of the browser. | 518 // run of the browser. |
519 base::FilePath domain_root = browser_context_->GetPath().Append( | 519 base::FilePath domain_root = browser_context_->GetPath().Append( |
520 GetStoragePartitionDomainPath(partition_domain)); | 520 GetStoragePartitionDomainPath(partition_domain)); |
521 | 521 |
522 base::PostTaskWithTraits( | 522 base::PostTaskWithTraits( |
523 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 523 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
524 base::TaskPriority::BACKGROUND), | |
525 base::Bind(&BlockingObliteratePath, browser_context_->GetPath(), | 524 base::Bind(&BlockingObliteratePath, browser_context_->GetPath(), |
526 domain_root, paths_to_keep, | 525 domain_root, paths_to_keep, |
527 base::ThreadTaskRunnerHandle::Get(), on_gc_required)); | 526 base::ThreadTaskRunnerHandle::Get(), on_gc_required)); |
528 } | 527 } |
529 | 528 |
530 void StoragePartitionImplMap::GarbageCollect( | 529 void StoragePartitionImplMap::GarbageCollect( |
531 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, | 530 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, |
532 const base::Closure& done) { | 531 const base::Closure& done) { |
533 // Include all paths for current StoragePartitions in the active_paths since | 532 // Include all paths for current StoragePartitions in the active_paths since |
534 // they cannot be deleted safely. | 533 // they cannot be deleted safely. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 | 608 |
610 // We do not call InitializeURLRequestContext() for media contexts because, | 609 // We do not call InitializeURLRequestContext() for media contexts because, |
611 // other than the HTTP cache, the media contexts share the same backing | 610 // other than the HTTP cache, the media contexts share the same backing |
612 // objects as their associated "normal" request context. Thus, the previous | 611 // objects as their associated "normal" request context. Thus, the previous |
613 // call serves to initialize the media request context for this storage | 612 // call serves to initialize the media request context for this storage |
614 // partition as well. | 613 // partition as well. |
615 } | 614 } |
616 } | 615 } |
617 | 616 |
618 } // namespace content | 617 } // namespace content |
OLD | NEW |