summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/syncable/local_file_sync_status.cc
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 14:56:13 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 14:56:13 +0000
commit5dca49ebea4644ca5ca961996af2450876ceb30e (patch)
tree0015c4bf9314e5b6f55ffd8f0755587d758bf331 /webkit/fileapi/syncable/local_file_sync_status.cc
parent59c51f15f2eaba24e3571e24a7302b0c8f963c40 (diff)
downloadchromium_src-5dca49ebea4644ca5ca961996af2450876ceb30e.zip
chromium_src-5dca49ebea4644ca5ca961996af2450876ceb30e.tar.gz
chromium_src-5dca49ebea4644ca5ca961996af2450876ceb30e.tar.bz2
Adding FileSystemURL::IsParent
BUG=148897 TEST=FileSystemURLTest.IsParent Review URL: https://codereview.chromium.org/11093047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/syncable/local_file_sync_status.cc')
-rw-r--r--webkit/fileapi/syncable/local_file_sync_status.cc18
1 files changed, 4 insertions, 14 deletions
diff --git a/webkit/fileapi/syncable/local_file_sync_status.cc b/webkit/fileapi/syncable/local_file_sync_status.cc
index 5e153a4..0ef59f6 100644
--- a/webkit/fileapi/syncable/local_file_sync_status.cc
+++ b/webkit/fileapi/syncable/local_file_sync_status.cc
@@ -6,16 +6,6 @@
namespace fileapi {
-namespace {
-
-bool IsParent(const FileSystemURL& a, const FileSystemURL& b) {
- return a.origin() == b.origin() &&
- a.type() == b.type() &&
- a.path().IsParent(b.path());
-}
-
-} // namespace
-
LocalFileSyncStatus::LocalFileSyncStatus() {}
LocalFileSyncStatus::~LocalFileSyncStatus() {
@@ -71,10 +61,10 @@ bool LocalFileSyncStatus::IsChildOrParentWriting(
lock_.AssertAcquired();
URLCountMap::const_iterator upper = writing_.upper_bound(url);
URLCountMap::const_reverse_iterator rupper(upper);
- if (upper != writing_.end() && IsParent(url, upper->first))
+ if (upper != writing_.end() && url.IsParent(upper->first))
return true;
if (rupper != writing_.rend() &&
- (rupper->first == url || IsParent(rupper->first, url)))
+ (rupper->first == url || rupper->first.IsParent(url)))
return true;
return false;
}
@@ -84,10 +74,10 @@ bool LocalFileSyncStatus::IsChildOrParentSyncing(
lock_.AssertAcquired();
URLSet::const_iterator upper = syncing_.upper_bound(url);
URLSet::const_reverse_iterator rupper(upper);
- if (upper != syncing_.end() && IsParent(url, *upper))
+ if (upper != syncing_.end() && url.IsParent(*upper))
return true;
if (rupper != syncing_.rend() &&
- (*rupper == url || IsParent(*rupper, url)))
+ (*rupper == url || rupper->IsParent(url)))
return true;
return false;
}