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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h

Issue 389973002: [fsp] Add support for moving files within a provided file system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H _ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H _
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H _ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H _
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 const base::FilePath& entry_path, 95 const base::FilePath& entry_path,
96 bool recursive, 96 bool recursive,
97 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; 97 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
98 virtual void CreateFile( 98 virtual void CreateFile(
99 const base::FilePath& file_path, 99 const base::FilePath& file_path,
100 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; 100 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
101 virtual void CopyEntry( 101 virtual void CopyEntry(
102 const base::FilePath& source_path, 102 const base::FilePath& source_path,
103 const base::FilePath& target_path, 103 const base::FilePath& target_path,
104 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; 104 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
105 virtual void MoveEntry(
106 const base::FilePath& source_path,
107 const base::FilePath& target_path,
108 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
105 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; 109 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
106 virtual RequestManager* GetRequestManager() OVERRIDE; 110 virtual RequestManager* GetRequestManager() OVERRIDE;
107 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; 111 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE;
108 112
109 // Factory callback, to be used in Service::SetFileSystemFactory(). The 113 // Factory callback, to be used in Service::SetFileSystemFactory(). The
110 // |event_router| argument can be NULL. 114 // |event_router| argument can be NULL.
111 static ProvidedFileSystemInterface* Create( 115 static ProvidedFileSystemInterface* Create(
112 Profile* profile, 116 Profile* profile,
113 const ProvidedFileSystemInfo& file_system_info); 117 const ProvidedFileSystemInfo& file_system_info);
114 118
115 private: 119 private:
116 typedef std::map<base::FilePath, FakeEntry> Entries; 120 typedef std::map<base::FilePath, FakeEntry> Entries;
117 typedef std::map<int, base::FilePath> OpenedFilesMap; 121 typedef std::map<int, base::FilePath> OpenedFilesMap;
118 122
119 ProvidedFileSystemInfo file_system_info_; 123 ProvidedFileSystemInfo file_system_info_;
120 Entries entries_; 124 Entries entries_;
121 OpenedFilesMap opened_files_; 125 OpenedFilesMap opened_files_;
122 int last_file_handle_; 126 int last_file_handle_;
123 127
124 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_; 128 base::WeakPtrFactory<ProvidedFileSystemInterface> weak_ptr_factory_;
125 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); 129 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem);
126 }; 130 };
127 131
128 } // namespace file_system_provider 132 } // namespace file_system_provider
129 } // namespace chromeos 133 } // namespace chromeos
130 134
131 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE M_H_ 135 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE M_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698