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

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: Created 7 years, 9 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 16111cf876c410588695f487738375e8775890c8..5156c3c0d7b7f410153c04586b9161e2a6285cdc 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 AsAbsolute() 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 = unnormalized_root.AsAbsolute();
+ base::FilePath browser_context_root =
+ unnormalized_browser_context_root.AsAbsolute();
+ 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