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

Side by Side Diff: storage/browser/fileapi/dragged_file_util.cc

Issue 669603008: Standardize usage of virtual/override/final in storage/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
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 "storage/browser/fileapi/dragged_file_util.h" 5 #include "storage/browser/fileapi/dragged_file_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 11 matching lines...) Expand all
22 namespace { 22 namespace {
23 23
24 // Simply enumerate each path from a given fileinfo set. 24 // Simply enumerate each path from a given fileinfo set.
25 // Used to enumerate top-level paths of an isolated filesystem. 25 // Used to enumerate top-level paths of an isolated filesystem.
26 class SetFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { 26 class SetFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
27 public: 27 public:
28 explicit SetFileEnumerator(const std::vector<FileInfo>& files) 28 explicit SetFileEnumerator(const std::vector<FileInfo>& files)
29 : files_(files) { 29 : files_(files) {
30 file_iter_ = files_.begin(); 30 file_iter_ = files_.begin();
31 } 31 }
32 virtual ~SetFileEnumerator() {} 32 ~SetFileEnumerator() override {}
33 33
34 // AbstractFileEnumerator overrides. 34 // AbstractFileEnumerator overrides.
35 virtual base::FilePath Next() override { 35 base::FilePath Next() override {
36 if (file_iter_ == files_.end()) 36 if (file_iter_ == files_.end())
37 return base::FilePath(); 37 return base::FilePath();
38 base::FilePath platform_file = (file_iter_++)->path; 38 base::FilePath platform_file = (file_iter_++)->path;
39 NativeFileUtil::GetFileInfo(platform_file, &file_info_); 39 NativeFileUtil::GetFileInfo(platform_file, &file_info_);
40 return platform_file; 40 return platform_file;
41 } 41 }
42 virtual int64 Size() override { return file_info_.size; } 42 int64 Size() override { return file_info_.size; }
43 virtual bool IsDirectory() override { return file_info_.is_directory; } 43 bool IsDirectory() override { return file_info_.is_directory; }
44 virtual base::Time LastModifiedTime() override { 44 base::Time LastModifiedTime() override { return file_info_.last_modified; }
45 return file_info_.last_modified;
46 }
47 45
48 private: 46 private:
49 std::vector<FileInfo> files_; 47 std::vector<FileInfo> files_;
50 std::vector<FileInfo>::const_iterator file_iter_; 48 std::vector<FileInfo>::const_iterator file_iter_;
51 base::File::Info file_info_; 49 base::File::Info file_info_;
52 }; 50 };
53 51
54 } // namespace 52 } // namespace
55 53
56 //------------------------------------------------------------------------- 54 //-------------------------------------------------------------------------
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return LocalFileUtil::CreateFileEnumerator(context, root); 94 return LocalFileUtil::CreateFileEnumerator(context, root);
97 95
98 // Root path case. 96 // Root path case.
99 std::vector<FileInfo> toplevels; 97 std::vector<FileInfo> toplevels;
100 IsolatedContext::GetInstance()->GetDraggedFileInfo( 98 IsolatedContext::GetInstance()->GetDraggedFileInfo(
101 root.filesystem_id(), &toplevels); 99 root.filesystem_id(), &toplevels);
102 return scoped_ptr<AbstractFileEnumerator>(new SetFileEnumerator(toplevels)); 100 return scoped_ptr<AbstractFileEnumerator>(new SetFileEnumerator(toplevels));
103 } 101 }
104 102
105 } // namespace storage 103 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/fileapi/dragged_file_util.h ('k') | storage/browser/fileapi/external_mount_points.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698