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

Unified Diff: base/file_path.cc

Issue 174053: Set OS X cache directory to ~/Library/Caches/[app name]/[profile name] (Closed)
Patch Set: Addressed Mark's comments Created 11 years, 3 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: base/file_path.cc
diff --git a/base/file_path.cc b/base/file_path.cc
index a521b3790f5178eb9a5172e1573dea3b14859ebb..1d906741c2f1f1c50de9e1dee17f5ee0bd9b4552 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -159,6 +159,11 @@ bool FilePath::operator!=(const FilePath& that) const {
}
bool FilePath::IsParent(const FilePath& child) const {
+ return AppendRelativePath(child, NULL);
+}
+
+bool FilePath::AppendRelativePath(const FilePath& child,
+ FilePath* path) const {
std::vector<FilePath::StringType> parent_components;
std::vector<FilePath::StringType> child_components;
GetComponents(&parent_components);
@@ -194,6 +199,11 @@ bool FilePath::IsParent(const FilePath& child) const {
++child_comp;
}
+ if (path != NULL) {
+ for (; child_comp != child_components.end(); ++child_comp) {
+ *path = path->Append(*child_comp);
+ }
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698