Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: content/browser/storage_partition_impl_map.cc

Issue 37843003: BrowsingDataRemover, (re)use StoragePartition deletion code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase @tott. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698