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

Side by Side Diff: webkit/fileapi/isolated_file_util.cc

Issue 11960003: Cleanup: Move more recursive operation logic from FileUtilHelper to FileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/isolated_file_util.h ('k') | webkit/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/fileapi/isolated_file_util.h" 5 #include "webkit/fileapi/isolated_file_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "webkit/blob/shareable_file_reference.h" 10 #include "webkit/blob/shareable_file_reference.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 IsolatedContext::GetInstance()->GetDraggedFileInfo( 172 IsolatedContext::GetInstance()->GetDraggedFileInfo(
173 root.filesystem_id(), &toplevels); 173 root.filesystem_id(), &toplevels);
174 if (!recursive) { 174 if (!recursive) {
175 return make_scoped_ptr(new SetFileEnumerator(toplevels)) 175 return make_scoped_ptr(new SetFileEnumerator(toplevels))
176 .PassAs<FileSystemFileUtil::AbstractFileEnumerator>(); 176 .PassAs<FileSystemFileUtil::AbstractFileEnumerator>();
177 } 177 }
178 return make_scoped_ptr(new RecursiveSetFileEnumerator(toplevels)) 178 return make_scoped_ptr(new RecursiveSetFileEnumerator(toplevels))
179 .PassAs<FileSystemFileUtil::AbstractFileEnumerator>(); 179 .PassAs<FileSystemFileUtil::AbstractFileEnumerator>();
180 } 180 }
181 181
182 bool DraggedFileUtil::IsDirectoryEmpty(
183 FileSystemOperationContext* context,
184 const FileSystemURL& url) {
185 DCHECK(url.is_valid());
186 if (url.path().empty()) {
187 // The root directory case.
188 std::vector<FileInfo> toplevels;
189 bool success = IsolatedContext::GetInstance()->GetDraggedFileInfo(
190 url.filesystem_id(), &toplevels);
191 DCHECK(success);
192 return toplevels.empty();
193 }
194 return NativeFileUtil::IsDirectoryEmpty(url.path());
195 }
196
197 } // namespace fileapi 182 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/isolated_file_util.h ('k') | webkit/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698