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

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

Issue 11648027: Extract external file systems handling from isolated context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
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"
11 #include "webkit/fileapi/file_system_context.h" 11 #include "webkit/fileapi/file_system_context.h"
12 #include "webkit/fileapi/file_system_operation_context.h" 12 #include "webkit/fileapi/file_system_operation_context.h"
13 #include "webkit/fileapi/file_system_url.h" 13 #include "webkit/fileapi/file_system_url.h"
14 #include "webkit/fileapi/isolated_context.h" 14 #include "webkit/fileapi/isolated_context.h"
15 #include "webkit/fileapi/native_file_util.h" 15 #include "webkit/fileapi/native_file_util.h"
16 16
17 using base::PlatformFileError; 17 using base::PlatformFileError;
18 using base::PlatformFileInfo; 18 using base::PlatformFileInfo;
19 19
20 namespace fileapi { 20 namespace fileapi {
21 21
22 typedef IsolatedContext::FileInfo FileInfo; 22 typedef IsolatedContext::MountPointInfo FileInfo;
23 23
24 namespace { 24 namespace {
25 25
26 // Simply enumerate each path from a given fileinfo set. 26 // Simply enumerate each path from a given fileinfo set.
27 // Used to enumerate top-level paths of an isolated filesystem. 27 // Used to enumerate top-level paths of an isolated filesystem.
28 class SetFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { 28 class SetFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
29 public: 29 public:
30 explicit SetFileEnumerator(const std::vector<FileInfo>& files) 30 explicit SetFileEnumerator(const std::vector<FileInfo>& files)
31 : files_(files) { 31 : files_(files) {
32 file_iter_ = files_.begin(); 32 file_iter_ = files_.begin();
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 std::vector<FileInfo> toplevels; 188 std::vector<FileInfo> toplevels;
189 bool success = IsolatedContext::GetInstance()->GetDraggedFileInfo( 189 bool success = IsolatedContext::GetInstance()->GetDraggedFileInfo(
190 url.filesystem_id(), &toplevels); 190 url.filesystem_id(), &toplevels);
191 DCHECK(success); 191 DCHECK(success);
192 return toplevels.empty(); 192 return toplevels.empty();
193 } 193 }
194 return NativeFileUtil::IsDirectoryEmpty(url.path()); 194 return NativeFileUtil::IsDirectoryEmpty(url.path());
195 } 195 }
196 196
197 } // namespace 197 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698