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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 // of deleteing the directory, we tell each storage context later to | 453 // of deleteing the directory, we tell each storage context later to |
454 // remove any data they have saved. This will leave the directory structure | 454 // remove any data they have saved. This will leave the directory structure |
455 // intact but it will only contain empty databases. | 455 // intact but it will only contain empty databases. |
456 std::vector<StoragePartitionImpl*> active_partitions; | 456 std::vector<StoragePartitionImpl*> active_partitions; |
457 std::vector<base::FilePath> paths_to_keep; | 457 std::vector<base::FilePath> paths_to_keep; |
458 for (PartitionMap::const_iterator it = partitions_.begin(); | 458 for (PartitionMap::const_iterator it = partitions_.begin(); |
459 it != partitions_.end(); | 459 it != partitions_.end(); |
460 ++it) { | 460 ++it) { |
461 const StoragePartitionConfig& config = it->first; | 461 const StoragePartitionConfig& config = it->first; |
462 if (config.partition_domain == partition_domain) { | 462 if (config.partition_domain == partition_domain) { |
463 it->second->ClearDataForUnboundedRange( | 463 it->second->ClearData( |
464 // All except shader cache. | 464 // All except shader cache. |
465 StoragePartition::REMOVE_DATA_MASK_ALL & | 465 StoragePartition::REMOVE_DATA_MASK_ALL & |
466 (~StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE), | 466 (~StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE), |
467 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL); | 467 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, |
| 468 NULL, |
| 469 StoragePartition::OriginMatcherFunction(), |
| 470 base::Time(), base::Time::Max(), |
| 471 base::Bind(&base::DoNothing)); |
468 if (!config.in_memory) { | 472 if (!config.in_memory) { |
469 paths_to_keep.push_back(it->second->GetPath()); | 473 paths_to_keep.push_back(it->second->GetPath()); |
470 } | 474 } |
471 } | 475 } |
472 } | 476 } |
473 | 477 |
474 // Start a best-effort delete of the on-disk storage excluding paths that are | 478 // Start a best-effort delete of the on-disk storage excluding paths that are |
475 // known to still be in use. This is to delete any previously created | 479 // known to still be in use. This is to delete any previously created |
476 // StoragePartition state that just happens to not have been used during this | 480 // StoragePartition state that just happens to not have been used during this |
477 // run of the browser. | 481 // run of the browser. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 | 551 |
548 // We do not call InitializeURLRequestContext() for media contexts because, | 552 // We do not call InitializeURLRequestContext() for media contexts because, |
549 // other than the HTTP cache, the media contexts share the same backing | 553 // other than the HTTP cache, the media contexts share the same backing |
550 // objects as their associated "normal" request context. Thus, the previous | 554 // objects as their associated "normal" request context. Thus, the previous |
551 // call serves to initialize the media request context for this storage | 555 // call serves to initialize the media request context for this storage |
552 // partition as well. | 556 // partition as well. |
553 } | 557 } |
554 } | 558 } |
555 | 559 |
556 } // namespace content | 560 } // namespace content |
OLD | NEW |