| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // intact but it will only contain empty databases. | 487 // intact but it will only contain empty databases. |
| 488 std::vector<StoragePartitionImpl*> active_partitions; | 488 std::vector<StoragePartitionImpl*> active_partitions; |
| 489 std::vector<base::FilePath> paths_to_keep; | 489 std::vector<base::FilePath> paths_to_keep; |
| 490 for (PartitionMap::const_iterator it = partitions_.begin(); | 490 for (PartitionMap::const_iterator it = partitions_.begin(); |
| 491 it != partitions_.end(); | 491 it != partitions_.end(); |
| 492 ++it) { | 492 ++it) { |
| 493 const StoragePartitionConfig& config = it->first; | 493 const StoragePartitionConfig& config = it->first; |
| 494 if (config.partition_domain == partition_domain) { | 494 if (config.partition_domain == partition_domain) { |
| 495 it->second->ClearData( | 495 it->second->ClearData( |
| 496 // All except shader cache. | 496 // All except shader cache. |
| 497 StoragePartition::REMOVE_DATA_MASK_ALL & | 497 ~StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE, |
| 498 (~StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE), | |
| 499 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, | 498 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, |
| 500 GURL(), | 499 GURL(), |
| 501 StoragePartition::OriginMatcherFunction(), | 500 StoragePartition::OriginMatcherFunction(), |
| 502 base::Time(), base::Time::Max(), | 501 base::Time(), base::Time::Max(), |
| 503 base::Bind(&base::DoNothing)); | 502 base::Bind(&base::DoNothing)); |
| 504 if (!config.in_memory) { | 503 if (!config.in_memory) { |
| 505 paths_to_keep.push_back(it->second->GetPath()); | 504 paths_to_keep.push_back(it->second->GetPath()); |
| 506 } | 505 } |
| 507 } | 506 } |
| 508 } | 507 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 582 |
| 584 // We do not call InitializeURLRequestContext() for media contexts because, | 583 // We do not call InitializeURLRequestContext() for media contexts because, |
| 585 // other than the HTTP cache, the media contexts share the same backing | 584 // other than the HTTP cache, the media contexts share the same backing |
| 586 // objects as their associated "normal" request context. Thus, the previous | 585 // objects as their associated "normal" request context. Thus, the previous |
| 587 // call serves to initialize the media request context for this storage | 586 // call serves to initialize the media request context for this storage |
| 588 // partition as well. | 587 // partition as well. |
| 589 } | 588 } |
| 590 } | 589 } |
| 591 | 590 |
| 592 } // namespace content | 591 } // namespace content |
| OLD | NEW |