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

Unified Diff: content/browser/storage_partition_impl_map.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/storage_partition_impl_map.cc
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc
index ba3e36f195657e0d853e8d015777733f61c28902..d3586ed6db6ffe2e36c9641dfe129b277e344047 100644
--- a/content/browser/storage_partition_impl_map.cc
+++ b/content/browser/storage_partition_impl_map.cc
@@ -254,7 +254,7 @@ void BlockingObliteratePath(
const std::vector<base::FilePath>& paths_to_keep,
const scoped_refptr<base::TaskRunner>& closure_runner,
const base::Closure& on_gc_required) {
- // Early exit required because file_util::AbsolutePath() will fail on POSIX
+ // Early exit required because MakeAbsoluteFilePath() will fail on POSIX
// if |unnormalized_root| does not exist. This is safe because there is
// nothing to do in this situation anwyays.
if (!file_util::PathExists(unnormalized_root)) {
@@ -263,12 +263,12 @@ void BlockingObliteratePath(
// Never try to obliterate things outside of the browser context root or the
// browser context root itself. Die hard.
- base::FilePath root = unnormalized_root;
- base::FilePath browser_context_root = unnormalized_browser_context_root;
- CHECK(file_util::AbsolutePath(&root));
- CHECK(file_util::AbsolutePath(&browser_context_root));
- CHECK(file_util::ContainsPath(browser_context_root, root) &&
- browser_context_root != root);
+ base::FilePath root = base::MakeAbsoluteFilePath(unnormalized_root);
+ base::FilePath browser_context_root =
+ base::MakeAbsoluteFilePath(unnormalized_browser_context_root);
+ CHECK(!root.empty());
+ CHECK(!browser_context_root.empty());
+ CHECK(browser_context_root.IsParent(root) && browser_context_root != root);
// Reduce |paths_to_keep| set to those under the root and actually on disk.
std::vector<base::FilePath> valid_paths_to_keep;

Powered by Google App Engine
This is Rietveld 408576698