diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 05:27:15 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 05:27:15 +0000 |
commit | 30aebeb9ba5719588e90d267e9251cd0d2808ac1 (patch) | |
tree | 8766b2f92d2dcb487da471a27469e34b357e6c6f /chrome/browser/sync/backend_migrator_unittest.cc | |
parent | 3354c312c47227dd6529abae0b755afd3fe0fabb (diff) | |
download | chromium_src-30aebeb9ba5719588e90d267e9251cd0d2808ac1.zip chromium_src-30aebeb9ba5719588e90d267e9251cd0d2808ac1.tar.gz chromium_src-30aebeb9ba5719588e90d267e9251cd0d2808ac1.tar.bz2 |
sync: Delete ScopedDirLookup and DirectoryManager
These classes were simple wrappers that didn't actually do a whole lot.
They added an unnecessary layer of indirection and required us to write
several lines of boilerplate every time we wanted to access the
directory.
The DirectoryManager did manage some locks, but it is believe that these
are no longer necessary. The directory management functions (ie. open,
close, save changes, etc.) are only invoked from the syncer thread and
all other operations require a transaction. Directory operations should
be safe even without these locks.
The DirectoryManager was responsible for taking the input directory path
argument, appending a constant filename, and passing the result on to
the Directory. The constant value has been moved to a static member of
syncable::Directory and it is now the responsibility of the caller of
Directory::Open() to assemble the full file path.
Deleting the DirectoryManager left the Cryptographer without a home. It
was moved into the syncable::Directory for now. This allows us to
perform more thorough runtime verification of the locking assertions
around this class.
These changes had some reprecussions for the unit test base classes.
The TestDirectorySetterUpper underwent significant modifications.
Hopefully these will make it easier to read and reduce duplication of
test boilerplate code.
This change also wound up affecting the SyncerCommandTest class. The
template-based conditional instantiation of a Directory or a
MockDirectory was making it hard to use the TestDirectorySetterUpper, so
the class hierarchy was refactored to allow for greater code reuse.
BUG=115560
TEST=
Review URL: http://codereview.chromium.org/9442031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/backend_migrator_unittest.cc')
-rw-r--r-- | chrome/browser/sync/backend_migrator_unittest.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc index f156026..c8b5978 100644 --- a/chrome/browser/sync/backend_migrator_unittest.cc +++ b/chrome/browser/sync/backend_migrator_unittest.cc @@ -11,7 +11,6 @@ #include "chrome/browser/sync/profile_sync_service_mock.h" #include "chrome/browser/sync/protocol/sync.pb.h" #include "chrome/browser/sync/sessions/session_state.h" -#include "chrome/browser/sync/syncable/directory_manager.h" #include "chrome/browser/sync/syncable/model_type_test_util.h" #include "chrome/browser/sync/test/engine/test_user_share.h" #include "chrome/common/chrome_notification_types.h" @@ -69,7 +68,7 @@ class SyncBackendMigratorTest : public testing::Test { if (!unsynced_types.Has(type)) { progress_marker.set_token("dummy"); } - trans.GetLookup()->SetDownloadProgress(type, progress_marker); + trans.GetDirectory()->SetDownloadProgress(type, progress_marker); } } |