| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/sync_file_system/local/local_file_sync_status.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "storage/common/fileapi/file_system_util.h" | 10 #include "storage/common/fileapi/file_system_util.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // |normalized_path| since |normalized_path| has trailing path separator. | 54 // |normalized_path| since |normalized_path| has trailing path separator. |
| 55 typename Container::const_iterator upper = | 55 typename Container::const_iterator upper = |
| 56 paths.upper_bound(normalized_path); | 56 paths.upper_bound(normalized_path); |
| 57 | 57 |
| 58 if (upper != paths.end() && | 58 if (upper != paths.end() && |
| 59 normalized_path.IsParent(get_key_helper.GetKey(upper))) | 59 normalized_path.IsParent(get_key_helper.GetKey(upper))) |
| 60 return true; | 60 return true; |
| 61 | 61 |
| 62 // Check if any ancestor of |normalized_path| is in |writing_|. | 62 // Check if any ancestor of |normalized_path| is in |writing_|. |
| 63 while (true) { | 63 while (true) { |
| 64 if (ContainsKey(paths, normalized_path)) | 64 if (base::ContainsKey(paths, normalized_path)) |
| 65 return true; | 65 return true; |
| 66 | 66 |
| 67 if (storage::VirtualPath::IsRootPath(normalized_path)) | 67 if (storage::VirtualPath::IsRootPath(normalized_path)) |
| 68 return false; | 68 return false; |
| 69 | 69 |
| 70 normalized_path = | 70 normalized_path = |
| 71 NormalizePath(storage::VirtualPath::DirName(normalized_path)); | 71 NormalizePath(storage::VirtualPath::DirName(normalized_path)); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 const FileSystemURL& url) const { | 157 const FileSystemURL& url) const { |
| 158 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 158 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 159 URLSet::const_iterator found = syncing_.find(GetOriginAndType(url)); | 159 URLSet::const_iterator found = syncing_.find(GetOriginAndType(url)); |
| 160 if (found == syncing_.end()) | 160 if (found == syncing_.end()) |
| 161 return false; | 161 return false; |
| 162 return ContainsChildOrParent(found->second, url.path(), | 162 return ContainsChildOrParent(found->second, url.path(), |
| 163 SetKeyHelper()); | 163 SetKeyHelper()); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace sync_file_system | 166 } // namespace sync_file_system |
| OLD | NEW |