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

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

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iwyu fixes Created 4 years, 8 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 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 class RequestManager; 43 class RequestManager;
44 44
45 // Path of a sample fake file, which is added to the fake file system by 45 // Path of a sample fake file, which is added to the fake file system by
46 // default. 46 // default.
47 extern const base::FilePath::CharType kFakeFilePath[]; 47 extern const base::FilePath::CharType kFakeFilePath[];
48 48
49 // Represents a file or a directory on a fake file system. 49 // Represents a file or a directory on a fake file system.
50 struct FakeEntry { 50 struct FakeEntry {
51 FakeEntry(); 51 FakeEntry();
52 FakeEntry(scoped_ptr<EntryMetadata> metadata, const std::string& contents); 52 FakeEntry(std::unique_ptr<EntryMetadata> metadata,
53 const std::string& contents);
53 ~FakeEntry(); 54 ~FakeEntry();
54 55
55 scoped_ptr<EntryMetadata> metadata; 56 std::unique_ptr<EntryMetadata> metadata;
56 std::string contents; 57 std::string contents;
57 58
58 private: 59 private:
59 DISALLOW_COPY_AND_ASSIGN(FakeEntry); 60 DISALLOW_COPY_AND_ASSIGN(FakeEntry);
60 }; 61 };
61 62
62 // Fake provided file system implementation. Does not communicate with target 63 // Fake provided file system implementation. Does not communicate with target
63 // extensions. Used for unit tests. 64 // extensions. Used for unit tests.
64 class FakeProvidedFileSystem : public ProvidedFileSystemInterface { 65 class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
65 public: 66 public:
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 const storage::AsyncFileUtil::StatusCallback& callback) override; 154 const storage::AsyncFileUtil::StatusCallback& callback) override;
154 const ProvidedFileSystemInfo& GetFileSystemInfo() const override; 155 const ProvidedFileSystemInfo& GetFileSystemInfo() const override;
155 RequestManager* GetRequestManager() override; 156 RequestManager* GetRequestManager() override;
156 Watchers* GetWatchers() override; 157 Watchers* GetWatchers() override;
157 const OpenedFiles& GetOpenedFiles() const override; 158 const OpenedFiles& GetOpenedFiles() const override;
158 void AddObserver(ProvidedFileSystemObserver* observer) override; 159 void AddObserver(ProvidedFileSystemObserver* observer) override;
159 void RemoveObserver(ProvidedFileSystemObserver* observer) override; 160 void RemoveObserver(ProvidedFileSystemObserver* observer) override;
160 void Notify(const base::FilePath& entry_path, 161 void Notify(const base::FilePath& entry_path,
161 bool recursive, 162 bool recursive,
162 storage::WatcherManager::ChangeType change_type, 163 storage::WatcherManager::ChangeType change_type,
163 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, 164 std::unique_ptr<ProvidedFileSystemObserver::Changes> changes,
164 const std::string& tag, 165 const std::string& tag,
165 const storage::AsyncFileUtil::StatusCallback& callback) override; 166 const storage::AsyncFileUtil::StatusCallback& callback) override;
166 void Configure( 167 void Configure(
167 const storage::AsyncFileUtil::StatusCallback& callback) override; 168 const storage::AsyncFileUtil::StatusCallback& callback) override;
168 base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; 169 base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override;
169 170
170 // Factory callback, to be used in Service::SetFileSystemFactory(). The 171 // Factory callback, to be used in Service::SetFileSystemFactory(). The
171 // |event_router| argument can be NULL. 172 // |event_router| argument can be NULL.
172 static ProvidedFileSystemInterface* Create( 173 static ProvidedFileSystemInterface* Create(
173 Profile* profile, 174 Profile* profile,
(...skipping 24 matching lines...) Expand all
198 Watchers watchers_; 199 Watchers watchers_;
199 200
200 base::WeakPtrFactory<FakeProvidedFileSystem> weak_ptr_factory_; 201 base::WeakPtrFactory<FakeProvidedFileSystem> weak_ptr_factory_;
201 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem); 202 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem);
202 }; 203 };
203 204
204 } // namespace file_system_provider 205 } // namespace file_system_provider
205 } // namespace chromeos 206 } // namespace chromeos
206 207
207 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE M_H_ 208 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE M_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698