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

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_sync_context.h

Issue 145693005: [FileAPI] Replace default leveldb::Env with leveldb::MemEnv in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 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 CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_CONTEXT_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_CONTEXT_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_CONTEXT_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 16 matching lines...) Expand all
27 27
28 namespace base { 28 namespace base {
29 class SingleThreadTaskRunner; 29 class SingleThreadTaskRunner;
30 } 30 }
31 31
32 namespace fileapi { 32 namespace fileapi {
33 class FileSystemContext; 33 class FileSystemContext;
34 class FileSystemURL; 34 class FileSystemURL;
35 } 35 }
36 36
37 namespace leveldb {
38 class Env;
39 }
40
37 namespace webkit_blob { 41 namespace webkit_blob {
38 class ScopedFile; 42 class ScopedFile;
39 } 43 }
40 44
41 namespace sync_file_system { 45 namespace sync_file_system {
42 46
43 class FileChange; 47 class FileChange;
44 class LocalFileChangeTracker; 48 class LocalFileChangeTracker;
45 struct LocalFileSyncInfo; 49 struct LocalFileSyncInfo;
46 class LocalOriginChangeObserver; 50 class LocalOriginChangeObserver;
(...skipping 18 matching lines...) Expand all
65 SyncStatusCode status, 69 SyncStatusCode status,
66 const LocalFileSyncInfo& sync_file_info, 70 const LocalFileSyncInfo& sync_file_info,
67 webkit_blob::ScopedFile snapshot)> 71 webkit_blob::ScopedFile snapshot)>
68 LocalFileSyncInfoCallback; 72 LocalFileSyncInfoCallback;
69 73
70 typedef base::Callback<void(SyncStatusCode status, 74 typedef base::Callback<void(SyncStatusCode status,
71 bool has_pending_changes)> 75 bool has_pending_changes)>
72 HasPendingLocalChangeCallback; 76 HasPendingLocalChangeCallback;
73 77
74 LocalFileSyncContext(const base::FilePath& base_path, 78 LocalFileSyncContext(const base::FilePath& base_path,
79 leveldb::Env* env_override,
75 base::SingleThreadTaskRunner* ui_task_runner, 80 base::SingleThreadTaskRunner* ui_task_runner,
76 base::SingleThreadTaskRunner* io_task_runner); 81 base::SingleThreadTaskRunner* io_task_runner);
77 82
78 // Initializes |file_system_context| for syncable file operations 83 // Initializes |file_system_context| for syncable file operations
79 // and registers the it into the internal map. 84 // and registers the it into the internal map.
80 // Calling this multiple times for the same file_system_context is valid. 85 // Calling this multiple times for the same file_system_context is valid.
81 // This method must be called on UI thread. 86 // This method must be called on UI thread.
82 void MaybeInitializeFileSystemContext( 87 void MaybeInitializeFileSystemContext(
83 const GURL& source_url, 88 const GURL& source_url,
84 fileapi::FileSystemContext* file_system_context, 89 fileapi::FileSystemContext* file_system_context,
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 base::TimeDelta NotifyChangesDuration(); 323 base::TimeDelta NotifyChangesDuration();
319 324
320 void DidCreateDirectoryForCopyIn( 325 void DidCreateDirectoryForCopyIn(
321 fileapi::FileSystemContext* file_system_context, 326 fileapi::FileSystemContext* file_system_context,
322 const base::FilePath& local_file_path, 327 const base::FilePath& local_file_path,
323 const fileapi::FileSystemURL& dest_url, 328 const fileapi::FileSystemURL& dest_url,
324 const StatusCallback& callback, 329 const StatusCallback& callback,
325 base::File::Error error); 330 base::File::Error error);
326 331
327 const base::FilePath local_base_path_; 332 const base::FilePath local_base_path_;
333 leveldb::Env* env_override_;
328 334
329 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 335 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
330 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 336 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
331 337
332 // Indicates if the sync service is shutdown. 338 // Indicates if the sync service is shutdown.
333 bool shutdown_on_ui_; // Updated and referred only on UI thread. 339 bool shutdown_on_ui_; // Updated and referred only on UI thread.
334 bool shutdown_on_io_; // Updated and referred only on IO thread. 340 bool shutdown_on_io_; // Updated and referred only on IO thread.
335 341
336 // OperationRunner. This must be accessed only on IO thread. 342 // OperationRunner. This must be accessed only on IO thread.
337 scoped_ptr<SyncableFileOperationRunner> operation_runner_; 343 scoped_ptr<SyncableFileOperationRunner> operation_runner_;
(...skipping 28 matching lines...) Expand all
366 ObserverList<LocalOriginChangeObserver> origin_change_observers_; 372 ObserverList<LocalOriginChangeObserver> origin_change_observers_;
367 373
368 int mock_notify_changes_duration_in_sec_; 374 int mock_notify_changes_duration_in_sec_;
369 375
370 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncContext); 376 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncContext);
371 }; 377 };
372 378
373 } // namespace sync_file_system 379 } // namespace sync_file_system
374 380
375 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_CONTEXT_H_ 381 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698