| 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_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // of deleteing the directory, we tell each storage context later to | 512 // of deleteing the directory, we tell each storage context later to |
| 513 // remove any data they have saved. This will leave the directory structure | 513 // remove any data they have saved. This will leave the directory structure |
| 514 // intact but it will only contain empty databases. | 514 // intact but it will only contain empty databases. |
| 515 std::vector<StoragePartitionImpl*> active_partitions; | 515 std::vector<StoragePartitionImpl*> active_partitions; |
| 516 std::vector<base::FilePath> paths_to_keep; | 516 std::vector<base::FilePath> paths_to_keep; |
| 517 for (PartitionMap::const_iterator it = partitions_.begin(); | 517 for (PartitionMap::const_iterator it = partitions_.begin(); |
| 518 it != partitions_.end(); | 518 it != partitions_.end(); |
| 519 ++it) { | 519 ++it) { |
| 520 const StoragePartitionConfig& config = it->first; | 520 const StoragePartitionConfig& config = it->first; |
| 521 if (config.partition_domain == partition_domain) { | 521 if (config.partition_domain == partition_domain) { |
| 522 it->second->AsyncClearAllData(); | 522 it->second->AsyncClearData(StoragePartition::kAllStorage); |
| 523 if (!config.in_memory) { | 523 if (!config.in_memory) { |
| 524 paths_to_keep.push_back(it->second->GetPath()); | 524 paths_to_keep.push_back(it->second->GetPath()); |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 } | 527 } |
| 528 | 528 |
| 529 // Start a best-effort delete of the on-disk storage excluding paths that are | 529 // Start a best-effort delete of the on-disk storage excluding paths that are |
| 530 // known to still be in use. This is to delete any previously created | 530 // known to still be in use. This is to delete any previously created |
| 531 // StoragePartition state that just happens to not have been used during this | 531 // StoragePartition state that just happens to not have been used during this |
| 532 // run of the browser. | 532 // run of the browser. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 602 |
| 603 // We do not call InitializeURLRequestContext() for media contexts because, | 603 // We do not call InitializeURLRequestContext() for media contexts because, |
| 604 // other than the HTTP cache, the media contexts share the same backing | 604 // other than the HTTP cache, the media contexts share the same backing |
| 605 // objects as their associated "normal" request context. Thus, the previous | 605 // objects as their associated "normal" request context. Thus, the previous |
| 606 // call serves to initialize the media request context for this storage | 606 // call serves to initialize the media request context for this storage |
| 607 // partition as well. | 607 // partition as well. |
| 608 } | 608 } |
| 609 } | 609 } |
| 610 | 610 |
| 611 } // namespace content | 611 } // namespace content |
| OLD | NEW |