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

Side by Side Diff: content/public/test/test_file_system_backend.h

Issue 549413003: [ew] Move operation observers from QuotaUtil to FileSystemBackend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 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 #ifndef CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_
6 #define CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( 57 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader(
58 const storage::FileSystemURL& url, 58 const storage::FileSystemURL& url,
59 int64 offset, 59 int64 offset,
60 const base::Time& expected_modification_time, 60 const base::Time& expected_modification_time,
61 storage::FileSystemContext* context) const OVERRIDE; 61 storage::FileSystemContext* context) const OVERRIDE;
62 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( 62 virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter(
63 const storage::FileSystemURL& url, 63 const storage::FileSystemURL& url,
64 int64 offset, 64 int64 offset,
65 storage::FileSystemContext* context) const OVERRIDE; 65 storage::FileSystemContext* context) const OVERRIDE;
66 virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; 66 virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE;
67 virtual const storage::UpdateObserverList* GetUpdateObservers(
68 storage::FileSystemType type) const OVERRIDE;
69 virtual const storage::ChangeObserverList* GetChangeObservers(
70 storage::FileSystemType type) const OVERRIDE;
71 virtual const storage::AccessObserverList* GetAccessObservers(
72 storage::FileSystemType type) const OVERRIDE;
67 73
68 // Initialize the CopyOrMoveFileValidatorFactory. Invalid to call more than 74 // Initialize the CopyOrMoveFileValidatorFactory. Invalid to call more than
69 // once. 75 // once.
70 void InitializeCopyOrMoveFileValidatorFactory( 76 void InitializeCopyOrMoveFileValidatorFactory(
71 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> factory); 77 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> factory);
72 78
73 const storage::UpdateObserverList* GetUpdateObservers(
74 storage::FileSystemType type) const;
75 void AddFileChangeObserver(storage::FileChangeObserver* observer); 79 void AddFileChangeObserver(storage::FileChangeObserver* observer);
76 80
77 // For CopyOrMoveFileValidatorFactory testing. Once it's set to true 81 // For CopyOrMoveFileValidatorFactory testing. Once it's set to true
78 // GetCopyOrMoveFileValidatorFactory will start returning security 82 // GetCopyOrMoveFileValidatorFactory will start returning security
79 // error if validator is not initialized. 83 // error if validator is not initialized.
80 void set_require_copy_or_move_validator(bool flag) { 84 void set_require_copy_or_move_validator(bool flag) {
81 require_copy_or_move_validator_ = flag; 85 require_copy_or_move_validator_ = flag;
82 } 86 }
83 87
84 private: 88 private:
85 class QuotaUtil; 89 class QuotaUtil;
86 90
87 base::FilePath base_path_; 91 base::FilePath base_path_;
88 scoped_refptr<base::SequencedTaskRunner> task_runner_; 92 scoped_refptr<base::SequencedTaskRunner> task_runner_;
89 scoped_ptr<storage::AsyncFileUtilAdapter> file_util_; 93 scoped_ptr<storage::AsyncFileUtilAdapter> file_util_;
90 scoped_ptr<storage::WatcherManager> watcher_manager_; 94 scoped_ptr<storage::WatcherManager> watcher_manager_;
91 scoped_ptr<QuotaUtil> quota_util_; 95 scoped_ptr<QuotaUtil> quota_util_;
96 storage::UpdateObserverList update_observers_;
97 storage::ChangeObserverList change_observers_;
92 98
93 bool require_copy_or_move_validator_; 99 bool require_copy_or_move_validator_;
94 scoped_ptr<storage::CopyOrMoveFileValidatorFactory> 100 scoped_ptr<storage::CopyOrMoveFileValidatorFactory>
95 copy_or_move_file_validator_factory_; 101 copy_or_move_file_validator_factory_;
96 102
97 DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend); 103 DISALLOW_COPY_AND_ASSIGN(TestFileSystemBackend);
98 }; 104 };
99 105
100 } // namespace content 106 } // namespace content
101 107
102 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_ 108 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_SYSTEM_BACKEND_H_
OLDNEW
« no previous file with comments | « content/public/test/sandbox_file_system_test_helper.cc ('k') | content/public/test/test_file_system_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698