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

Unified Diff: chrome/browser/sync/syncable/directory_manager.h

Issue 7190001: [Sync] Split DirectoryChangeListener for thread-safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix copyright Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/syncable/directory_manager.h
diff --git a/chrome/browser/sync/syncable/directory_manager.h b/chrome/browser/sync/syncable/directory_manager.h
index 944e6d58d00baa28d9dc9593e772a4fb1ddb2d9d..b78edb68d36b94eba915a7bbf27405127cbdefea 100644
--- a/chrome/browser/sync/syncable/directory_manager.h
+++ b/chrome/browser/sync/syncable/directory_manager.h
@@ -29,6 +29,8 @@ namespace syncable { class BaseTransaction; }
namespace syncable {
+class DirectoryChangeDelegate;
+
struct DirectoryManagerEvent {
enum {
CLOSED,
@@ -55,13 +57,17 @@ class DirectoryManager {
static const FilePath GetSyncDataDatabaseFilename();
const FilePath GetSyncDataDatabasePath() const;
- // Opens a directory. Returns false on error.
- // Name parameter is the the user's login,
- // MUST already have been converted to a common case.
- bool Open(const std::string& name);
-
- // Marks a directory as closed. It might take a while until all the
- // file handles and resources are freed by other threads.
+ // Opens a directory. Returns false on error. Name parameter is
+ // the the user's login, MUST already have been converted to a
+ // common case. Does not take ownership of |delegate|, which must
+ // be non-NULL. Starts sending events to |delegate| if the returned
+ // result is true. Note that events to |delegate| may be sent from
+ // *any* thread.
+ bool Open(const std::string& name, DirectoryChangeDelegate* delegate);
+
+ // Marks a directory as closed and stops sending events to the
+ // delegate. It might take a while until all the file handles and
+ // resources are freed by other threads.
void Close(const std::string& name);
// Should be called at App exit.
@@ -88,7 +94,7 @@ class DirectoryManager {
}
DirOpenResult OpenImpl(const std::string& name, const FilePath& path,
- bool* was_open);
+ DirectoryChangeDelegate* delegate, bool* was_open);
// Helpers for friend class ScopedDirLookup:
friend class ScopedDirLookup;
« no previous file with comments | « chrome/browser/sync/syncable/directory_change_listener.h ('k') | chrome/browser/sync/syncable/directory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698