diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 05:15:45 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 05:15:45 +0000 |
commit | 79f6388902881a0aab426e9606c544b68ab3b9bc (patch) | |
tree | df8da7e82fded47bccf4fe32922a8451a475bf97 /sync | |
parent | 6d4b67a4b50d73d5001aec99014ac40bc504871a (diff) | |
download | chromium_src-79f6388902881a0aab426e9606c544b68ab3b9bc.zip chromium_src-79f6388902881a0aab426e9606c544b68ab3b9bc.tar.gz chromium_src-79f6388902881a0aab426e9606c544b68ab3b9bc.tar.bz2 |
Replace FilePath with base::FilePath in some more top level directories.
Review URL: https://codereview.chromium.org/12217101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
20 files changed, 48 insertions, 44 deletions
diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc index a2ff680..2692480 100644 --- a/sync/internal_api/http_bridge_unittest.cc +++ b/sync/internal_api/http_bridge_unittest.cc @@ -16,7 +16,8 @@ namespace syncer { namespace { // TODO(timsteele): Should use PathService here. See Chromium Issue 3113. -const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); +const base::FilePath::CharType kDocRoot[] = + FILE_PATH_LITERAL("chrome/test/data"); } class SyncHttpBridgeTest : public testing::Test { @@ -24,7 +25,7 @@ class SyncHttpBridgeTest : public testing::Test { SyncHttpBridgeTest() : test_server_(net::TestServer::TYPE_HTTP, net::TestServer::kLocalhost, - FilePath(kDocRoot)), + base::FilePath(kDocRoot)), fake_default_request_context_getter_(NULL), bridge_for_race_test_(NULL), io_thread_("IO thread") { diff --git a/sync/internal_api/internal_components_factory_impl.cc b/sync/internal_api/internal_components_factory_impl.cc index 746d25c..68d4c7b 100644 --- a/sync/internal_api/internal_components_factory_impl.cc +++ b/sync/internal_api/internal_components_factory_impl.cc @@ -52,7 +52,7 @@ InternalComponentsFactoryImpl::BuildContext( scoped_ptr<syncable::DirectoryBackingStore> InternalComponentsFactoryImpl::BuildDirectoryBackingStore( - const std::string& dir_name, const FilePath& backing_filepath) { + const std::string& dir_name, const base::FilePath& backing_filepath) { return scoped_ptr<syncable::DirectoryBackingStore>( new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath)); } diff --git a/sync/internal_api/public/internal_components_factory.h b/sync/internal_api/public/internal_components_factory.h index 4b31781..520e779 100644 --- a/sync/internal_api/public/internal_components_factory.h +++ b/sync/internal_api/public/internal_components_factory.h @@ -81,7 +81,7 @@ class SYNC_EXPORT InternalComponentsFactory { virtual scoped_ptr<syncable::DirectoryBackingStore> BuildDirectoryBackingStore( const std::string& dir_name, - const FilePath& backing_filepath) = 0; + const base::FilePath& backing_filepath) = 0; // Returns the Switches struct that this object is using as configuration, if // the implementation is making use of one. diff --git a/sync/internal_api/public/internal_components_factory_impl.h b/sync/internal_api/public/internal_components_factory_impl.h index 66b8baa..e69fa3d 100644 --- a/sync/internal_api/public/internal_components_factory_impl.h +++ b/sync/internal_api/public/internal_components_factory_impl.h @@ -36,7 +36,7 @@ class SYNC_EXPORT InternalComponentsFactoryImpl virtual scoped_ptr<syncable::DirectoryBackingStore> BuildDirectoryBackingStore( const std::string& dir_name, - const FilePath& backing_filepath) OVERRIDE; + const base::FilePath& backing_filepath) OVERRIDE; virtual Switches GetSwitches() const OVERRIDE; diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index a614621..7cf57f9 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -301,7 +301,7 @@ class SYNC_EXPORT SyncManager { // TODO(akalin): Replace the |post_factory| parameter with a // URLFetcher parameter. virtual void Init( - const FilePath& database_location, + const base::FilePath& database_location, const WeakHandle<JsEventHandler>& event_handler, const std::string& sync_server_and_path, int sync_server_port, diff --git a/sync/internal_api/public/test/fake_sync_manager.h b/sync/internal_api/public/test/fake_sync_manager.h index 74aadd7..49c443f 100644 --- a/sync/internal_api/public/test/fake_sync_manager.h +++ b/sync/internal_api/public/test/fake_sync_manager.h @@ -70,7 +70,7 @@ class FakeSyncManager : public SyncManager { // Note: we treat whatever message loop this is called from as the sync // loop for purposes of callbacks. virtual void Init( - const FilePath& database_location, + const base::FilePath& database_location, const WeakHandle<JsEventHandler>& event_handler, const std::string& sync_server_and_path, int sync_server_port, diff --git a/sync/internal_api/public/test/test_internal_components_factory.h b/sync/internal_api/public/test/test_internal_components_factory.h index d48855b..41420ae 100644 --- a/sync/internal_api/public/test/test_internal_components_factory.h +++ b/sync/internal_api/public/test/test_internal_components_factory.h @@ -42,7 +42,7 @@ class TestInternalComponentsFactory : public InternalComponentsFactory { virtual scoped_ptr<syncable::DirectoryBackingStore> BuildDirectoryBackingStore( const std::string& dir_name, - const FilePath& backing_filepath) OVERRIDE; + const base::FilePath& backing_filepath) OVERRIDE; virtual Switches GetSwitches() const OVERRIDE; diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc index 41ef5b2..cf9e50d 100644 --- a/sync/internal_api/sync_manager_impl.cc +++ b/sync/internal_api/sync_manager_impl.cc @@ -331,7 +331,7 @@ void SyncManagerImpl::ConfigureSyncer( } void SyncManagerImpl::Init( - const FilePath& database_location, + const base::FilePath& database_location, const WeakHandle<JsEventHandler>& event_handler, const std::string& sync_server_and_path, int port, @@ -384,7 +384,7 @@ void SyncManagerImpl::Init( sync_encryption_handler_->AddObserver(&debug_info_event_listener_); sync_encryption_handler_->AddObserver(&js_sync_encryption_handler_observer_); - FilePath absolute_db_path(database_path_); + base::FilePath absolute_db_path(database_path_); file_util::AbsolutePath(&absolute_db_path); scoped_ptr<syncable::DirectoryBackingStore> backing_store = internal_components_factory->BuildDirectoryBackingStore( diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h index 75bc930..dff9c4b 100644 --- a/sync/internal_api/sync_manager_impl.h +++ b/sync/internal_api/sync_manager_impl.h @@ -64,7 +64,7 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl : // SyncManager implementation. virtual void Init( - const FilePath& database_location, + const base::FilePath& database_location, const WeakHandle<JsEventHandler>& event_handler, const std::string& sync_server_and_path, int sync_server_port, @@ -290,7 +290,7 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl : syncable::Directory* directory(); - FilePath database_path_; + base::FilePath database_path_; const std::string name_; diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc index 74e7b20..bc9c4dc 100644 --- a/sync/internal_api/test/fake_sync_manager.cc +++ b/sync/internal_api/test/fake_sync_manager.cc @@ -86,7 +86,7 @@ void FakeSyncManager::WaitForSyncThread() { } void FakeSyncManager::Init( - const FilePath& database_location, + const base::FilePath& database_location, const WeakHandle<JsEventHandler>& event_handler, const std::string& sync_server_and_path, int sync_server_port, diff --git a/sync/internal_api/test/test_internal_components_factory.cc b/sync/internal_api/test/test_internal_components_factory.cc index a195609..1fe161aa 100644 --- a/sync/internal_api/test/test_internal_components_factory.cc +++ b/sync/internal_api/test/test_internal_components_factory.cc @@ -50,7 +50,7 @@ TestInternalComponentsFactory::BuildContext( scoped_ptr<syncable::DirectoryBackingStore> TestInternalComponentsFactory::BuildDirectoryBackingStore( - const std::string& dir_name, const FilePath& backing_filepath) { + const std::string& dir_name, const base::FilePath& backing_filepath) { switch (storage_option_) { case STORAGE_IN_MEMORY: return scoped_ptr<syncable::DirectoryBackingStore>( diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc index f27d4ca..a9e0f65 100644 --- a/sync/syncable/directory.cc +++ b/sync/syncable/directory.cc @@ -68,7 +68,7 @@ bool ParentIdAndHandleIndexer::ShouldInclude(const EntryKernel* a) { } // static -const FilePath::CharType Directory::kSyncDatabaseFilename[] = +const base::FilePath::CharType Directory::kSyncDatabaseFilename[] = FILE_PATH_LITERAL("SyncData.sqlite3"); void Directory::InitKernelForTest( diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h index b54b0cc..51ceaf8 100644 --- a/sync/syncable/directory.h +++ b/sync/syncable/directory.h @@ -141,7 +141,7 @@ class SYNC_EXPORT Directory { TakeSnapshotGetsMetahandlesToPurge); public: - static const FilePath::CharType kSyncDatabaseFilename[]; + static const base::FilePath::CharType kSyncDatabaseFilename[]; // Various data that the Directory::Kernel we are backing (persisting data // for) needs saved across runs of the application. diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc index 9691197..3fa9edd 100644 --- a/sync/syncable/directory_backing_store_unittest.cc +++ b/sync/syncable/directory_backing_store_unittest.cc @@ -41,7 +41,7 @@ class MigrationTest : public testing::TestWithParam<int> { return "nick@chromium.org"; } - FilePath GetDatabasePath() { + base::FilePath GetDatabasePath() { return temp_dir_.path().Append(Directory::kSyncDatabaseFilename); } @@ -3188,7 +3188,7 @@ namespace { class OnDiskDirectoryBackingStoreForTest : public OnDiskDirectoryBackingStore { public: OnDiskDirectoryBackingStoreForTest(const std::string& dir_name, - const FilePath& backing_filepath); + const base::FilePath& backing_filepath); virtual ~OnDiskDirectoryBackingStoreForTest(); bool DidFailFirstOpenAttempt(); @@ -3201,7 +3201,7 @@ class OnDiskDirectoryBackingStoreForTest : public OnDiskDirectoryBackingStore { OnDiskDirectoryBackingStoreForTest::OnDiskDirectoryBackingStoreForTest( const std::string& dir_name, - const FilePath& backing_filepath) : + const base::FilePath& backing_filepath) : OnDiskDirectoryBackingStore(dir_name, backing_filepath), first_open_failed_(false) { } diff --git a/sync/syncable/on_disk_directory_backing_store.cc b/sync/syncable/on_disk_directory_backing_store.cc index 7264e0c..abe20d1 100644 --- a/sync/syncable/on_disk_directory_backing_store.cc +++ b/sync/syncable/on_disk_directory_backing_store.cc @@ -24,7 +24,7 @@ enum HistogramResultEnum { } // namespace OnDiskDirectoryBackingStore::OnDiskDirectoryBackingStore( - const std::string& dir_name, const FilePath& backing_filepath) + const std::string& dir_name, const base::FilePath& backing_filepath) : DirectoryBackingStore(dir_name), allow_failure_for_test_(false), backing_filepath_(backing_filepath) { diff --git a/sync/syncable/on_disk_directory_backing_store.h b/sync/syncable/on_disk_directory_backing_store.h index 06e14b8..bcb62c2 100644 --- a/sync/syncable/on_disk_directory_backing_store.h +++ b/sync/syncable/on_disk_directory_backing_store.h @@ -18,7 +18,7 @@ class SYNC_EXPORT_PRIVATE OnDiskDirectoryBackingStore : public DirectoryBackingStore { public: OnDiskDirectoryBackingStore(const std::string& dir_name, - const FilePath& backing_filepath); + const base::FilePath& backing_filepath); virtual ~OnDiskDirectoryBackingStore(); virtual DirOpenResult Load( MetahandlesIndex* entry_bucket, @@ -40,7 +40,7 @@ class SYNC_EXPORT_PRIVATE OnDiskDirectoryBackingStore FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MinorCorruption); bool allow_failure_for_test_; - FilePath backing_filepath_; + base::FilePath backing_filepath_; DISALLOW_COPY_AND_ASSIGN(OnDiskDirectoryBackingStore); }; diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc index 8031fc0e1..b162934 100644 --- a/sync/syncable/syncable_unittest.cc +++ b/sync/syncable/syncable_unittest.cc @@ -103,7 +103,7 @@ class SyncableGeneralTest : public testing::Test { NullDirectoryChangeDelegate delegate_; FakeEncryptor encryptor_; TestUnrecoverableErrorHandler handler_; - FilePath db_path_; + base::FilePath db_path_; }; const char SyncableGeneralTest::kIndexTestName[] = "IndexTest"; @@ -1533,7 +1533,7 @@ TEST_F(SyncableDirectoryTest, OrdinalWithNullSurvivesSaveAndReload) { class TestBackingStore : public OnDiskDirectoryBackingStore { public: TestBackingStore(const std::string& dir_name, - const FilePath& backing_filepath); + const base::FilePath& backing_filepath); virtual ~TestBackingStore(); @@ -1549,7 +1549,7 @@ class TestBackingStore : public OnDiskDirectoryBackingStore { }; TestBackingStore::TestBackingStore(const std::string& dir_name, - const FilePath& backing_filepath) + const base::FilePath& backing_filepath) : OnDiskDirectoryBackingStore(dir_name, backing_filepath), fail_save_changes_(false) { } @@ -1573,7 +1573,7 @@ class TestDirectory : public Directory { Encryptor *encryptor, UnrecoverableErrorHandler *handler, const std::string& dir_name, - const FilePath& backing_filepath); + const base::FilePath& backing_filepath); virtual ~TestDirectory(); @@ -1593,7 +1593,7 @@ TestDirectory* TestDirectory::Create( Encryptor *encryptor, UnrecoverableErrorHandler *handler, const std::string& dir_name, - const FilePath& backing_filepath) { + const base::FilePath& backing_filepath) { TestBackingStore* backing_store = new TestBackingStore(dir_name, backing_filepath); return new TestDirectory(encryptor, handler, backing_store); @@ -1613,7 +1613,7 @@ TEST(OnDiskSyncableDirectory, FailInitialWrite) { TestUnrecoverableErrorHandler handler; base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - FilePath file_path = temp_dir.path().Append( + base::FilePath file_path = temp_dir.path().Append( FILE_PATH_LITERAL("Test.sqlite3")); std::string name = "user@x.com"; NullDirectoryChangeDelegate delegate; @@ -1668,7 +1668,7 @@ class OnDiskSyncableDirectoryTest : public SyncableDirectoryTest { TestDirectory *test_directory_; // mirrors scoped_ptr<Directory> dir_ base::ScopedTempDir temp_dir_; - FilePath file_path_; + base::FilePath file_path_; }; TEST_F(OnDiskSyncableDirectoryTest, TestPurgeEntriesWithTypeIn) { @@ -2077,7 +2077,7 @@ class SyncableDirectoryManagement : public testing::Test { }; TEST_F(SyncableDirectoryManagement, TestFileRelease) { - FilePath path = temp_dir_.path().Append( + base::FilePath path = temp_dir_.path().Append( Directory::kSyncDatabaseFilename); syncable::Directory dir(new OnDiskDirectoryBackingStore("ScopeTest", path), diff --git a/sync/test/local_sync_test_server.cc b/sync/test/local_sync_test_server.cc index 21eaf6e..a11234f 100644 --- a/sync/test/local_sync_test_server.cc +++ b/sync/test/local_sync_test_server.cc @@ -16,13 +16,13 @@ namespace syncer { LocalSyncTestServer::LocalSyncTestServer() : LocalTestServer(net::TestServer::TYPE_HTTP, // Sync uses the HTTP scheme. net::TestServer::kLocalhost, - FilePath()), + base::FilePath()), xmpp_port_(0) {} LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) : LocalTestServer(net::TestServer::TYPE_HTTP, // Sync uses the HTTP scheme. net::TestServer::kLocalhost, - FilePath()), + base::FilePath()), xmpp_port_(xmpp_port) { SetPort(port); } @@ -40,8 +40,9 @@ bool LocalSyncTestServer::AddCommandLineArguments( return true; } -bool LocalSyncTestServer::GetTestServerPath(FilePath* testserver_path) const { - FilePath testserver_dir; +bool LocalSyncTestServer::GetTestServerPath( + base::FilePath* testserver_path) const { + base::FilePath testserver_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_dir)) { LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT"; return false; @@ -56,9 +57,9 @@ bool LocalSyncTestServer::GetTestServerPath(FilePath* testserver_path) const { } bool LocalSyncTestServer::GetTestScriptPath( - const FilePath::StringType& test_script_name, - FilePath* test_script_path) const { - FilePath testserver_path; + const base::FilePath::StringType& test_script_name, + base::FilePath* test_script_path) const { + base::FilePath testserver_path; if (!GetTestServerPath(&testserver_path)) return false; *test_script_path = testserver_path.DirName().Append(test_script_name); @@ -71,7 +72,7 @@ bool LocalSyncTestServer::SetPythonPath() const { // Add the net/tools/testserver directory to the path, so that testserver_base // can be imported. - FilePath net_testserver_path; + base::FilePath net_testserver_path; if (!LocalTestServer::GetTestServerPath(&net_testserver_path)) { LOG(ERROR) << "Failed to get net testserver path."; return false; @@ -79,7 +80,7 @@ bool LocalSyncTestServer::SetPythonPath() const { AppendToPythonPath(net_testserver_path.DirName()); // Locate the Python code generated by the sync protocol buffers compiler. - FilePath pyproto_dir; + base::FilePath pyproto_dir; if (!GetPyProtoPath(&pyproto_dir)) { LOG(WARNING) << "Cannot find pyproto dir for generated code. " << "Testserver features that rely on it will not work"; diff --git a/sync/test/local_sync_test_server.h b/sync/test/local_sync_test_server.h index 650766a..4e829ec 100644 --- a/sync/test/local_sync_test_server.h +++ b/sync/test/local_sync_test_server.h @@ -29,12 +29,13 @@ class LocalSyncTestServer : public net::LocalTestServer { virtual bool AddCommandLineArguments( CommandLine* command_line) const OVERRIDE; virtual bool SetPythonPath() const OVERRIDE; - virtual bool GetTestServerPath(FilePath* testserver_path) const OVERRIDE; + virtual bool GetTestServerPath( + base::FilePath* testserver_path) const OVERRIDE; // Returns true if the path to |test_script_name| is successfully stored in // |*test_script_path|. Used by the run_sync_testserver executable. - bool GetTestScriptPath(const FilePath::StringType& test_script_name, - FilePath* test_script_path) const; + bool GetTestScriptPath(const base::FilePath::StringType& test_script_name, + base::FilePath* test_script_path) const; private: // Port on which the Sync XMPP server listens. diff --git a/sync/tools/testserver/run_sync_testserver.cc b/sync/tools/testserver/run_sync_testserver.cc index 74f186d..9295034 100644 --- a/sync/tools/testserver/run_sync_testserver.cc +++ b/sync/tools/testserver/run_sync_testserver.cc @@ -21,7 +21,8 @@ static void PrintUsage() { // Launches the chromiumsync_test.py or xmppserver_test.py scripts, which test // the sync HTTP and XMPP sever functionality respectively. -static bool RunSyncTest(const FilePath::StringType& sync_test_script_name) { +static bool RunSyncTest( + const base::FilePath::StringType& sync_test_script_name) { scoped_ptr<syncer::LocalSyncTestServer> test_server( new syncer::LocalSyncTestServer()); if (!test_server->SetPythonPath()) { @@ -29,7 +30,7 @@ static bool RunSyncTest(const FilePath::StringType& sync_test_script_name) { return false; } - FilePath sync_test_script_path; + base::FilePath sync_test_script_path; if (!test_server->GetTestScriptPath(sync_test_script_name, &sync_test_script_path)) { LOG(ERROR) << "Error trying to get path for test script " |