summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
commita3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e (patch)
treebdd4dac76e6034ef6cf33450e203269a715ea0e6 /webkit
parent8bc574c57115e9ffd0169f33131c0865997dcb35 (diff)
downloadchromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.zip
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.gz
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.bz2
Add FilePath to base namespace.
This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes. Review URL: https://codereview.chromium.org/12163003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/appcache/appcache_database.cc4
-rw-r--r--webkit/appcache/appcache_database.h4
-rw-r--r--webkit/appcache/appcache_database_unittest.cc24
-rw-r--r--webkit/appcache/appcache_disk_cache.cc6
-rw-r--r--webkit/appcache/appcache_disk_cache.h4
-rw-r--r--webkit/appcache/appcache_interfaces.cc3
-rw-r--r--webkit/appcache/appcache_interfaces.h3
-rw-r--r--webkit/appcache/appcache_service.cc2
-rw-r--r--webkit/appcache/appcache_service.h5
-rw-r--r--webkit/appcache/appcache_storage_impl.cc6
-rw-r--r--webkit/appcache/appcache_storage_impl.h4
-rw-r--r--webkit/appcache/appcache_storage_impl_unittest.cc4
-rw-r--r--webkit/base/data_element.cc2
-rw-r--r--webkit/base/data_element.h8
-rw-r--r--webkit/base/file_path_string_conversions.cc12
-rw-r--r--webkit/base/file_path_string_conversions.h8
-rw-r--r--webkit/blob/blob_data.cc2
-rw-r--r--webkit/blob/blob_data.h2
-rw-r--r--webkit/blob/blob_storage_controller.cc2
-rw-r--r--webkit/blob/blob_storage_controller.h5
-rw-r--r--webkit/blob/blob_url_request_job_unittest.cc12
-rw-r--r--webkit/blob/local_file_stream_reader.cc2
-rw-r--r--webkit/blob/local_file_stream_reader.h4
-rw-r--r--webkit/blob/local_file_stream_reader_unittest.cc10
-rw-r--r--webkit/blob/shareable_file_reference.cc8
-rw-r--r--webkit/blob/shareable_file_reference.h12
-rw-r--r--webkit/blob/shareable_file_reference_unittest.cc2
-rw-r--r--webkit/chromeos/fileapi/cros_mount_point_provider.cc25
-rw-r--r--webkit/chromeos/fileapi/cros_mount_point_provider.h12
-rw-r--r--webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc70
-rw-r--r--webkit/chromeos/fileapi/file_access_permissions.cc8
-rw-r--r--webkit/chromeos/fileapi/file_access_permissions.h6
-rw-r--r--webkit/chromeos/fileapi/file_access_permissions_unittest.cc16
-rw-r--r--webkit/chromeos/fileapi/file_util_async.h16
-rw-r--r--webkit/chromeos/fileapi/memory_file_util.cc46
-rw-r--r--webkit/chromeos/fileapi/memory_file_util.h52
-rw-r--r--webkit/chromeos/fileapi/memory_file_util_unittest.cc88
-rw-r--r--webkit/chromeos/fileapi/remote_file_stream_writer.cc2
-rw-r--r--webkit/chromeos/fileapi/remote_file_stream_writer.h2
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.cc8
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.h8
-rw-r--r--webkit/database/database_tracker.cc45
-rw-r--r--webkit/database/database_tracker.h15
-rw-r--r--webkit/database/database_tracker_unittest.cc36
-rw-r--r--webkit/database/database_util.cc10
-rw-r--r--webkit/database/database_util.h6
-rw-r--r--webkit/database/vfs_backend.cc12
-rw-r--r--webkit/database/vfs_backend.h12
-rw-r--r--webkit/dom_storage/dom_storage_area.cc14
-rw-r--r--webkit/dom_storage/dom_storage_area.h10
-rw-r--r--webkit/dom_storage/dom_storage_area_unittest.cc24
-rw-r--r--webkit/dom_storage/dom_storage_context.cc10
-rw-r--r--webkit/dom_storage/dom_storage_context.h14
-rw-r--r--webkit/dom_storage/dom_storage_context_unittest.cc8
-rw-r--r--webkit/dom_storage/dom_storage_database.cc10
-rw-r--r--webkit/dom_storage/dom_storage_database.h8
-rw-r--r--webkit/dom_storage/dom_storage_database_unittest.cc10
-rw-r--r--webkit/dom_storage/dom_storage_namespace.cc2
-rw-r--r--webkit/dom_storage/dom_storage_namespace.h4
-rw-r--r--webkit/dom_storage/local_storage_database_adapter.cc2
-rw-r--r--webkit/dom_storage/local_storage_database_adapter.h4
-rw-r--r--webkit/dom_storage/session_storage_database.cc2
-rw-r--r--webkit/dom_storage/session_storage_database.h4
-rw-r--r--webkit/fileapi/async_file_util.h6
-rw-r--r--webkit/fileapi/async_file_util_adapter.cc8
-rw-r--r--webkit/fileapi/async_file_util_adapter.h2
-rw-r--r--webkit/fileapi/cross_operation_delegate.cc4
-rw-r--r--webkit/fileapi/cross_operation_delegate.h2
-rw-r--r--webkit/fileapi/external_mount_points.cc68
-rw-r--r--webkit/fileapi/external_mount_points.h27
-rw-r--r--webkit/fileapi/external_mount_points_unittest.cc74
-rw-r--r--webkit/fileapi/file_system_callback_dispatcher.h2
-rw-r--r--webkit/fileapi/file_system_context.cc4
-rw-r--r--webkit/fileapi/file_system_context.h10
-rw-r--r--webkit/fileapi/file_system_context_unittest.cc48
-rw-r--r--webkit/fileapi/file_system_database_test_helper.cc6
-rw-r--r--webkit/fileapi/file_system_database_test_helper.h4
-rw-r--r--webkit/fileapi/file_system_dir_url_request_job.cc6
-rw-r--r--webkit/fileapi/file_system_dir_url_request_job_unittest.cc12
-rw-r--r--webkit/fileapi/file_system_directory_database.cc60
-rw-r--r--webkit/fileapi/file_system_directory_database.h14
-rw-r--r--webkit/fileapi/file_system_directory_database_unittest.cc82
-rw-r--r--webkit/fileapi/file_system_file_stream_reader.cc2
-rw-r--r--webkit/fileapi/file_system_file_stream_reader.h5
-rw-r--r--webkit/fileapi/file_system_file_stream_reader_unittest.cc4
-rw-r--r--webkit/fileapi/file_system_file_util.cc4
-rw-r--r--webkit/fileapi/file_system_file_util.h12
-rw-r--r--webkit/fileapi/file_system_file_util_proxy.cc4
-rw-r--r--webkit/fileapi/file_system_file_util_proxy.h4
-rw-r--r--webkit/fileapi/file_system_file_util_unittest.cc4
-rw-r--r--webkit/fileapi/file_system_mount_point_provider.h12
-rw-r--r--webkit/fileapi/file_system_mount_point_provider_unittest.cc44
-rw-r--r--webkit/fileapi/file_system_operation.h4
-rw-r--r--webkit/fileapi/file_system_origin_database.cc23
-rw-r--r--webkit/fileapi/file_system_origin_database.h10
-rw-r--r--webkit/fileapi/file_system_origin_database_unittest.cc46
-rw-r--r--webkit/fileapi/file_system_quota_client_unittest.cc8
-rw-r--r--webkit/fileapi/file_system_url.cc14
-rw-r--r--webkit/fileapi/file_system_url.h24
-rw-r--r--webkit/fileapi/file_system_url_request_job.cc4
-rw-r--r--webkit/fileapi/file_system_url_request_job.h5
-rw-r--r--webkit/fileapi/file_system_url_request_job_unittest.cc8
-rw-r--r--webkit/fileapi/file_system_url_unittest.cc26
-rw-r--r--webkit/fileapi/file_system_usage_cache.cc28
-rw-r--r--webkit/fileapi/file_system_usage_cache.h26
-rw-r--r--webkit/fileapi/file_system_usage_cache_unittest.cc26
-rw-r--r--webkit/fileapi/file_system_util.cc40
-rw-r--r--webkit/fileapi/file_system_util.h16
-rw-r--r--webkit/fileapi/file_system_util_unittest.cc16
-rw-r--r--webkit/fileapi/file_util_helper.cc26
-rw-r--r--webkit/fileapi/file_writer_delegate_unittest.cc2
-rw-r--r--webkit/fileapi/isolated_context.cc60
-rw-r--r--webkit/fileapi/isolated_context.h20
-rw-r--r--webkit/fileapi/isolated_context_unittest.cc46
-rw-r--r--webkit/fileapi/isolated_file_util.cc20
-rw-r--r--webkit/fileapi/isolated_file_util.h4
-rw-r--r--webkit/fileapi/isolated_file_util_unittest.cc80
-rw-r--r--webkit/fileapi/isolated_mount_point_provider.cc8
-rw-r--r--webkit/fileapi/isolated_mount_point_provider.h8
-rw-r--r--webkit/fileapi/local_file_stream_writer.cc2
-rw-r--r--webkit/fileapi/local_file_stream_writer.h4
-rw-r--r--webkit/fileapi/local_file_stream_writer_unittest.cc22
-rw-r--r--webkit/fileapi/local_file_system_operation.cc18
-rw-r--r--webkit/fileapi/local_file_system_operation.h14
-rw-r--r--webkit/fileapi/local_file_system_operation_unittest.cc274
-rw-r--r--webkit/fileapi/local_file_system_operation_write_unittest.cc16
-rw-r--r--webkit/fileapi/local_file_system_quota_unittest.cc48
-rw-r--r--webkit/fileapi/local_file_system_test_helper.cc32
-rw-r--r--webkit/fileapi/local_file_system_test_helper.h22
-rw-r--r--webkit/fileapi/local_file_util.cc50
-rw-r--r--webkit/fileapi/local_file_util.h10
-rw-r--r--webkit/fileapi/local_file_util_unittest.cc2
-rw-r--r--webkit/fileapi/media/device_media_file_util.cc14
-rw-r--r--webkit/fileapi/media/device_media_file_util.h12
-rw-r--r--webkit/fileapi/media/filtering_file_enumerator.cc8
-rw-r--r--webkit/fileapi/media/filtering_file_enumerator.h2
-rw-r--r--webkit/fileapi/media/media_path_filter.cc8
-rw-r--r--webkit/fileapi/media/media_path_filter.h6
-rw-r--r--webkit/fileapi/media/mtp_device_delegate.h11
-rw-r--r--webkit/fileapi/media/mtp_device_map_service.cc8
-rw-r--r--webkit/fileapi/media/mtp_device_map_service.h6
-rw-r--r--webkit/fileapi/media/native_media_file_util.cc26
-rw-r--r--webkit/fileapi/media/native_media_file_util.h8
-rw-r--r--webkit/fileapi/media/native_media_file_util_unittest.cc36
-rw-r--r--webkit/fileapi/mount_points.cc2
-rw-r--r--webkit/fileapi/mount_points.h12
-rw-r--r--webkit/fileapi/native_file_util.cc36
-rw-r--r--webkit/fileapi/native_file_util.h26
-rw-r--r--webkit/fileapi/obfuscated_file_util.cc140
-rw-r--r--webkit/fileapi/obfuscated_file_util.h30
-rw-r--r--webkit/fileapi/obfuscated_file_util_unittest.cc82
-rw-r--r--webkit/fileapi/remote_file_system_proxy.h2
-rw-r--r--webkit/fileapi/sandbox_file_stream_writer.cc2
-rw-r--r--webkit/fileapi/sandbox_file_stream_writer.h4
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.cc48
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.h16
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider_unittest.cc2
-rw-r--r--webkit/fileapi/sandbox_quota_observer.cc14
-rw-r--r--webkit/fileapi/sandbox_quota_observer.h6
-rw-r--r--webkit/fileapi/syncable/canned_syncable_file_system.cc10
-rw-r--r--webkit/fileapi/syncable/canned_syncable_file_system.h4
-rw-r--r--webkit/fileapi/syncable/local_file_change_tracker.cc14
-rw-r--r--webkit/fileapi/syncable/local_file_change_tracker.h2
-rw-r--r--webkit/fileapi/syncable/local_file_sync_context.cc6
-rw-r--r--webkit/fileapi/syncable/local_file_sync_context.h4
-rw-r--r--webkit/fileapi/syncable/local_file_sync_context_unittest.cc12
-rw-r--r--webkit/fileapi/syncable/sync_file_metadata.h2
-rw-r--r--webkit/fileapi/syncable/syncable_file_system_operation.cc4
-rw-r--r--webkit/fileapi/syncable/syncable_file_system_util.cc6
-rw-r--r--webkit/fileapi/syncable/syncable_file_system_util.h3
-rw-r--r--webkit/fileapi/syncable/syncable_file_system_util_unittest.cc18
-rw-r--r--webkit/fileapi/test_file_set.cc6
-rw-r--r--webkit/fileapi/test_file_set.h6
-rw-r--r--webkit/fileapi/test_mount_point_provider.cc8
-rw-r--r--webkit/fileapi/test_mount_point_provider.h8
-rw-r--r--webkit/fileapi/upload_file_system_file_element_reader_unittest.cc4
-rw-r--r--webkit/glue/dom_operations_unittest.cc12
-rw-r--r--webkit/glue/dom_serializer_unittest.cc28
-rw-r--r--webkit/glue/glue_serialize.cc4
-rw-r--r--webkit/glue/glue_serialize.h2
-rw-r--r--webkit/glue/glue_serialize_unittest.cc6
-rw-r--r--webkit/glue/resource_loader_bridge.h2
-rw-r--r--webkit/glue/resource_request_body.cc2
-rw-r--r--webkit/glue/resource_request_body.h3
-rw-r--r--webkit/glue/resource_request_body_unittest.cc8
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.cc2
-rw-r--r--webkit/glue/unittest_test_server.h2
-rw-r--r--webkit/glue/web_intent_data.cc2
-rw-r--r--webkit/glue/web_intent_data.h2
-rw-r--r--webkit/glue/web_intent_reply_data.cc2
-rw-r--r--webkit/glue/web_intent_reply_data.h4
-rw-r--r--webkit/glue/web_intent_reply_data_unittest.cc8
-rw-r--r--webkit/glue/webfileutilities_impl.cc16
-rw-r--r--webkit/media/crypto/ppapi/clear_key_cdm.cc2
-rw-r--r--webkit/mocks/mock_resource_loader_bridge.h4
-rw-r--r--webkit/plugins/npapi/plugin_host.cc4
-rw-r--r--webkit/plugins/npapi/plugin_instance.cc2
-rw-r--r--webkit/plugins/npapi/plugin_lib.cc4
-rw-r--r--webkit/plugins/npapi/plugin_lib.h6
-rw-r--r--webkit/plugins/npapi/plugin_lib_mac.mm4
-rw-r--r--webkit/plugins/npapi/plugin_lib_posix.cc9
-rw-r--r--webkit/plugins/npapi/plugin_lib_win.cc2
-rw-r--r--webkit/plugins/npapi/plugin_list.cc34
-rw-r--r--webkit/plugins/npapi/plugin_list.h25
-rw-r--r--webkit/plugins/npapi/plugin_list_mac.mm10
-rw-r--r--webkit/plugins/npapi/plugin_list_posix.cc36
-rw-r--r--webkit/plugins/npapi/plugin_list_unittest.cc10
-rw-r--r--webkit/plugins/npapi/plugin_list_win.cc74
-rw-r--r--webkit/plugins/npapi/plugin_stream.cc4
-rw-r--r--webkit/plugins/npapi/plugin_stream.h2
-rw-r--r--webkit/plugins/npapi/plugin_stream_posix.cc2
-rw-r--r--webkit/plugins/npapi/test/plugin_geturl_test.cc4
-rw-r--r--webkit/plugins/npapi/webplugin_delegate_impl.cc4
-rw-r--r--webkit/plugins/npapi/webplugin_delegate_impl.h6
-rw-r--r--webkit/plugins/npapi/webplugin_impl.cc2
-rw-r--r--webkit/plugins/npapi/webplugin_impl.h4
-rw-r--r--webkit/plugins/npapi/webplugin_page_delegate.h6
-rw-r--r--webkit/plugins/ppapi/file_callbacks.cc2
-rw-r--r--webkit/plugins/ppapi/file_callbacks.h2
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.cc8
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.h7
-rw-r--r--webkit/plugins/ppapi/plugin_delegate.h6
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc4
-rw-r--r--webkit/plugins/ppapi/plugin_module.h13
-rw-r--r--webkit/plugins/ppapi/ppapi_unittest.cc2
-rw-r--r--webkit/plugins/ppapi/ppb_directory_reader_impl.cc6
-rw-r--r--webkit/plugins/ppapi/ppb_file_ref_impl.cc16
-rw-r--r--webkit/plugins/ppapi/ppb_file_ref_impl.h8
-rw-r--r--webkit/plugins/ppapi/quota_file_io_unittest.cc2
-rw-r--r--webkit/plugins/ppapi/url_request_info_util.cc2
-rw-r--r--webkit/plugins/webplugininfo.cc2
-rw-r--r--webkit/plugins/webplugininfo.h4
-rw-r--r--webkit/quota/mock_quota_manager.cc2
-rw-r--r--webkit/quota/mock_quota_manager.h2
-rw-r--r--webkit/quota/quota_database.cc2
-rw-r--r--webkit/quota/quota_database.h4
-rw-r--r--webkit/quota/quota_database_unittest.cc58
-rw-r--r--webkit/quota/quota_manager.cc6
-rw-r--r--webkit/quota/quota_manager.h9
-rw-r--r--webkit/quota/quota_manager_unittest.cc4
-rw-r--r--webkit/support/platform_support_android.cc10
-rw-r--r--webkit/support/platform_support_linux.cc8
-rw-r--r--webkit/support/platform_support_mac.mm16
-rw-r--r--webkit/support/platform_support_win.cc8
-rw-r--r--webkit/support/simple_database_system.cc8
-rw-r--r--webkit/support/simple_database_system.h2
-rw-r--r--webkit/support/test_webkit_platform_support.cc10
-rw-r--r--webkit/support/test_webkit_platform_support.h2
-rw-r--r--webkit/support/test_webplugin_page_delegate.cc4
-rw-r--r--webkit/support/test_webplugin_page_delegate.h4
-rw-r--r--webkit/support/webkit_support.cc42
-rw-r--r--webkit/support/webkit_support.h4
-rw-r--r--webkit/support/weburl_loader_mock_factory.cc8
-rw-r--r--webkit/support/weburl_loader_mock_factory.h2
-rw-r--r--webkit/tools/test_shell/image_decoder_unittest.cc40
-rw-r--r--webkit/tools/test_shell/image_decoder_unittest.h12
-rw-r--r--webkit/tools/test_shell/plugin_tests.cc12
-rw-r--r--webkit/tools/test_shell/run_all_tests.cc2
-rw-r--r--webkit/tools/test_shell/simple_appcache_system.cc2
-rw-r--r--webkit/tools/test_shell/simple_appcache_system.h6
-rw-r--r--webkit/tools/test_shell/simple_file_system.cc8
-rw-r--r--webkit/tools/test_shell/simple_file_system.h4
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc12
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.h7
-rw-r--r--webkit/tools/test_shell/test_shell.cc16
-rw-r--r--webkit/tools/test_shell/test_shell.h6
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc18
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm20
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.h6
-rw-r--r--webkit/tools/test_shell/test_shell_test.cc2
-rw-r--r--webkit/tools/test_shell/test_shell_test.h4
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_win.cc18
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.h4
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_gtk.cc2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_mac.mm2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_win.cc2
-rw-r--r--webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp4
281 files changed, 2026 insertions, 1978 deletions
diff --git a/webkit/appcache/appcache_database.cc b/webkit/appcache/appcache_database.cc
index e8f4b0b..95b4309 100644
--- a/webkit/appcache/appcache_database.cc
+++ b/webkit/appcache/appcache_database.cc
@@ -177,7 +177,7 @@ AppCacheDatabase::NamespaceRecord::~NamespaceRecord() {
}
-AppCacheDatabase::AppCacheDatabase(const FilePath& path)
+AppCacheDatabase::AppCacheDatabase(const base::FilePath& path)
: db_file_path_(path), is_disabled_(false), is_recreating_(false) {
}
@@ -1103,7 +1103,7 @@ bool AppCacheDatabase::DeleteExistingAndCreateNewDatabase() {
ResetConnectionAndTables();
// This also deletes the disk cache data.
- FilePath directory = db_file_path_.DirName();
+ base::FilePath directory = db_file_path_.DirName();
if (!file_util::Delete(directory, true) ||
!file_util::CreateDirectory(directory)) {
return false;
diff --git a/webkit/appcache/appcache_database.h b/webkit/appcache/appcache_database.h
index 5fe74a4..b110ba1 100644
--- a/webkit/appcache/appcache_database.h
+++ b/webkit/appcache/appcache_database.h
@@ -81,7 +81,7 @@ class WEBKIT_STORAGE_EXPORT AppCacheDatabase {
GURL namespace_url;
};
- explicit AppCacheDatabase(const FilePath& path);
+ explicit AppCacheDatabase(const base::FilePath& path);
~AppCacheDatabase();
void CloseConnection();
@@ -200,7 +200,7 @@ class WEBKIT_STORAGE_EXPORT AppCacheDatabase {
// and bodies are stored, and then creates a new database file.
bool DeleteExistingAndCreateNewDatabase();
- FilePath db_file_path_;
+ base::FilePath db_file_path_;
scoped_ptr<sql::Connection> db_;
scoped_ptr<sql::MetaTable> meta_table_;
bool is_disabled_;
diff --git a/webkit/appcache/appcache_database_unittest.cc b/webkit/appcache/appcache_database_unittest.cc
index d84d451..4c7affb 100644
--- a/webkit/appcache/appcache_database_unittest.cc
+++ b/webkit/appcache/appcache_database_unittest.cc
@@ -41,7 +41,7 @@ class AppCacheDatabaseTest {};
TEST(AppCacheDatabaseTest, LazyOpen) {
// Use an empty file path to use an in-memory sqlite database.
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_FALSE(db.LazyOpen(false));
@@ -65,9 +65,9 @@ TEST(AppCacheDatabaseTest, ReCreate) {
// Real files on disk for this test.
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- const FilePath kDbFile = temp_dir.path().AppendASCII("appcache.db");
- const FilePath kNestedDir = temp_dir.path().AppendASCII("nested");
- const FilePath kOtherFile = kNestedDir.AppendASCII("other_file");
+ const base::FilePath kDbFile = temp_dir.path().AppendASCII("appcache.db");
+ const base::FilePath kNestedDir = temp_dir.path().AppendASCII("nested");
+ const base::FilePath kOtherFile = kNestedDir.AppendASCII("other_file");
EXPECT_TRUE(file_util::CreateDirectory(kNestedDir));
EXPECT_EQ(3, file_util::WriteFile(kOtherFile, "foo", 3));
@@ -87,7 +87,7 @@ TEST(AppCacheDatabaseTest, ReCreate) {
}
TEST(AppCacheDatabaseTest, EntryRecords) {
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -161,7 +161,7 @@ TEST(AppCacheDatabaseTest, EntryRecords) {
}
TEST(AppCacheDatabaseTest, CacheRecords) {
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -203,7 +203,7 @@ TEST(AppCacheDatabaseTest, CacheRecords) {
}
TEST(AppCacheDatabaseTest, GroupRecords) {
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -330,7 +330,7 @@ TEST(AppCacheDatabaseTest, GroupRecords) {
}
TEST(AppCacheDatabaseTest, NamespaceRecords) {
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -430,7 +430,7 @@ TEST(AppCacheDatabaseTest, NamespaceRecords) {
}
TEST(AppCacheDatabaseTest, OnlineWhiteListRecords) {
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -476,7 +476,7 @@ TEST(AppCacheDatabaseTest, OnlineWhiteListRecords) {
}
TEST(AppCacheDatabaseTest, DeletableResponseIds) {
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -552,7 +552,7 @@ TEST(AppCacheDatabaseTest, OriginUsage) {
const GURL kOtherOriginManifestUrl("http://other/manifest");
const GURL kOtherOrigin(kOtherOriginManifestUrl.GetOrigin());
- const FilePath kEmptyPath;
+ const base::FilePath kEmptyPath;
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
@@ -621,7 +621,7 @@ TEST(AppCacheDatabaseTest, UpgradeSchema3to4) {
// Real file on disk for this test.
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- const FilePath kDbFile = temp_dir.path().AppendASCII("upgrade.db");
+ const base::FilePath kDbFile = temp_dir.path().AppendASCII("upgrade.db");
const GURL kMockOrigin("http://mockorigin/");
const char kNamespaceUrlFormat[] = "namespace%d";
diff --git a/webkit/appcache/appcache_disk_cache.cc b/webkit/appcache/appcache_disk_cache.cc
index 88bea87..7b8e699 100644
--- a/webkit/appcache/appcache_disk_cache.cc
+++ b/webkit/appcache/appcache_disk_cache.cc
@@ -164,7 +164,7 @@ AppCacheDiskCache::~AppCacheDiskCache() {
}
int AppCacheDiskCache::InitWithDiskBackend(
- const FilePath& disk_cache_directory, int disk_cache_size, bool force,
+ const base::FilePath& disk_cache_directory, int disk_cache_size, bool force,
base::MessageLoopProxy* cache_thread,
const net::CompletionCallback& callback) {
return Init(net::APP_CACHE, disk_cache_directory,
@@ -173,7 +173,7 @@ int AppCacheDiskCache::InitWithDiskBackend(
int AppCacheDiskCache::InitWithMemBackend(
int mem_cache_size, const net::CompletionCallback& callback) {
- return Init(net::MEMORY_CACHE, FilePath(), mem_cache_size, false, NULL,
+ return Init(net::MEMORY_CACHE, base::FilePath(), mem_cache_size, false, NULL,
callback);
}
@@ -262,7 +262,7 @@ AppCacheDiskCache::PendingCall::PendingCall(PendingCallType call_type,
AppCacheDiskCache::PendingCall::~PendingCall() {}
int AppCacheDiskCache::Init(net::CacheType cache_type,
- const FilePath& cache_directory,
+ const base::FilePath& cache_directory,
int cache_size, bool force,
base::MessageLoopProxy* cache_thread,
const net::CompletionCallback& callback) {
diff --git a/webkit/appcache/appcache_disk_cache.h b/webkit/appcache/appcache_disk_cache.h
index 529db97..aafc846 100644
--- a/webkit/appcache/appcache_disk_cache.h
+++ b/webkit/appcache/appcache_disk_cache.h
@@ -24,7 +24,7 @@ class WEBKIT_STORAGE_EXPORT AppCacheDiskCache
virtual ~AppCacheDiskCache();
// Initializes the object to use disk backed storage.
- int InitWithDiskBackend(const FilePath& disk_cache_directory,
+ int InitWithDiskBackend(const base::FilePath& disk_cache_directory,
int disk_cache_size, bool force,
base::MessageLoopProxy* cache_thread,
const net::CompletionCallback& callback);
@@ -80,7 +80,7 @@ class WEBKIT_STORAGE_EXPORT AppCacheDiskCache
return create_backend_callback_.get() != NULL;
}
disk_cache::Backend* disk_cache() { return disk_cache_.get(); }
- int Init(net::CacheType cache_type, const FilePath& directory,
+ int Init(net::CacheType cache_type, const base::FilePath& directory,
int cache_size, bool force, base::MessageLoopProxy* cache_thread,
const net::CompletionCallback& callback);
void OnCreateBackendComplete(int rv);
diff --git a/webkit/appcache/appcache_interfaces.cc b/webkit/appcache/appcache_interfaces.cc
index 70de5ff..3f3d1d7 100644
--- a/webkit/appcache/appcache_interfaces.cc
+++ b/webkit/appcache/appcache_interfaces.cc
@@ -19,7 +19,8 @@ const char kHttpsScheme[] = "https";
const char kHttpGETMethod[] = "GET";
const char kHttpHEADMethod[] = "HEAD";
-const FilePath::CharType kAppCacheDatabaseName[] = FILE_PATH_LITERAL("Index");
+const base::FilePath::CharType kAppCacheDatabaseName[] =
+ FILE_PATH_LITERAL("Index");
AppCacheInfo::AppCacheInfo()
: cache_id(kNoCacheId),
diff --git a/webkit/appcache/appcache_interfaces.h b/webkit/appcache/appcache_interfaces.h
index ed1dee7..78752b1 100644
--- a/webkit/appcache/appcache_interfaces.h
+++ b/webkit/appcache/appcache_interfaces.h
@@ -169,7 +169,8 @@ bool IsSchemeSupported(const GURL& url);
bool IsMethodSupported(const std::string& method);
bool IsSchemeAndMethodSupported(const net::URLRequest* request);
-WEBKIT_STORAGE_EXPORT extern const FilePath::CharType kAppCacheDatabaseName[];
+WEBKIT_STORAGE_EXPORT extern const base::FilePath::CharType
+ kAppCacheDatabaseName[];
} // namespace
diff --git a/webkit/appcache/appcache_service.cc b/webkit/appcache/appcache_service.cc
index 0149e62..c455436 100644
--- a/webkit/appcache/appcache_service.cc
+++ b/webkit/appcache/appcache_service.cc
@@ -449,7 +449,7 @@ AppCacheService::~AppCacheService() {
storage_.reset();
}
-void AppCacheService::Initialize(const FilePath& cache_directory,
+void AppCacheService::Initialize(const base::FilePath& cache_directory,
base::MessageLoopProxy* db_thread,
base::MessageLoopProxy* cache_thread) {
DCHECK(!storage_.get());
diff --git a/webkit/appcache/appcache_service.h b/webkit/appcache/appcache_service.h
index dfc7302..3a4003d 100644
--- a/webkit/appcache/appcache_service.h
+++ b/webkit/appcache/appcache_service.h
@@ -17,13 +17,12 @@
#include "webkit/appcache/appcache_storage.h"
#include "webkit/storage/webkit_storage_export.h"
-class FilePath;
-
namespace net {
class URLRequestContext;
} // namespace net
namespace base {
+class FilePath;
class MessageLoopProxy;
}
@@ -59,7 +58,7 @@ class WEBKIT_STORAGE_EXPORT AppCacheService {
explicit AppCacheService(quota::QuotaManagerProxy* quota_manager_proxy);
virtual ~AppCacheService();
- void Initialize(const FilePath& cache_directory,
+ void Initialize(const base::FilePath& cache_directory,
base::MessageLoopProxy* db_thread,
base::MessageLoopProxy* cache_thread);
diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc
index 89b196b..5c33209 100644
--- a/webkit/appcache/appcache_storage_impl.cc
+++ b/webkit/appcache/appcache_storage_impl.cc
@@ -39,7 +39,7 @@ static const int kDefaultQuota = 5 * 1024 * 1024;
static const int kMaxDiskCacheSize = 250 * 1024 * 1024;
static const int kMaxMemDiskCacheSize = 10 * 1024 * 1024;
-static const FilePath::CharType kDiskCacheDirectoryName[] =
+static const base::FilePath::CharType kDiskCacheDirectoryName[] =
FILE_PATH_LITERAL("Cache");
namespace {
@@ -1312,7 +1312,7 @@ AppCacheStorageImpl::~AppCacheStorageImpl() {
}
}
-void AppCacheStorageImpl::Initialize(const FilePath& cache_directory,
+void AppCacheStorageImpl::Initialize(const base::FilePath& cache_directory,
base::MessageLoopProxy* db_thread,
base::MessageLoopProxy* cache_thread) {
DCHECK(db_thread);
@@ -1320,7 +1320,7 @@ void AppCacheStorageImpl::Initialize(const FilePath& cache_directory,
cache_directory_ = cache_directory;
is_incognito_ = cache_directory_.empty();
- FilePath db_file_path;
+ base::FilePath db_file_path;
if (!is_incognito_)
db_file_path = cache_directory_.Append(kAppCacheDatabaseName);
database_ = new AppCacheDatabase(db_file_path);
diff --git a/webkit/appcache/appcache_storage_impl.h b/webkit/appcache/appcache_storage_impl.h
index 7441f4f..4211e62 100644
--- a/webkit/appcache/appcache_storage_impl.h
+++ b/webkit/appcache/appcache_storage_impl.h
@@ -31,7 +31,7 @@ class AppCacheStorageImpl : public AppCacheStorage {
explicit AppCacheStorageImpl(AppCacheService* service);
virtual ~AppCacheStorageImpl();
- void Initialize(const FilePath& cache_directory,
+ void Initialize(const base::FilePath& cache_directory,
base::MessageLoopProxy* db_thread,
base::MessageLoopProxy* cache_thread);
void Disable();
@@ -134,7 +134,7 @@ class AppCacheStorageImpl : public AppCacheStorage {
WEBKIT_STORAGE_EXPORT AppCacheDiskCache* disk_cache();
// The directory in which we place files in the file system.
- FilePath cache_directory_;
+ base::FilePath cache_directory_;
bool is_incognito_;
// This class operates primarily on the IO thread, but schedules
diff --git a/webkit/appcache/appcache_storage_impl_unittest.cc b/webkit/appcache/appcache_storage_impl_unittest.cc
index c8b86e5..37ed315 100644
--- a/webkit/appcache/appcache_storage_impl_unittest.cc
+++ b/webkit/appcache/appcache_storage_impl_unittest.cc
@@ -132,7 +132,7 @@ class AppCacheStorageImplTest : public testing::Test {
class MockQuotaManager : public quota::QuotaManager {
public:
MockQuotaManager()
- : QuotaManager(true /* is_incognito */, FilePath(),
+ : QuotaManager(true /* is_incognito */, base::FilePath(),
io_thread->message_loop_proxy(),
db_thread->message_loop_proxy(),
NULL),
@@ -261,7 +261,7 @@ class AppCacheStorageImplTest : public testing::Test {
void SetUpTest() {
DCHECK(MessageLoop::current() == io_thread->message_loop());
service_.reset(new AppCacheService(NULL));
- service_->Initialize(FilePath(), db_thread->message_loop_proxy(), NULL);
+ service_->Initialize(base::FilePath(), db_thread->message_loop_proxy(), NULL);
mock_quota_manager_proxy_ = new MockQuotaManagerProxy();
service_->quota_manager_proxy_ = mock_quota_manager_proxy_;
delegate_.reset(new MockStorageDelegate(this));
diff --git a/webkit/base/data_element.cc b/webkit/base/data_element.cc
index a514ac5..472a88b 100644
--- a/webkit/base/data_element.cc
+++ b/webkit/base/data_element.cc
@@ -16,7 +16,7 @@ DataElement::DataElement()
DataElement::~DataElement() {}
void DataElement::SetToFilePathRange(
- const FilePath& path,
+ const base::FilePath& path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
type_ = TYPE_FILE;
diff --git a/webkit/base/data_element.h b/webkit/base/data_element.h
index 4a5c726..3e286ba 100644
--- a/webkit/base/data_element.h
+++ b/webkit/base/data_element.h
@@ -33,7 +33,7 @@ class WEBKIT_BASE_EXPORT DataElement {
Type type() const { return type_; }
const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; }
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
const GURL& url() const { return url_; }
uint64 offset() const { return offset_; }
uint64 length() const { return length_; }
@@ -57,7 +57,7 @@ class WEBKIT_BASE_EXPORT DataElement {
}
// Sets TYPE_FILE data.
- void SetToFilePath(const FilePath& path) {
+ void SetToFilePath(const base::FilePath& path) {
SetToFilePathRange(path, 0, kuint64max, base::Time());
}
@@ -67,7 +67,7 @@ class WEBKIT_BASE_EXPORT DataElement {
}
// Sets TYPE_FILE data with range.
- void SetToFilePathRange(const FilePath& path,
+ void SetToFilePathRange(const base::FilePath& path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time);
@@ -84,7 +84,7 @@ class WEBKIT_BASE_EXPORT DataElement {
Type type_;
std::vector<char> buf_; // For TYPE_BYTES.
const char* bytes_; // For TYPE_BYTES.
- FilePath path_; // For TYPE_FILE.
+ base::FilePath path_; // For TYPE_FILE.
GURL url_; // For TYPE_BLOB or TYPE_FILE_FILESYSTEM.
uint64 offset_;
uint64 length_;
diff --git a/webkit/base/file_path_string_conversions.cc b/webkit/base/file_path_string_conversions.cc
index 3ff7557..566c8bb 100644
--- a/webkit/base/file_path_string_conversions.cc
+++ b/webkit/base/file_path_string_conversions.cc
@@ -10,7 +10,8 @@
namespace webkit_base {
-FilePath::StringType WebStringToFilePathString(const WebKit::WebString& str) {
+base::FilePath::StringType WebStringToFilePathString(
+ const WebKit::WebString& str) {
#if defined(OS_POSIX)
return base::SysWideToNativeMB(UTF16ToWideHack(str));
#elif defined(OS_WIN)
@@ -18,7 +19,8 @@ FilePath::StringType WebStringToFilePathString(const WebKit::WebString& str) {
#endif
}
-WebKit::WebString FilePathStringToWebString(const FilePath::StringType& str) {
+WebKit::WebString FilePathStringToWebString(
+ const base::FilePath::StringType& str) {
#if defined(OS_POSIX)
return WideToUTF16Hack(base::SysNativeMBToWide(str));
#elif defined(OS_WIN)
@@ -26,11 +28,11 @@ WebKit::WebString FilePathStringToWebString(const FilePath::StringType& str) {
#endif
}
-FilePath WebStringToFilePath(const WebKit::WebString& str) {
- return FilePath(WebStringToFilePathString(str));
+base::FilePath WebStringToFilePath(const WebKit::WebString& str) {
+ return base::FilePath(WebStringToFilePathString(str));
}
-WebKit::WebString FilePathToWebString(const FilePath& file_path) {
+WebKit::WebString FilePathToWebString(const base::FilePath& file_path) {
return FilePathStringToWebString(file_path.value());
}
diff --git a/webkit/base/file_path_string_conversions.h b/webkit/base/file_path_string_conversions.h
index 902a881..951c466 100644
--- a/webkit/base/file_path_string_conversions.h
+++ b/webkit/base/file_path_string_conversions.h
@@ -14,13 +14,13 @@ class WebString;
namespace webkit_base {
-WEBKIT_BASE_EXPORT FilePath::StringType WebStringToFilePathString(
+WEBKIT_BASE_EXPORT base::FilePath::StringType WebStringToFilePathString(
const WebKit::WebString& str);
WEBKIT_BASE_EXPORT WebKit::WebString FilePathStringToWebString(
- const FilePath::StringType& str);
-WEBKIT_BASE_EXPORT FilePath WebStringToFilePath(const WebKit::WebString& str);
+ const base::FilePath::StringType& str);
+WEBKIT_BASE_EXPORT base::FilePath WebStringToFilePath(const WebKit::WebString& str);
WEBKIT_BASE_EXPORT WebKit::WebString FilePathToWebString(
- const FilePath& file_path);
+ const base::FilePath& file_path);
} // namespace webkit_base
diff --git a/webkit/blob/blob_data.cc b/webkit/blob/blob_data.cc
index 2f62e32..4a2ab86 100644
--- a/webkit/blob/blob_data.cc
+++ b/webkit/blob/blob_data.cc
@@ -21,7 +21,7 @@ void BlobData::AppendData(const char* data, size_t length) {
items_.back().SetToBytes(data, length);
}
-void BlobData::AppendFile(const FilePath& file_path,
+void BlobData::AppendFile(const base::FilePath& file_path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
DCHECK(length > 0);
diff --git a/webkit/blob/blob_data.h b/webkit/blob/blob_data.h
index 45c75ca..08c47f4 100644
--- a/webkit/blob/blob_data.h
+++ b/webkit/blob/blob_data.h
@@ -30,7 +30,7 @@ class WEBKIT_STORAGE_EXPORT BlobData : public base::RefCounted<BlobData> {
void AppendData(const char* data, size_t length);
- void AppendFile(const FilePath& file_path, uint64 offset, uint64 length,
+ void AppendFile(const base::FilePath& file_path, uint64 offset, uint64 length,
const base::Time& expected_modification_time);
void AppendBlob(const GURL& blob_url, uint64 offset, uint64 length);
diff --git a/webkit/blob/blob_storage_controller.cc b/webkit/blob/blob_storage_controller.cc
index 503c47e..8649d98 100644
--- a/webkit/blob/blob_storage_controller.cc
+++ b/webkit/blob/blob_storage_controller.cc
@@ -215,7 +215,7 @@ void BlobStorageController::AppendStorageItems(
void BlobStorageController::AppendFileItem(
BlobData* target_blob_data,
- const FilePath& file_path, uint64 offset, uint64 length,
+ const base::FilePath& file_path, uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
target_blob_data->AppendFile(file_path, offset, length,
expected_modification_time);
diff --git a/webkit/blob/blob_storage_controller.h b/webkit/blob/blob_storage_controller.h
index c7e7631..a0c72b2 100644
--- a/webkit/blob/blob_storage_controller.h
+++ b/webkit/blob/blob_storage_controller.h
@@ -15,9 +15,9 @@
#include "webkit/storage/webkit_storage_export.h"
class GURL;
-class FilePath;
namespace base {
+class FilePath;
class Time;
}
@@ -48,7 +48,8 @@ class WEBKIT_STORAGE_EXPORT BlobStorageController {
uint64 offset,
uint64 length);
void AppendFileItem(BlobData* target_blob_data,
- const FilePath& file_path, uint64 offset, uint64 length,
+ const base::FilePath& file_path, uint64 offset,
+ uint64 length,
const base::Time& expected_modification_time);
void AppendFileSystemFileItem(
BlobData* target_blob_data,
diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc
index 007d936..8b07a4f 100644
--- a/webkit/blob/blob_url_request_job_unittest.cc
+++ b/webkit/blob/blob_url_request_job_unittest.cc
@@ -209,7 +209,7 @@ class BlobURLRequestJobTest : public testing::Test {
file_system_context_->CreateCrackedFileSystemURL(
GURL(kFileSystemURLOrigin),
kFileSystemType,
- FilePath().AppendASCII(filename));
+ base::FilePath().AppendASCII(filename));
fileapi::FileSystemFileUtil* file_util =
file_system_context_->GetFileUtil(kFileSystemType);
@@ -232,7 +232,7 @@ class BlobURLRequestJobTest : public testing::Test {
base::ClosePlatformFile(handle);
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util->GetFileInfo(&context, url, &file_info,
&platform_path));
@@ -297,8 +297,8 @@ class BlobURLRequestJobTest : public testing::Test {
protected:
base::ScopedTempDir temp_dir_;
- FilePath temp_file1_;
- FilePath temp_file2_;
+ base::FilePath temp_file1_;
+ base::FilePath temp_file2_;
base::Time temp_file_modification_time1_;
base::Time temp_file_modification_time2_;
GURL file_system_root_url_;
@@ -330,7 +330,7 @@ TEST_F(BlobURLRequestJobTest, TestGetSimpleFileRequest) {
}
TEST_F(BlobURLRequestJobTest, TestGetLargeFileRequest) {
- FilePath large_temp_file = temp_dir_.path().AppendASCII("LargeBlob.dat");
+ base::FilePath large_temp_file = temp_dir_.path().AppendASCII("LargeBlob.dat");
std::string large_data;
large_data.reserve(kBufferSize * 5);
for (int i = 0; i < kBufferSize * 5; ++i)
@@ -343,7 +343,7 @@ TEST_F(BlobURLRequestJobTest, TestGetLargeFileRequest) {
}
TEST_F(BlobURLRequestJobTest, TestGetNonExistentFileRequest) {
- FilePath non_existent_file =
+ base::FilePath non_existent_file =
temp_file1_.InsertBeforeExtension(FILE_PATH_LITERAL("-na"));
blob_data_->AppendFile(non_existent_file, 0, -1, base::Time());
TestErrorRequest(404);
diff --git a/webkit/blob/local_file_stream_reader.cc b/webkit/blob/local_file_stream_reader.cc
index aa077ef..dab8aa5 100644
--- a/webkit/blob/local_file_stream_reader.cc
+++ b/webkit/blob/local_file_stream_reader.cc
@@ -34,7 +34,7 @@ bool VerifySnapshotTime(const base::Time& expected_modification_time,
LocalFileStreamReader::LocalFileStreamReader(
base::TaskRunner* task_runner,
- const FilePath& file_path,
+ const base::FilePath& file_path,
int64 initial_offset,
const base::Time& expected_modification_time)
: task_runner_(task_runner),
diff --git a/webkit/blob/local_file_stream_reader.h b/webkit/blob/local_file_stream_reader.h
index 55b70bf..de1f64e 100644
--- a/webkit/blob/local_file_stream_reader.h
+++ b/webkit/blob/local_file_stream_reader.h
@@ -39,7 +39,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileStreamReader : public FileStreamReader {
// it does any succeeding read operations should fail with
// ERR_UPLOAD_FILE_CHANGED error.
LocalFileStreamReader(base::TaskRunner* task_runner,
- const FilePath& file_path,
+ const base::FilePath& file_path,
int64 initial_offset,
const base::Time& expected_modification_time);
virtual ~LocalFileStreamReader();
@@ -71,7 +71,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileStreamReader : public FileStreamReader {
scoped_refptr<base::TaskRunner> task_runner_;
scoped_ptr<net::FileStream> stream_impl_;
- const FilePath file_path_;
+ const base::FilePath file_path_;
const int64 initial_offset_;
const base::Time expected_modification_time_;
bool has_pending_open_;
diff --git a/webkit/blob/local_file_stream_reader_unittest.cc b/webkit/blob/local_file_stream_reader_unittest.cc
index 3aaf005..fa959b3 100644
--- a/webkit/blob/local_file_stream_reader_unittest.cc
+++ b/webkit/blob/local_file_stream_reader_unittest.cc
@@ -81,7 +81,7 @@ class LocalFileStreamReaderTest : public testing::Test {
protected:
LocalFileStreamReader* CreateFileReader(
- const FilePath& path,
+ const base::FilePath& path,
int64 initial_offset,
const base::Time& expected_modification_time) {
return new LocalFileStreamReader(
@@ -103,8 +103,8 @@ class LocalFileStreamReaderTest : public testing::Test {
return file_thread_.message_loop_proxy().get();
}
- FilePath test_dir() const { return dir_.path(); }
- FilePath test_path() const { return dir_.path().AppendASCII("test"); }
+ base::FilePath test_dir() const { return dir_.path(); }
+ base::FilePath test_path() const { return dir_.path().AppendASCII("test"); }
base::Time test_file_modification_time() const {
return test_file_modification_time_;
}
@@ -123,7 +123,7 @@ class LocalFileStreamReaderTest : public testing::Test {
};
TEST_F(LocalFileStreamReaderTest, NonExistent) {
- FilePath nonexistent_path = test_dir().AppendASCII("nonexistent");
+ base::FilePath nonexistent_path = test_dir().AppendASCII("nonexistent");
scoped_ptr<LocalFileStreamReader> reader(
CreateFileReader(nonexistent_path, 0, base::Time()));
int result = 0;
@@ -134,7 +134,7 @@ TEST_F(LocalFileStreamReaderTest, NonExistent) {
}
TEST_F(LocalFileStreamReaderTest, Empty) {
- FilePath empty_path = test_dir().AppendASCII("empty");
+ base::FilePath empty_path = test_dir().AppendASCII("empty");
base::PlatformFileError error = base::PLATFORM_FILE_OK;
base::PlatformFile file = base::CreatePlatformFile(
empty_path,
diff --git a/webkit/blob/shareable_file_reference.cc b/webkit/blob/shareable_file_reference.cc
index f85b97e..07acac3 100644
--- a/webkit/blob/shareable_file_reference.cc
+++ b/webkit/blob/shareable_file_reference.cc
@@ -23,7 +23,7 @@ namespace {
// check thread in the dtor.
class ShareableFileMap {
public:
- typedef std::map<FilePath, ShareableFileReference*> FileMap;
+ typedef std::map<base::FilePath, ShareableFileReference*> FileMap;
typedef FileMap::iterator iterator;
typedef FileMap::key_type key_type;
typedef FileMap::value_type value_type;
@@ -66,7 +66,7 @@ base::LazyInstance<ShareableFileMap> g_file_map = LAZY_INSTANCE_INITIALIZER;
// static
scoped_refptr<ShareableFileReference> ShareableFileReference::Get(
- const FilePath& path) {
+ const base::FilePath& path) {
ShareableFileMap::iterator found = g_file_map.Get().Find(path);
ShareableFileReference* reference =
(found == g_file_map.Get().End()) ? NULL : found->second;
@@ -75,7 +75,7 @@ scoped_refptr<ShareableFileReference> ShareableFileReference::Get(
// static
scoped_refptr<ShareableFileReference> ShareableFileReference::GetOrCreate(
- const FilePath& path, FinalReleasePolicy policy,
+ const base::FilePath& path, FinalReleasePolicy policy,
base::TaskRunner* file_task_runner) {
DCHECK(file_task_runner);
typedef std::pair<ShareableFileMap::iterator, bool> InsertResult;
@@ -101,7 +101,7 @@ void ShareableFileReference::AddFinalReleaseCallback(
}
ShareableFileReference::ShareableFileReference(
- const FilePath& path, FinalReleasePolicy policy,
+ const base::FilePath& path, FinalReleasePolicy policy,
base::TaskRunner* file_task_runner)
: path_(path),
final_release_policy_(policy),
diff --git a/webkit/blob/shareable_file_reference.h b/webkit/blob/shareable_file_reference.h
index 1440586..5323cfa 100644
--- a/webkit/blob/shareable_file_reference.h
+++ b/webkit/blob/shareable_file_reference.h
@@ -25,7 +25,7 @@ namespace webkit_blob {
class WEBKIT_STORAGE_EXPORT ShareableFileReference
: public base::RefCounted<ShareableFileReference> {
public:
- typedef base::Callback<void(const FilePath&)> FinalReleaseCallback;
+ typedef base::Callback<void(const base::FilePath&)> FinalReleaseCallback;
enum FinalReleasePolicy {
DELETE_ON_FINAL_RELEASE,
@@ -34,18 +34,18 @@ class WEBKIT_STORAGE_EXPORT ShareableFileReference
// Returns a ShareableFileReference for the given path, if no reference
// for this path exists returns NULL.
- static scoped_refptr<ShareableFileReference> Get(const FilePath& path);
+ static scoped_refptr<ShareableFileReference> Get(const base::FilePath& path);
// Returns a ShareableFileReference for the given path, creating a new
// reference if none yet exists. If there's a pre-existing reference for
// the path, the deletable parameter of this method is ignored.
static scoped_refptr<ShareableFileReference> GetOrCreate(
- const FilePath& path,
+ const base::FilePath& path,
FinalReleasePolicy policy,
base::TaskRunner* file_task_runner);
// The full file path.
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
// Whether it's to be deleted on final release.
FinalReleasePolicy final_release_policy() const {
@@ -58,12 +58,12 @@ class WEBKIT_STORAGE_EXPORT ShareableFileReference
friend class base::RefCounted<ShareableFileReference>;
ShareableFileReference(
- const FilePath& path,
+ const base::FilePath& path,
FinalReleasePolicy policy,
base::TaskRunner* file_task_runner);
~ShareableFileReference();
- const FilePath path_;
+ const base::FilePath path_;
const FinalReleasePolicy final_release_policy_;
const scoped_refptr<base::TaskRunner> file_task_runner_;
std::vector<FinalReleaseCallback> final_release_callbacks_;
diff --git a/webkit/blob/shareable_file_reference_unittest.cc b/webkit/blob/shareable_file_reference_unittest.cc
index d75a1be..15b6eb1 100644
--- a/webkit/blob/shareable_file_reference_unittest.cc
+++ b/webkit/blob/shareable_file_reference_unittest.cc
@@ -20,7 +20,7 @@ TEST(ShareableFileReferenceTest, TestReferences) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
// Create a file.
- FilePath file;
+ base::FilePath file;
file_util::CreateTemporaryFileInDir(temp_dir.path(), &file);
EXPECT_TRUE(file_util::PathExists(file));
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider.cc b/webkit/chromeos/fileapi/cros_mount_point_provider.cc
index 5c80148..a90fcfa 100644
--- a/webkit/chromeos/fileapi/cros_mount_point_provider.cc
+++ b/webkit/chromeos/fileapi/cros_mount_point_provider.cc
@@ -72,18 +72,18 @@ void CrosMountPointProvider::ValidateFileSystemRoot(
callback.Run(base::PLATFORM_FILE_OK);
}
-FilePath CrosMountPointProvider::GetFileSystemRootPathOnFileThread(
+base::FilePath CrosMountPointProvider::GetFileSystemRootPathOnFileThread(
const fileapi::FileSystemURL& url,
bool create) {
DCHECK(fileapi::IsolatedContext::IsIsolatedType(url.mount_type()));
if (!url.is_valid())
- return FilePath();
+ return base::FilePath();
- FilePath root_path;
+ base::FilePath root_path;
std::string mount_name = url.filesystem_id();
if (!mount_points_->GetRegisteredPath(mount_name, &root_path) &&
!system_mount_points_->GetRegisteredPath(mount_name, &root_path)) {
- return FilePath();
+ return base::FilePath();
}
return root_path.DirName();
@@ -116,7 +116,8 @@ bool CrosMountPointProvider::IsAccessAllowed(
}
// TODO(zelidrag): Share this code with SandboxMountPointProvider impl.
-bool CrosMountPointProvider::IsRestrictedFileName(const FilePath& path) const {
+bool CrosMountPointProvider::IsRestrictedFileName(
+ const base::FilePath& path) const {
return false;
}
@@ -147,12 +148,12 @@ void CrosMountPointProvider::GrantFullAccessToExtension(
for (size_t i = 0; i < files.size(); ++i) {
file_access_permissions_->GrantAccessPermission(
extension_id,
- FilePath::FromUTF8Unsafe(files[i].name));
+ base::FilePath::FromUTF8Unsafe(files[i].name));
}
}
void CrosMountPointProvider::GrantFileAccessToExtension(
- const std::string& extension_id, const FilePath& virtual_path) {
+ const std::string& extension_id, const base::FilePath& virtual_path) {
// All we care about here is access from extensions for now.
DCHECK(special_storage_policy_->IsFileHandler(extension_id));
if (!special_storage_policy_->IsFileHandler(extension_id))
@@ -160,7 +161,7 @@ void CrosMountPointProvider::GrantFileAccessToExtension(
std::string id;
fileapi::FileSystemType type;
- FilePath path;
+ base::FilePath path;
if (!mount_points_->CrackVirtualPath(virtual_path, &id, &type, &path) &&
!system_mount_points_->CrackVirtualPath(virtual_path,
&id, &type, &path)) {
@@ -180,12 +181,12 @@ void CrosMountPointProvider::RevokeAccessForExtension(
file_access_permissions_->RevokePermissions(extension_id);
}
-std::vector<FilePath> CrosMountPointProvider::GetRootDirectories() const {
+std::vector<base::FilePath> CrosMountPointProvider::GetRootDirectories() const {
std::vector<fileapi::MountPoints::MountPointInfo> mount_points;
mount_points_->AddMountPointInfosTo(&mount_points);
system_mount_points_->AddMountPointInfosTo(&mount_points);
- std::vector<FilePath> root_dirs;
+ std::vector<base::FilePath> root_dirs;
for (size_t i = 0; i < mount_points.size(); ++i)
root_dirs.push_back(mount_points[i].path);
return root_dirs;
@@ -272,8 +273,8 @@ fileapi::FileStreamWriter* CrosMountPointProvider::CreateFileStreamWriter(
return new fileapi::LocalFileStreamWriter(url.path(), offset);
}
-bool CrosMountPointProvider::GetVirtualPath(const FilePath& filesystem_path,
- FilePath* virtual_path) {
+bool CrosMountPointProvider::GetVirtualPath(const base::FilePath& filesystem_path,
+ base::FilePath* virtual_path) {
return mount_points_->GetVirtualPath(filesystem_path, virtual_path) ||
system_mount_points_->GetVirtualPath(filesystem_path, virtual_path);
}
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider.h b/webkit/chromeos/fileapi/cros_mount_point_provider.h
index 8da1f54..9c97238 100644
--- a/webkit/chromeos/fileapi/cros_mount_point_provider.h
+++ b/webkit/chromeos/fileapi/cros_mount_point_provider.h
@@ -56,11 +56,11 @@ class WEBKIT_STORAGE_EXPORT CrosMountPointProvider
fileapi::FileSystemType type,
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
- virtual FilePath GetFileSystemRootPathOnFileThread(
+ virtual base::FilePath GetFileSystemRootPathOnFileThread(
const fileapi::FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const fileapi::FileSystemURL& url) OVERRIDE;
- virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
+ virtual bool IsRestrictedFileName(const base::FilePath& filename) const OVERRIDE;
virtual fileapi::FileSystemFileUtil* GetFileUtil(
fileapi::FileSystemType type) OVERRIDE;
virtual fileapi::AsyncFileUtil* GetAsyncFileUtil(
@@ -89,15 +89,15 @@ class WEBKIT_STORAGE_EXPORT CrosMountPointProvider
const DeleteFileSystemCallback& callback) OVERRIDE;
// fileapi::ExternalFileSystemMountPointProvider overrides.
- virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE;
+ virtual std::vector<base::FilePath> GetRootDirectories() const OVERRIDE;
virtual void GrantFullAccessToExtension(
const std::string& extension_id) OVERRIDE;
virtual void GrantFileAccessToExtension(
- const std::string& extension_id, const FilePath& virtual_path) OVERRIDE;
+ const std::string& extension_id, const base::FilePath& virtual_path) OVERRIDE;
virtual void RevokeAccessForExtension(
const std::string& extension_id) OVERRIDE;
- virtual bool GetVirtualPath(const FilePath& filesystem_path,
- FilePath* virtual_path) OVERRIDE;
+ virtual bool GetVirtualPath(const base::FilePath& filesystem_path,
+ base::FilePath* virtual_path) OVERRIDE;
private:
fileapi::RemoteFileSystemProxyInterface* GetRemoteProxy(
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc b/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc
index eb338e3..df4e3b2 100644
--- a/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc
+++ b/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc
@@ -27,7 +27,7 @@ FileSystemURL CreateFileSystemURL(const std::string& extension,
return mount_points->CreateCrackedFileSystemURL(
GURL("chrome-extension://" + extension + "/"),
fileapi::kFileSystemTypeExternal,
- FilePath::FromUTF8Unsafe(path));
+ base::FilePath::FromUTF8Unsafe(path));
}
TEST(CrosMountPointProviderTest, DefaultMountPoints) {
@@ -39,14 +39,14 @@ TEST(CrosMountPointProviderTest, DefaultMountPoints) {
storage_policy,
mount_points.get(),
fileapi::ExternalMountPoints::GetSystemInstance());
- std::vector<FilePath> root_dirs = provider.GetRootDirectories();
- std::set<FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end());
+ std::vector<base::FilePath> root_dirs = provider.GetRootDirectories();
+ std::set<base::FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end());
// By default there should be 3 mount points (in system mount points):
EXPECT_EQ(3u, root_dirs.size());
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/media/removable"))));
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/media/archive"))));
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/usr/share/oem"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/media/removable"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/media/archive"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/usr/share/oem"))));
}
TEST(CrosMountPointProviderTest, GetRootDirectories) {
@@ -66,26 +66,26 @@ TEST(CrosMountPointProviderTest, GetRootDirectories) {
// Register 'local' test mount points.
mount_points->RegisterFileSystem("c",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/a/b/c")));
+ base::FilePath(FPL("/a/b/c")));
mount_points->RegisterFileSystem("d",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/b/c/d")));
+ base::FilePath(FPL("/b/c/d")));
// Register system test mount points.
system_mount_points->RegisterFileSystem("d",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/g/c/d")));
+ base::FilePath(FPL("/g/c/d")));
system_mount_points->RegisterFileSystem("e",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/g/d/e")));
+ base::FilePath(FPL("/g/d/e")));
- std::vector<FilePath> root_dirs = provider.GetRootDirectories();
- std::set<FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end());
+ std::vector<base::FilePath> root_dirs = provider.GetRootDirectories();
+ std::set<base::FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end());
EXPECT_EQ(4u, root_dirs.size());
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/a/b/c"))));
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/b/c/d"))));
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/g/c/d"))));
- EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/g/d/e"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/a/b/c"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/b/c/d"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/g/c/d"))));
+ EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/g/d/e"))));
}
TEST(CrosMountPointProviderTest, AccessPermissions) {
@@ -110,22 +110,22 @@ TEST(CrosMountPointProviderTest, AccessPermissions) {
ASSERT_TRUE(system_mount_points->RegisterFileSystem(
"system",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/g/system"))));
+ base::FilePath(FPL("/g/system"))));
ASSERT_TRUE(mount_points->RegisterFileSystem(
"removable",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/media/removable"))));
+ base::FilePath(FPL("/media/removable"))));
ASSERT_TRUE(mount_points->RegisterFileSystem(
"oem",
fileapi::kFileSystemTypeRestrictedNativeLocal,
- FilePath(FPL("/usr/share/oem"))));
+ base::FilePath(FPL("/usr/share/oem"))));
// Provider specific mount point access.
EXPECT_FALSE(provider.IsAccessAllowed(
CreateFileSystemURL(extension, "removable/foo", mount_points.get())));
provider.GrantFileAccessToExtension(extension,
- FilePath(FPL("removable/foo")));
+ base::FilePath(FPL("removable/foo")));
EXPECT_TRUE(provider.IsAccessAllowed(
CreateFileSystemURL(extension, "removable/foo", mount_points.get())));
EXPECT_FALSE(provider.IsAccessAllowed(
@@ -135,14 +135,14 @@ TEST(CrosMountPointProviderTest, AccessPermissions) {
EXPECT_FALSE(provider.IsAccessAllowed(
CreateFileSystemURL(extension, "system/foo", system_mount_points.get())));
- provider.GrantFileAccessToExtension(extension, FilePath(FPL("system/foo")));
+ provider.GrantFileAccessToExtension(extension, base::FilePath(FPL("system/foo")));
EXPECT_TRUE(provider.IsAccessAllowed(
CreateFileSystemURL(extension, "system/foo", system_mount_points.get())));
EXPECT_FALSE(provider.IsAccessAllowed(CreateFileSystemURL(
extension, "system/foo1", system_mount_points.get())));
// oem is restricted file system.
- provider.GrantFileAccessToExtension(extension, FilePath(FPL("oem/foo")));
+ provider.GrantFileAccessToExtension(extension, base::FilePath(FPL("oem/foo")));
// The extension should not be able to access the file even if
// GrantFileAccessToExtension was called.
EXPECT_FALSE(provider.IsAccessAllowed(
@@ -165,7 +165,7 @@ TEST(CrosMountPointProviderTest, AccessPermissions) {
ASSERT_TRUE(mount_points->RegisterFileSystem(
"test",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("/foo/test"))));
+ base::FilePath(FPL("/foo/test"))));
EXPECT_FALSE(provider.IsAccessAllowed(
CreateFileSystemURL(extension, "test_/foo", mount_points.get())));
@@ -176,7 +176,7 @@ TEST(CrosMountPointProviderTest, AccessPermissions) {
fileapi::FileSystemURL internal_url = FileSystemURL::CreateForTest(
GURL("chrome://foo"),
fileapi::kFileSystemTypeExternal,
- FilePath(FPL("removable/")));
+ base::FilePath(FPL("removable/")));
// Internal WebUI should have full access.
EXPECT_TRUE(provider.IsAccessAllowed(internal_url));
}
@@ -196,24 +196,24 @@ TEST(CrosMountPointProvider, GetVirtualPathConflictWithSystemPoints) {
// Provider specific mount points.
ASSERT_TRUE(
- mount_points->RegisterFileSystem("b", type, FilePath(FPL("/a/b"))));
+ mount_points->RegisterFileSystem("b", type, base::FilePath(FPL("/a/b"))));
ASSERT_TRUE(
- mount_points->RegisterFileSystem("y", type, FilePath(FPL("/z/y"))));
+ mount_points->RegisterFileSystem("y", type, base::FilePath(FPL("/z/y"))));
ASSERT_TRUE(
- mount_points->RegisterFileSystem("n", type, FilePath(FPL("/m/n"))));
+ mount_points->RegisterFileSystem("n", type, base::FilePath(FPL("/m/n"))));
// System mount points
ASSERT_TRUE(system_mount_points->RegisterFileSystem(
- "gb", type, FilePath(FPL("/a/b"))));
+ "gb", type, base::FilePath(FPL("/a/b"))));
ASSERT_TRUE(
- system_mount_points->RegisterFileSystem("gz", type, FilePath(FPL("/z"))));
+ system_mount_points->RegisterFileSystem("gz", type, base::FilePath(FPL("/z"))));
ASSERT_TRUE(system_mount_points->RegisterFileSystem(
- "gp", type, FilePath(FPL("/m/n/o/p"))));
+ "gp", type, base::FilePath(FPL("/m/n/o/p"))));
struct TestCase {
- const FilePath::CharType* const local_path;
+ const base::FilePath::CharType* const local_path;
bool success;
- const FilePath::CharType* const virtual_path;
+ const base::FilePath::CharType* const virtual_path;
};
const TestCase kTestCases[] = {
@@ -231,8 +231,8 @@ TEST(CrosMountPointProvider, GetVirtualPathConflictWithSystemPoints) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
// Initialize virtual path with a value.
- FilePath virtual_path(FPL("/mount"));
- FilePath local_path(kTestCases[i].local_path);
+ base::FilePath virtual_path(FPL("/mount"));
+ base::FilePath local_path(kTestCases[i].local_path);
EXPECT_EQ(kTestCases[i].success,
provider.GetVirtualPath(local_path, &virtual_path))
<< "Resolving " << kTestCases[i].local_path;
@@ -242,7 +242,7 @@ TEST(CrosMountPointProvider, GetVirtualPathConflictWithSystemPoints) {
if (!kTestCases[i].success)
continue;
- FilePath expected_virtual_path(kTestCases[i].virtual_path);
+ base::FilePath expected_virtual_path(kTestCases[i].virtual_path);
EXPECT_EQ(expected_virtual_path, virtual_path)
<< "Resolving " << kTestCases[i].local_path;
}
diff --git a/webkit/chromeos/fileapi/file_access_permissions.cc b/webkit/chromeos/fileapi/file_access_permissions.cc
index 6ab5a04..a435a55 100644
--- a/webkit/chromeos/fileapi/file_access_permissions.cc
+++ b/webkit/chromeos/fileapi/file_access_permissions.cc
@@ -15,7 +15,7 @@ FileAccessPermissions::~FileAccessPermissions() {}
void FileAccessPermissions::GrantAccessPermission(
- const std::string& extension_id, const FilePath& path) {
+ const std::string& extension_id, const base::FilePath& path) {
base::AutoLock locker(lock_);
PathAccessMap::iterator path_map_iter = path_map_.find(extension_id);
if (path_map_iter == path_map_.end()) {
@@ -30,7 +30,7 @@ void FileAccessPermissions::GrantAccessPermission(
}
bool FileAccessPermissions::HasAccessPermission(
- const std::string& extension_id, const FilePath& path) {
+ const std::string& extension_id, const base::FilePath& path) {
base::AutoLock locker(lock_);
PathAccessMap::const_iterator path_map_iter = path_map_.find(extension_id);
if (path_map_iter == path_map_.end())
@@ -38,8 +38,8 @@ bool FileAccessPermissions::HasAccessPermission(
// Check this file and walk up its directory tree to find if this extension
// has access to it.
- FilePath current_path = path.StripTrailingSeparators();
- FilePath last_path;
+ base::FilePath current_path = path.StripTrailingSeparators();
+ base::FilePath last_path;
while (current_path != last_path) {
if (path_map_iter->second.find(current_path) != path_map_iter->second.end())
return true;
diff --git a/webkit/chromeos/fileapi/file_access_permissions.h b/webkit/chromeos/fileapi/file_access_permissions.h
index 9aa0d8b..ba20b44 100644
--- a/webkit/chromeos/fileapi/file_access_permissions.h
+++ b/webkit/chromeos/fileapi/file_access_permissions.h
@@ -21,15 +21,15 @@ class FileAccessPermissions {
// Grants |extension_id| access to |path|.
void GrantAccessPermission(const std::string& extension_id,
- const FilePath& path);
+ const base::FilePath& path);
// Checks id |extension_id| has permission to access to |path|.
bool HasAccessPermission(const std::string& extension_id,
- const FilePath& path);
+ const base::FilePath& path);
// Revokes all file permissions for |extension_id|.
void RevokePermissions(const std::string& extension_id);
private:
- typedef std::set<FilePath> PathSet;
+ typedef std::set<base::FilePath> PathSet;
typedef std::map<std::string, PathSet> PathAccessMap;
base::Lock lock_; // Synchronize all access to path_map_.
diff --git a/webkit/chromeos/fileapi/file_access_permissions_unittest.cc b/webkit/chromeos/fileapi/file_access_permissions_unittest.cc
index b3efbfe..e6cc9ed 100644
--- a/webkit/chromeos/fileapi/file_access_permissions_unittest.cc
+++ b/webkit/chromeos/fileapi/file_access_permissions_unittest.cc
@@ -11,15 +11,15 @@ class FileAccessPermissionsTest : public testing::Test {
TEST_F(FileAccessPermissionsTest, FileAccessChecks) {
#if defined(OS_WIN)
- FilePath good_dir(FILE_PATH_LITERAL("c:\\root\\dir"));
- FilePath bad_dir(FILE_PATH_LITERAL("c:\\root"));
- FilePath good_file(FILE_PATH_LITERAL("c:\\root\\dir\\good_file.txt"));
- FilePath bad_file(FILE_PATH_LITERAL("c:\\root\\dir\\bad_file.txt"));
+ base::FilePath good_dir(FILE_PATH_LITERAL("c:\\root\\dir"));
+ base::FilePath bad_dir(FILE_PATH_LITERAL("c:\\root"));
+ base::FilePath good_file(FILE_PATH_LITERAL("c:\\root\\dir\\good_file.txt"));
+ base::FilePath bad_file(FILE_PATH_LITERAL("c:\\root\\dir\\bad_file.txt"));
#elif defined(OS_POSIX)
- FilePath good_dir(FILE_PATH_LITERAL("/root/dir"));
- FilePath bad_dir(FILE_PATH_LITERAL("/root"));
- FilePath good_file(FILE_PATH_LITERAL("/root/dir/good_file.txt"));
- FilePath bad_file(FILE_PATH_LITERAL("/root/dir/bad_file.txt"));
+ base::FilePath good_dir(FILE_PATH_LITERAL("/root/dir"));
+ base::FilePath bad_dir(FILE_PATH_LITERAL("/root"));
+ base::FilePath good_file(FILE_PATH_LITERAL("/root/dir/good_file.txt"));
+ base::FilePath bad_file(FILE_PATH_LITERAL("/root/dir/bad_file.txt"));
#endif
std::string extension1("ddammdhioacbehjngdmkjcjbnfginlla");
std::string extension2("jkhdjkhkhsdkfhsdkhrterwmtermeter");
diff --git a/webkit/chromeos/fileapi/file_util_async.h b/webkit/chromeos/fileapi/file_util_async.h
index 3cec09d..6d3cca6 100644
--- a/webkit/chromeos/fileapi/file_util_async.h
+++ b/webkit/chromeos/fileapi/file_util_async.h
@@ -51,33 +51,33 @@ class FileUtilAsync {
// PLATFORM_FILE_OK is passed to |callback| with a pointer to newly
// created AsyncFileStream object. The caller should delete the
// stream. On failure, an error code is passed instead.
- virtual void Open(const FilePath& file_path,
+ virtual void Open(const base::FilePath& file_path,
int file_flags, // PlatformFileFlags
const OpenCallback& callback) = 0;
// Gets file info of the given |file_path|. On success,
// PLATFORM_FILE_OK is passed to |callback| with the the obtained file
// info. On failure, an error code is passed instead.
- virtual void GetFileInfo(const FilePath& file_path,
+ virtual void GetFileInfo(const base::FilePath& file_path,
const GetFileInfoCallback& callback) = 0;
// Creates a file of the given |file_path|. On success,
// PLATFORM_FILE_OK is passed to |callback|. On failure, an error code
// is passed instead.
- virtual void Create(const FilePath& file_path,
+ virtual void Create(const base::FilePath& file_path,
const StatusCallback& callback) = 0;
// Truncates a file of the given |file_path| to |length|. On success,
// PLATFORM_FILE_OK is passed to |callback|. On failure, an error code
// is passed instead.
- virtual void Truncate(const FilePath& file_path,
+ virtual void Truncate(const base::FilePath& file_path,
int64 length,
const StatusCallback& callback) = 0;
// Modifies the timestamps of a file of the given |file_path|. On
// success, PLATFORM_FILE_OK is passed to |callback|. On failure, an
// error code is passed instead.
- virtual void Touch(const FilePath& file_path,
+ virtual void Touch(const base::FilePath& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const StatusCallback& callback) = 0;
@@ -86,14 +86,14 @@ class FileUtilAsync {
// is true, removes the contents of the given directory recursively. On
// success, PLATFORM_FILE_OK is passed to |callback|. On failure, an
// error code is passed instead.
- virtual void Remove(const FilePath& file_path,
+ virtual void Remove(const base::FilePath& file_path,
bool recursive,
const StatusCallback& callback) = 0;
// Creates a directory of the given |dir_path|. On success,
// PLATFORM_FILE_OK is passed to |callback|. On failure, an error code
// is passed instead.
- virtual void CreateDirectory(const FilePath& dir_path,
+ virtual void CreateDirectory(const base::FilePath& dir_path,
const StatusCallback& callback) = 0;
// Reads a directory of the given |dir_path|. On success,
@@ -112,7 +112,7 @@ class FileUtilAsync {
// before callback is actually called.
//
// TODO(olege): Maybe make it possible to read only a part of the directory.
- virtual void ReadDirectory(const FilePath& dir_path,
+ virtual void ReadDirectory(const base::FilePath& dir_path,
const ReadDirectoryCallback& callback) = 0;
// TODO(olege): Add LocalCopy and LocalMove.
diff --git a/webkit/chromeos/fileapi/memory_file_util.cc b/webkit/chromeos/fileapi/memory_file_util.cc
index dcedf5a..6d79687 100644
--- a/webkit/chromeos/fileapi/memory_file_util.cc
+++ b/webkit/chromeos/fileapi/memory_file_util.cc
@@ -134,7 +134,7 @@ MemoryFileUtil::FileEntry::FileEntry()
MemoryFileUtil::FileEntry::~FileEntry() {
}
-MemoryFileUtil::MemoryFileUtil(const FilePath& root_path)
+MemoryFileUtil::MemoryFileUtil(const base::FilePath& root_path)
: read_directory_buffer_size_(kDefaultReadDirectoryBufferSize) {
FileEntry root;
root.is_directory = true;
@@ -179,7 +179,7 @@ MemoryFileUtil::~MemoryFileUtil() {
// - OpenVerifiedFile
//
void MemoryFileUtil::Open(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int flags,
const OpenCallback& callback) {
int create_flag = flags & (base::PLATFORM_FILE_OPEN |
@@ -230,7 +230,7 @@ void MemoryFileUtil::Open(
}
void MemoryFileUtil::GetFileInfo(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const GetFileInfoCallback& callback) {
MessageLoop::current()->PostTask(
FROM_HERE,
@@ -239,7 +239,7 @@ void MemoryFileUtil::GetFileInfo(
}
void MemoryFileUtil::Create(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const StatusCallback& callback) {
MessageLoop::current()->PostTask(
FROM_HERE,
@@ -248,7 +248,7 @@ void MemoryFileUtil::Create(
}
void MemoryFileUtil::Truncate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int64 length,
const StatusCallback& callback) {
MessageLoop::current()->PostTask(
@@ -258,7 +258,7 @@ void MemoryFileUtil::Truncate(
}
void MemoryFileUtil::Touch(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const StatusCallback& callback) {
@@ -270,7 +270,7 @@ void MemoryFileUtil::Touch(
}
void MemoryFileUtil::Remove(
- const FilePath& file_path,
+ const base::FilePath& file_path,
bool recursive,
const StatusCallback& callback) {
if (recursive) {
@@ -289,7 +289,7 @@ void MemoryFileUtil::Remove(
}
void MemoryFileUtil::CreateDirectory(
- const FilePath& dir_path,
+ const base::FilePath& dir_path,
const StatusCallback& callback) {
MessageLoop::current()->PostTask(
FROM_HERE,
@@ -299,16 +299,16 @@ void MemoryFileUtil::CreateDirectory(
}
void MemoryFileUtil::ReadDirectory(
- const FilePath& dir_path,
+ const base::FilePath& dir_path,
const ReadDirectoryCallback& callback) {
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&MemoryFileUtil::DoReadDirectory,
base::Unretained(this), dir_path.StripTrailingSeparators(),
- FilePath(), callback));
+ base::FilePath(), callback));
}
-void MemoryFileUtil::DoGetFileInfo(const FilePath& file_path,
+void MemoryFileUtil::DoGetFileInfo(const base::FilePath& file_path,
const GetFileInfoCallback& callback) {
base::PlatformFileInfo file_info;
@@ -334,7 +334,7 @@ void MemoryFileUtil::DoGetFileInfo(const FilePath& file_path,
}
void MemoryFileUtil::DoCreate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
bool is_directory,
const StatusCallback& callback) {
if (FileExists(file_path)) {
@@ -356,7 +356,7 @@ void MemoryFileUtil::DoCreate(
}
void MemoryFileUtil::DoTruncate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int64 length,
const StatusCallback& callback) {
FileIterator file_it = files_.find(file_path);
@@ -374,7 +374,7 @@ void MemoryFileUtil::DoTruncate(
}
void MemoryFileUtil::DoTouch(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const base::Time& last_modified_time,
const StatusCallback& callback) {
FileIterator file_it = files_.find(file_path);
@@ -390,7 +390,7 @@ void MemoryFileUtil::DoTouch(
}
void MemoryFileUtil::DoRemoveSingleFile(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const StatusCallback& callback) {
FileIterator file_it = files_.find(file_path);
if (file_it == files_.end()) {
@@ -416,7 +416,7 @@ void MemoryFileUtil::DoRemoveSingleFile(
}
void MemoryFileUtil::DoRemoveRecursive(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const StatusCallback& callback) {
FileIterator file_it = files_.find(file_path);
if (file_it == files_.end()) {
@@ -445,10 +445,10 @@ void MemoryFileUtil::DoRemoveRecursive(
}
void MemoryFileUtil::DoReadDirectory(
- const FilePath& dir_path,
- const FilePath& in_from,
+ const base::FilePath& dir_path,
+ const base::FilePath& in_from,
const ReadDirectoryCallback& callback) {
- FilePath from = in_from;
+ base::FilePath from = in_from;
read_directory_buffer_.clear();
if (!FileExists(dir_path)) {
@@ -510,7 +510,7 @@ void MemoryFileUtil::DoReadDirectory(
}
void MemoryFileUtil::OpenVerifiedFile(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int flags,
const OpenCallback& callback) {
FileIterator file_it = files_.find(file_path);
@@ -523,7 +523,7 @@ void MemoryFileUtil::OpenVerifiedFile(
}
void MemoryFileUtil::DidGetFileInfoForOpen(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int flags,
const OpenCallback& callback,
PlatformFileError get_info_result,
@@ -550,7 +550,7 @@ void MemoryFileUtil::DidGetFileInfoForOpen(
}
void MemoryFileUtil::OpenTruncatedFileOrCreate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int flags,
const OpenCallback& callback,
PlatformFileError result) {
@@ -571,7 +571,7 @@ void MemoryFileUtil::OpenTruncatedFileOrCreate(
}
void MemoryFileUtil::DidCreateOrTruncateForOpen(
- const FilePath& file_path,
+ const base::FilePath& file_path,
int flags,
int64 size,
const OpenCallback& callback,
diff --git a/webkit/chromeos/fileapi/memory_file_util.h b/webkit/chromeos/fileapi/memory_file_util.h
index 723bada..adbdce6 100644
--- a/webkit/chromeos/fileapi/memory_file_util.h
+++ b/webkit/chromeos/fileapi/memory_file_util.h
@@ -28,104 +28,104 @@ class MemoryFileUtil : public FileUtilAsync {
base::Time last_modified;
};
- MemoryFileUtil(const FilePath& root_path);
+ MemoryFileUtil(const base::FilePath& root_path);
virtual ~MemoryFileUtil();
// FileUtilAsync overrides.
- virtual void Open(const FilePath& file_path,
+ virtual void Open(const base::FilePath& file_path,
int file_flags, // PlatformFileFlags
const OpenCallback& callback) OVERRIDE;
- virtual void GetFileInfo(const FilePath& file_path,
+ virtual void GetFileInfo(const base::FilePath& file_path,
const GetFileInfoCallback& callback) OVERRIDE;
- virtual void Create(const FilePath& file_path,
+ virtual void Create(const base::FilePath& file_path,
const StatusCallback& callback) OVERRIDE;
- virtual void Truncate(const FilePath& file_path,
+ virtual void Truncate(const base::FilePath& file_path,
int64 length,
const StatusCallback& callback) OVERRIDE;
// This FS ignores last_access_time.
- virtual void Touch(const FilePath& file_path,
+ virtual void Touch(const base::FilePath& file_path,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const StatusCallback& callback) OVERRIDE;
- virtual void Remove(const FilePath& file_path,
+ virtual void Remove(const base::FilePath& file_path,
bool recursive,
const StatusCallback& callback) OVERRIDE;
- virtual void CreateDirectory(const FilePath& dir_path,
+ virtual void CreateDirectory(const base::FilePath& dir_path,
const StatusCallback& callback) OVERRIDE;
- virtual void ReadDirectory(const FilePath& dir_path,
+ virtual void ReadDirectory(const base::FilePath& dir_path,
const ReadDirectoryCallback& callback) OVERRIDE;
private:
friend class MemoryFileUtilTest;
- typedef std::map<FilePath, FileEntry>::iterator FileIterator;
- typedef std::map<FilePath, FileEntry>::const_iterator ConstFileIterator;
+ typedef std::map<base::FilePath, FileEntry>::iterator FileIterator;
+ typedef std::map<base::FilePath, FileEntry>::const_iterator ConstFileIterator;
// Returns true if the given |file_path| is present in the file system.
- bool FileExists(const FilePath& file_path) const {
+ bool FileExists(const base::FilePath& file_path) const {
return files_.find(file_path) != files_.end();
}
// Returns true if the given |file_path| is present and a directory.
- bool IsDirectory(const FilePath& file_path) const {
+ bool IsDirectory(const base::FilePath& file_path) const {
ConstFileIterator it = files_.find(file_path);
return it != files_.end() && it->second.is_directory;
}
// Callback function used to implement GetFileInfo().
- void DoGetFileInfo(const FilePath& file_path,
+ void DoGetFileInfo(const base::FilePath& file_path,
const GetFileInfoCallback& callback);
// Callback function used to implement Create().
- void DoCreate(const FilePath& file_path,
+ void DoCreate(const base::FilePath& file_path,
bool is_directory,
const StatusCallback& callback);
// Callback function used to implement Truncate().
- void DoTruncate(const FilePath& file_path,
+ void DoTruncate(const base::FilePath& file_path,
int64 length,
const StatusCallback& callback);
// Callback function used to implement Touch().
- void DoTouch(const FilePath& file_path,
+ void DoTouch(const base::FilePath& file_path,
const base::Time& last_modified_time,
const StatusCallback& callback);
// Callback function used to implement Remove().
- void DoRemoveSingleFile(const FilePath& file_path,
+ void DoRemoveSingleFile(const base::FilePath& file_path,
const StatusCallback& callback);
// Callback function used to implement Remove().
- void DoRemoveRecursive(const FilePath& file_path,
+ void DoRemoveRecursive(const base::FilePath& file_path,
const StatusCallback& callback);
// Will start enumerating with file path |from|. If |from| path is
// empty, will start from the beginning.
- void DoReadDirectory(const FilePath& dir_path,
- const FilePath& from,
+ void DoReadDirectory(const base::FilePath& dir_path,
+ const base::FilePath& from,
const ReadDirectoryCallback& callback);
// Opens a file of the given |file_path| with |flags|. A file is
// guaranteed to be present at |file_path|.
- void OpenVerifiedFile(const FilePath& file_path,
+ void OpenVerifiedFile(const base::FilePath& file_path,
int flags,
const OpenCallback& callback);
// Callback function used to implement Open().
- void DidGetFileInfoForOpen(const FilePath& file_path,
+ void DidGetFileInfoForOpen(const base::FilePath& file_path,
int flags,
const OpenCallback& callback,
PlatformFileError get_info_result,
const base::PlatformFileInfo& file_info);
// Callback function used to implement Open().
- void OpenTruncatedFileOrCreate(const FilePath& file_path,
+ void OpenTruncatedFileOrCreate(const base::FilePath& file_path,
int flags,
const OpenCallback& callback,
PlatformFileError result);
// Callback function used to implement Open().
- void DidCreateOrTruncateForOpen(const FilePath& file_path,
+ void DidCreateOrTruncateForOpen(const base::FilePath& file_path,
int flags,
int64 size,
const OpenCallback& callback,
@@ -138,7 +138,7 @@ class MemoryFileUtil : public FileUtilAsync {
}
// The files in the file system.
- std::map<FilePath, FileEntry> files_;
+ std::map<base::FilePath, FileEntry> files_;
size_t read_directory_buffer_size_;
std::vector<DirectoryEntry> read_directory_buffer_;
diff --git a/webkit/chromeos/fileapi/memory_file_util_unittest.cc b/webkit/chromeos/fileapi/memory_file_util_unittest.cc
index 024e849..b2a0c09 100644
--- a/webkit/chromeos/fileapi/memory_file_util_unittest.cc
+++ b/webkit/chromeos/fileapi/memory_file_util_unittest.cc
@@ -10,7 +10,7 @@
#include "webkit/chromeos/fileapi/memory_file_util.h"
namespace {
-const FilePath::CharType kRootPath[] = "/mnt/memory";
+const base::FilePath::CharType kRootPath[] = "/mnt/memory";
const char kTestString[] = "A test string. A test string.";
const char kTestStringLength = arraysize(kTestString) - 1;
} // namespace
@@ -33,7 +33,7 @@ class MemoryFileUtilTest : public testing::Test {
}
void SetUp() {
- file_util_.reset(new MemoryFileUtil(FilePath(kRootPath)));
+ file_util_.reset(new MemoryFileUtil(base::FilePath(kRootPath)));
}
MemoryFileUtil* file_util() {
@@ -105,13 +105,13 @@ class MemoryFileUtilTest : public testing::Test {
request_id);
}
- int CreateEmptyFile(const FilePath& file_path) {
+ int CreateEmptyFile(const base::FilePath& file_path) {
int request_id = GetNextRequestId();
file_util_->Create(file_path, GetStatusCallback(request_id));
return request_id;
}
- int CreateNonEmptyFile(const FilePath& file_path,
+ int CreateNonEmptyFile(const base::FilePath& file_path,
const char* data,
int length) {
int request_id = GetNextRequestId();
@@ -234,7 +234,7 @@ class MemoryFileUtilTest : public testing::Test {
TEST_F(MemoryFileUtilTest, TestCreateGetFileInfo) {
const int request_id1 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test.txt"),
GetGetFileInfoCallback(request_id1));
// In case the file system is truely asynchronous, RunAllPending is not
@@ -250,7 +250,7 @@ TEST_F(MemoryFileUtilTest, TestCreateGetFileInfo) {
base::Time start_create = base::Time::Now();
const int request_id2 = GetNextRequestId();
- file_util()->Create(FilePath("/mnt/memory/test.txt"),
+ file_util()->Create(base::FilePath("/mnt/memory/test.txt"),
GetStatusCallback(request_id2));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(CALLBACK_TYPE_STATUS, GetStatusType(request_id2));
@@ -258,7 +258,7 @@ TEST_F(MemoryFileUtilTest, TestCreateGetFileInfo) {
ASSERT_EQ(base::PLATFORM_FILE_OK, status.result);
const int request_id3 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test.txt"),
GetGetFileInfoCallback(request_id3));
MessageLoop::current()->RunUntilIdle();
@@ -280,7 +280,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check that the file does not exist.
const int request_id1 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
@@ -293,7 +293,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
base::Time start_create = base::Time::Now();
const int request_id2 = GetNextRequestId();
- file_util()->Open(FilePath("/mnt/memory/test1.txt"),
+ file_util()->Open(base::FilePath("/mnt/memory/test1.txt"),
base::PLATFORM_FILE_CREATE_ALWAYS |
base::PLATFORM_FILE_WRITE,
GetOpenCallback(request_id2));
@@ -310,7 +310,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check that file was created and has 0 size.
const int request_id3 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id3));
MessageLoop::current()->RunUntilIdle();
@@ -340,7 +340,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check that the file has now size 10 and correct modification time.
const int request_id5 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id5));
MessageLoop::current()->RunUntilIdle();
@@ -369,7 +369,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check the file size & modification time.
const int request_id7 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id7));
MessageLoop::current()->RunUntilIdle();
@@ -383,7 +383,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Open file for reading.
const int request_id8 = GetNextRequestId();
- file_util()->Open(FilePath("/mnt/memory/test1.txt"),
+ file_util()->Open(base::FilePath("/mnt/memory/test1.txt"),
base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
GetOpenCallback(request_id8));
MessageLoop::current()->RunUntilIdle();
@@ -413,7 +413,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check that size & modification time have not changed.
const int request_id10 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id10));
MessageLoop::current()->RunUntilIdle();
@@ -427,7 +427,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Open once more for writing.
const int request_id11 = GetNextRequestId();
- file_util()->Open(FilePath("/mnt/memory/test1.txt"),
+ file_util()->Open(base::FilePath("/mnt/memory/test1.txt"),
base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE,
GetOpenCallback(request_id11));
MessageLoop::current()->RunUntilIdle();
@@ -441,7 +441,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check that the size has not changed.
const int request_id12 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id12));
MessageLoop::current()->RunUntilIdle();
@@ -489,7 +489,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
// Check size.
const int request_id17 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/test1.txt"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/test1.txt"),
GetGetFileInfoCallback(request_id17));
MessageLoop::current()->RunUntilIdle();
status = GetStatus(request_id17);
@@ -531,7 +531,7 @@ TEST_F(MemoryFileUtilTest, TestReadWrite) {
TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Check the directory is empty.
const int request_id0 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/"),
GetReadDirectoryCallback(request_id0));
MessageLoop::current()->RunUntilIdle();
@@ -548,18 +548,18 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// complete before starting the next one.
base::Time start_create = base::Time::Now();
- CreateEmptyFile(FilePath("/mnt/memory/a"));
+ CreateEmptyFile(base::FilePath("/mnt/memory/a"));
int request_id1 = GetNextRequestId();
- file_util()->CreateDirectory(FilePath("/mnt/memory/b"),
+ file_util()->CreateDirectory(base::FilePath("/mnt/memory/b"),
GetStatusCallback(request_id1));
- CreateNonEmptyFile(FilePath("/mnt/memory/longer_file_name.txt"),
+ CreateNonEmptyFile(base::FilePath("/mnt/memory/longer_file_name.txt"),
kTestString,
kTestStringLength);
int request_id2 = GetNextRequestId();
- file_util()->CreateDirectory(FilePath("/mnt/memory/c"),
+ file_util()->CreateDirectory(base::FilePath("/mnt/memory/c"),
GetStatusCallback(request_id2));
MessageLoop::current()->RunUntilIdle();
@@ -574,16 +574,16 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
set_read_directory_buffer_size(5); // Should complete in one go.
request_id1 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory"),
GetReadDirectoryCallback(request_id1));
request_id2 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/a"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/a"),
GetReadDirectoryCallback(request_id2));
const int request_id3 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/b/"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/b/"),
GetReadDirectoryCallback(request_id3));
const int request_id4 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/d/"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/d/"),
GetReadDirectoryCallback(request_id4));
MessageLoop::current()->RunUntilIdle();
@@ -595,7 +595,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
ASSERT_EQ(1, status.called); // Because the number of entries < 5.
ASSERT_EQ(4u, status.entries.size());
- std::set<FilePath::StringType> seen;
+ std::set<base::FilePath::StringType> seen;
for (FileUtilAsync::FileList::const_iterator it = status.entries.begin();
it != status.entries.end();
@@ -644,26 +644,26 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// /mnt/memory/b/g/h 0
start_create = base::Time::Now();
- CreateNonEmptyFile(FilePath("/mnt/memory/b/c"),
+ CreateNonEmptyFile(base::FilePath("/mnt/memory/b/c"),
kTestString,
kTestStringLength);
request_id1 = GetNextRequestId();
- file_util()->CreateDirectory(FilePath("/mnt/memory/b/d"),
+ file_util()->CreateDirectory(base::FilePath("/mnt/memory/b/d"),
GetStatusCallback(request_id1));
- CreateEmptyFile(FilePath("/mnt/memory/b/e"));
- CreateNonEmptyFile(FilePath("/mnt/memory/b/f"),
+ CreateEmptyFile(base::FilePath("/mnt/memory/b/e"));
+ CreateNonEmptyFile(base::FilePath("/mnt/memory/b/f"),
kTestString,
kTestStringLength);
request_id2 = GetNextRequestId();
- file_util()->CreateDirectory(FilePath("/mnt/memory/b/g"),
+ file_util()->CreateDirectory(base::FilePath("/mnt/memory/b/g"),
GetStatusCallback(request_id1));
- CreateNonEmptyFile(FilePath("/mnt/memory/b/i"),
+ CreateNonEmptyFile(base::FilePath("/mnt/memory/b/i"),
kTestString,
kTestStringLength);
MessageLoop::current()->RunUntilIdle();
- CreateEmptyFile(FilePath("/mnt/memory/b/g/h"));
+ CreateEmptyFile(base::FilePath("/mnt/memory/b/g/h"));
MessageLoop::current()->RunUntilIdle();
end_create = base::Time::Now();
@@ -671,7 +671,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Read /mnt/memory and check that the number of entries is unchanged.
request_id1 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory"),
GetReadDirectoryCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
@@ -686,7 +686,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Read /mnt/memory/b
request_id1 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/b"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/b"),
GetReadDirectoryCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
@@ -741,7 +741,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Remove single file: /mnt/memory/b/f
request_id1 = GetNextRequestId();
- file_util()->Remove(FilePath("/mnt/memory/b/f"), false /* recursive */,
+ file_util()->Remove(base::FilePath("/mnt/memory/b/f"), false /* recursive */,
GetStatusCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_OK, GetStatus(request_id1).result);
@@ -749,7 +749,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Check the number of files in b/
request_id1 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/b"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/b"),
GetReadDirectoryCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
@@ -763,7 +763,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Try remove /mnt/memory/b non-recursively (error)
request_id1 = GetNextRequestId();
- file_util()->Remove(FilePath("/mnt/memory/b"), false /* recursive */,
+ file_util()->Remove(base::FilePath("/mnt/memory/b"), false /* recursive */,
GetStatusCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE,
@@ -772,13 +772,13 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Non-recursively remove empty directory.
request_id1 = GetNextRequestId();
- file_util()->Remove(FilePath("/mnt/memory/b/d"), false /* recursive */,
+ file_util()->Remove(base::FilePath("/mnt/memory/b/d"), false /* recursive */,
GetStatusCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_OK, GetStatus(request_id1).result);
request_id1 = GetNextRequestId();
- file_util()->GetFileInfo(FilePath("/mnt/memory/b/d"),
+ file_util()->GetFileInfo(base::FilePath("/mnt/memory/b/d"),
GetGetFileInfoCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, GetStatus(request_id1).result);
@@ -786,7 +786,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// Remove /mnt/memory/b recursively.
request_id1 = GetNextRequestId();
- file_util()->Remove(FilePath("/mnt/memory/b"), true /* recursive */,
+ file_util()->Remove(base::FilePath("/mnt/memory/b"), true /* recursive */,
GetStatusCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_OK, GetStatus(request_id1).result);
@@ -794,7 +794,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// ReadDirectory /mnt/memory/b -> not found
request_id1 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory/b"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory/b"),
GetReadDirectoryCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, GetStatus(request_id1).result);
@@ -802,7 +802,7 @@ TEST_F(MemoryFileUtilTest, TestDirectoryOperations) {
// ReadDirectory /mnt/memory
request_id1 = GetNextRequestId();
- file_util()->ReadDirectory(FilePath("/mnt/memory"),
+ file_util()->ReadDirectory(base::FilePath("/mnt/memory"),
GetReadDirectoryCallback(request_id1));
MessageLoop::current()->RunUntilIdle();
diff --git a/webkit/chromeos/fileapi/remote_file_stream_writer.cc b/webkit/chromeos/fileapi/remote_file_stream_writer.cc
index 6fcbd65..d51df11 100644
--- a/webkit/chromeos/fileapi/remote_file_stream_writer.cc
+++ b/webkit/chromeos/fileapi/remote_file_stream_writer.cc
@@ -56,7 +56,7 @@ void RemoteFileStreamWriter::OnFileOpened(
int buf_len,
const net::CompletionCallback& callback,
base::PlatformFileError open_result,
- const FilePath& local_path,
+ const base::FilePath& local_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
has_pending_create_snapshot_ = false;
if (!pending_cancel_callback_.is_null()) {
diff --git a/webkit/chromeos/fileapi/remote_file_stream_writer.h b/webkit/chromeos/fileapi/remote_file_stream_writer.h
index cf341bd3..c68e9db 100644
--- a/webkit/chromeos/fileapi/remote_file_stream_writer.h
+++ b/webkit/chromeos/fileapi/remote_file_stream_writer.h
@@ -52,7 +52,7 @@ class RemoteFileStreamWriter : public fileapi::FileStreamWriter {
int buf_len,
const net::CompletionCallback& callback,
base::PlatformFileError open_result,
- const FilePath& local_path,
+ const base::FilePath& local_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
// Calls |pending_cancel_callback_|, assuming it is non-null.
void InvokePendingCancelCallback(int result);
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.cc b/webkit/chromeos/fileapi/remote_file_system_operation.cc
index 218b5b7..5f0843e 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.cc
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.cc
@@ -236,7 +236,7 @@ void RemoteFileSystemOperation::DidDirectoryExists(
const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused) {
+ const base::FilePath& unused) {
if (rv == base::PLATFORM_FILE_OK && !file_info.is_directory)
rv = base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
callback.Run(rv);
@@ -246,7 +246,7 @@ void RemoteFileSystemOperation::DidFileExists(
const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused) {
+ const base::FilePath& unused) {
if (rv == base::PLATFORM_FILE_OK && file_info.is_directory)
rv = base::PLATFORM_FILE_ERROR_NOT_A_FILE;
callback.Run(rv);
@@ -256,7 +256,7 @@ void RemoteFileSystemOperation::DidGetMetadata(
const GetMetadataCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
callback.Run(rv, file_info, platform_path);
}
@@ -310,7 +310,7 @@ void RemoteFileSystemOperation::DidCreateSnapshotFile(
const SnapshotFileCallback& callback,
base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
callback.Run(result, file_info, platform_path, file_ref);
}
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.h b/webkit/chromeos/fileapi/remote_file_system_operation.h
index 84a6f7d..ba429c1 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.h
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.h
@@ -88,15 +88,15 @@ class RemoteFileSystemOperation : public fileapi::FileSystemOperation {
void DidDirectoryExists(const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused);
+ const base::FilePath& unused);
void DidFileExists(const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused);
+ const base::FilePath& unused);
void DidGetMetadata(const GetMetadataCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
void DidReadDirectory(
const ReadDirectoryCallback& callback,
base::PlatformFileError rv,
@@ -111,7 +111,7 @@ class RemoteFileSystemOperation : public fileapi::FileSystemOperation {
const SnapshotFileCallback& callback,
base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
void DidOpenFile(
const OpenFileCallback& callback,
diff --git a/webkit/database/database_tracker.cc b/webkit/database/database_tracker.cc
index 824c8a2..2cdcfe8 100644
--- a/webkit/database/database_tracker.cc
+++ b/webkit/database/database_tracker.cc
@@ -27,18 +27,18 @@
namespace webkit_database {
-const FilePath::CharType kDatabaseDirectoryName[] =
+const base::FilePath::CharType kDatabaseDirectoryName[] =
FILE_PATH_LITERAL("databases");
-const FilePath::CharType kIncognitoDatabaseDirectoryName[] =
+const base::FilePath::CharType kIncognitoDatabaseDirectoryName[] =
FILE_PATH_LITERAL("databases-incognito");
-const FilePath::CharType kTrackerDatabaseFileName[] =
+const base::FilePath::CharType kTrackerDatabaseFileName[] =
FILE_PATH_LITERAL("Databases.db");
static const int kCurrentVersion = 2;
static const int kCompatibleVersion = 1;
-const FilePath::CharType kTemporaryDirectoryPrefix[] =
+const base::FilePath::CharType kTemporaryDirectoryPrefix[] =
FILE_PATH_LITERAL("DeleteMe");
-const FilePath::CharType kTemporaryDirectoryPattern[] =
+const base::FilePath::CharType kTemporaryDirectoryPattern[] =
FILE_PATH_LITERAL("DeleteMe*");
OriginInfo::OriginInfo()
@@ -77,7 +77,7 @@ OriginInfo::OriginInfo(const string16& origin, int64 total_size)
: origin_(origin), total_size_(total_size) {}
DatabaseTracker::DatabaseTracker(
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
bool is_incognito,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
@@ -280,21 +280,21 @@ string16 DatabaseTracker::GetOriginDirectory(
return origin_directory;
}
-FilePath DatabaseTracker::GetFullDBFilePath(
+base::FilePath DatabaseTracker::GetFullDBFilePath(
const string16& origin_identifier,
const string16& database_name) {
DCHECK(!origin_identifier.empty());
if (!LazyInit())
- return FilePath();
+ return base::FilePath();
int64 id = databases_table_->GetDatabaseID(
origin_identifier, database_name);
if (id < 0)
- return FilePath();
+ return base::FilePath();
- FilePath file_name = FilePath::FromWStringHack(
+ base::FilePath file_name = base::FilePath::FromWStringHack(
UTF8ToWide(base::Int64ToString(id)));
- return db_dir_.Append(FilePath::FromWStringHack(
+ return db_dir_.Append(base::FilePath::FromWStringHack(
UTF16ToWide(GetOriginDirectory(origin_identifier)))).Append(file_name);
}
@@ -352,7 +352,7 @@ bool DatabaseTracker::DeleteClosedDatabase(const string16& origin_identifier,
GetDBFileSize(origin_identifier, database_name) : 0;
// Try to delete the file on the hard drive.
- FilePath db_file = GetFullDBFilePath(origin_identifier, database_name);
+ base::FilePath db_file = GetFullDBFilePath(origin_identifier, database_name);
if (file_util::PathExists(db_file) && !file_util::Delete(db_file, false))
return false;
@@ -398,13 +398,13 @@ bool DatabaseTracker::DeleteOrigin(const string16& origin_identifier,
}
origins_info_map_.erase(origin_identifier);
- FilePath origin_dir = db_dir_.Append(FilePath::FromWStringHack(
+ base::FilePath origin_dir = db_dir_.Append(base::FilePath::FromWStringHack(
UTF16ToWide(origin_identifier)));
// Create a temporary directory to move possibly still existing databases to,
// as we can't delete the origin directory on windows if it contains opened
// files.
- FilePath new_origin_dir;
+ base::FilePath new_origin_dir;
file_util::CreateTemporaryDirInDir(db_dir_,
kTemporaryDirectoryPrefix,
&new_origin_dir);
@@ -412,9 +412,9 @@ bool DatabaseTracker::DeleteOrigin(const string16& origin_identifier,
origin_dir,
false,
file_util::FileEnumerator::FILES);
- for (FilePath database = databases.Next(); !database.empty();
+ for (base::FilePath database = databases.Next(); !database.empty();
database = databases.Next()) {
- FilePath new_file = new_origin_dir.Append(database.BaseName());
+ base::FilePath new_file = new_origin_dir.Append(database.BaseName());
file_util::Move(database, new_file);
}
file_util::Delete(origin_dir, true);
@@ -458,7 +458,7 @@ bool DatabaseTracker::LazyInit() {
false,
file_util::FileEnumerator::DIRECTORIES,
kTemporaryDirectoryPattern);
- for (FilePath directory = directories.Next(); !directory.empty();
+ for (base::FilePath directory = directories.Next(); !directory.empty();
directory = directories.Next()) {
file_util::Delete(directory, true);
}
@@ -466,8 +466,8 @@ bool DatabaseTracker::LazyInit() {
// If the tracker database exists, but it's corrupt or doesn't
// have a meta table, delete the database directory.
- const FilePath kTrackerDatabaseFullPath =
- db_dir_.Append(FilePath(kTrackerDatabaseFileName));
+ const base::FilePath kTrackerDatabaseFullPath =
+ db_dir_.Append(base::FilePath(kTrackerDatabaseFileName));
if (file_util::DirectoryExists(db_dir_) &&
file_util::PathExists(kTrackerDatabaseFullPath) &&
(!db_->Open(kTrackerDatabaseFullPath) ||
@@ -574,7 +574,8 @@ DatabaseTracker::CachedOriginInfo* DatabaseTracker::MaybeGetCachedOriginInfo(
int64 DatabaseTracker::GetDBFileSize(const string16& origin_identifier,
const string16& database_name) {
- FilePath db_file_name = GetFullDBFilePath(origin_identifier, database_name);
+ base::FilePath db_file_name = GetFullDBFilePath(origin_identifier,
+ database_name);
int64 db_file_size = 0;
if (!file_util::GetFileSize(db_file_name, &db_file_size))
db_file_size = 0;
@@ -690,7 +691,7 @@ int DatabaseTracker::DeleteDataModifiedSince(
rv = net::ERR_FAILED;
for (std::vector<DatabaseDetails>::const_iterator db = details.begin();
db != details.end(); ++db) {
- FilePath db_file = GetFullDBFilePath(*ori, db->database_name);
+ base::FilePath db_file = GetFullDBFilePath(*ori, db->database_name);
base::PlatformFileInfo file_info;
file_util::GetFileInfo(db_file, &file_info);
if (file_info.last_modified < cutoff)
@@ -789,7 +790,7 @@ void DatabaseTracker::DeleteIncognitoDBDirectory() {
it != incognito_file_handles_.end(); it++)
base::ClosePlatformFile(it->second);
- FilePath incognito_db_dir =
+ base::FilePath incognito_db_dir =
profile_path_.Append(kIncognitoDatabaseDirectoryName);
if (file_util::DirectoryExists(incognito_db_dir))
file_util::Delete(incognito_db_dir, true);
diff --git a/webkit/database/database_tracker.h b/webkit/database/database_tracker.h
index df3079a..956a72e 100644
--- a/webkit/database/database_tracker.h
+++ b/webkit/database/database_tracker.h
@@ -38,8 +38,9 @@ class SpecialStoragePolicy;
namespace webkit_database {
-WEBKIT_STORAGE_EXPORT extern const FilePath::CharType kDatabaseDirectoryName[];
-WEBKIT_STORAGE_EXPORT extern const FilePath::CharType
+WEBKIT_STORAGE_EXPORT extern const base::FilePath::CharType
+ kDatabaseDirectoryName[];
+WEBKIT_STORAGE_EXPORT extern const base::FilePath::CharType
kTrackerDatabaseFileName[];
class DatabasesTable;
@@ -93,7 +94,7 @@ class WEBKIT_STORAGE_EXPORT DatabaseTracker
virtual ~Observer() {}
};
- DatabaseTracker(const FilePath& profile_path,
+ DatabaseTracker(const base::FilePath& profile_path,
bool is_incognito,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
@@ -119,8 +120,8 @@ class WEBKIT_STORAGE_EXPORT DatabaseTracker
void CloseTrackerDatabaseAndClearCaches();
- const FilePath& DatabaseDirectory() const { return db_dir_; }
- FilePath GetFullDBFilePath(const string16& origin_identifier,
+ const base::FilePath& DatabaseDirectory() const { return db_dir_; }
+ base::FilePath GetFullDBFilePath(const string16& origin_identifier,
const string16& database_name);
// virtual for unit-testing only
@@ -264,8 +265,8 @@ class WEBKIT_STORAGE_EXPORT DatabaseTracker
const bool is_incognito_;
bool force_keep_session_state_;
bool shutting_down_;
- const FilePath profile_path_;
- const FilePath db_dir_;
+ const base::FilePath profile_path_;
+ const base::FilePath db_dir_;
scoped_ptr<sql::Connection> db_;
scoped_ptr<DatabasesTable> databases_table_;
scoped_ptr<sql::MetaTable> meta_table_;
diff --git a/webkit/database/database_tracker_unittest.cc b/webkit/database/database_tracker_unittest.cc
index ef95d8f..e3e3738 100644
--- a/webkit/database/database_tracker_unittest.cc
+++ b/webkit/database/database_tracker_unittest.cc
@@ -158,7 +158,7 @@ class TestQuotaManagerProxy : public quota::QuotaManagerProxy {
};
-bool EnsureFileOfSize(const FilePath& file_path, int64 length) {
+bool EnsureFileOfSize(const base::FilePath& file_path, int64 length) {
base::PlatformFileError error_code(base::PLATFORM_FILE_ERROR_FAILED);
base::PlatformFile file =
base::CreatePlatformFile(
@@ -215,10 +215,10 @@ class DatabaseTracker_TestHelper_Test {
&database_size);
EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(
+ base::FilePath::FromWStringHack(UTF16ToWide(
tracker->GetOriginDirectory(kOrigin1))))));
EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(
+ base::FilePath::FromWStringHack(UTF16ToWide(
tracker->GetOriginDirectory(kOrigin2))))));
EXPECT_EQ(1, file_util::WriteFile(
tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1));
@@ -244,13 +244,13 @@ class DatabaseTracker_TestHelper_Test {
result = callback.GetResult(result);
EXPECT_EQ(net::OK, result);
EXPECT_FALSE(file_util::PathExists(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(kOrigin1)))));
+ base::FilePath::FromWStringHack(UTF16ToWide(kOrigin1)))));
// Recreate db1.
tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0,
&database_size);
EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(
+ base::FilePath::FromWStringHack(UTF16ToWide(
tracker->GetOriginDirectory(kOrigin1))))));
EXPECT_EQ(1, file_util::WriteFile(
tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1));
@@ -280,7 +280,7 @@ class DatabaseTracker_TestHelper_Test {
result = callback.GetResult(result);
EXPECT_EQ(net::OK, result);
EXPECT_FALSE(file_util::PathExists(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(kOrigin1)))));
+ base::FilePath::FromWStringHack(UTF16ToWide(kOrigin1)))));
EXPECT_TRUE(
file_util::PathExists(tracker->GetFullDBFilePath(kOrigin2, kDB2)));
EXPECT_TRUE(
@@ -340,10 +340,10 @@ class DatabaseTracker_TestHelper_Test {
// Write some data to each file and check that the listeners are
// called with the appropriate values.
EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(
+ base::FilePath::FromWStringHack(UTF16ToWide(
tracker->GetOriginDirectory(kOrigin1))))));
EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
- FilePath::FromWStringHack(UTF16ToWide(
+ base::FilePath::FromWStringHack(UTF16ToWide(
tracker->GetOriginDirectory(kOrigin2))))));
EXPECT_EQ(1, file_util::WriteFile(
tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1));
@@ -461,7 +461,7 @@ class DatabaseTracker_TestHelper_Test {
EXPECT_TRUE(test_quota_proxy->WasAccessNotified(kOrigin));
test_quota_proxy->reset();
- FilePath db_file(tracker->GetFullDBFilePath(kOriginId, kName));
+ base::FilePath db_file(tracker->GetFullDBFilePath(kOriginId, kName));
EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName()));
EXPECT_TRUE(EnsureFileOfSize(db_file, 10));
tracker->DatabaseModified(kOriginId, kName);
@@ -543,8 +543,8 @@ class DatabaseTracker_TestHelper_Test {
MessageLoop message_loop;
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath origin1_db_dir;
- FilePath origin2_db_dir;
+ base::FilePath origin1_db_dir;
+ base::FilePath origin2_db_dir;
{
scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy =
new quota::MockSpecialStoragePolicy;
@@ -563,7 +563,7 @@ class DatabaseTracker_TestHelper_Test {
EXPECT_EQ(0, database_size);
// Write some data to each file.
- FilePath db_file;
+ base::FilePath db_file;
db_file = tracker->GetFullDBFilePath(kOrigin1, kDB1);
EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName()));
EXPECT_TRUE(EnsureFileOfSize(db_file, 1));
@@ -599,7 +599,7 @@ class DatabaseTracker_TestHelper_Test {
EXPECT_EQ(kOrigin1, origins_info[0].GetOrigin());
EXPECT_TRUE(
file_util::PathExists(tracker->GetFullDBFilePath(kOrigin1, kDB1)));
- EXPECT_EQ(FilePath(), tracker->GetFullDBFilePath(kOrigin2, kDB2));
+ EXPECT_EQ(base::FilePath(), tracker->GetFullDBFilePath(kOrigin2, kDB2));
// The origin directory of kOrigin1 remains, but the origin directory of
// kOrigin2 is deleted.
@@ -621,8 +621,8 @@ class DatabaseTracker_TestHelper_Test {
MessageLoop message_loop;
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath origin1_db_dir;
- FilePath origin2_db_dir;
+ base::FilePath origin1_db_dir;
+ base::FilePath origin2_db_dir;
{
scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy =
new quota::MockSpecialStoragePolicy;
@@ -642,7 +642,7 @@ class DatabaseTracker_TestHelper_Test {
EXPECT_EQ(0, database_size);
// Write some data to each file.
- FilePath db_file;
+ base::FilePath db_file;
db_file = tracker->GetFullDBFilePath(kOrigin1, kDB1);
EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName()));
EXPECT_TRUE(EnsureFileOfSize(db_file, 1));
@@ -759,7 +759,7 @@ class DatabaseTracker_TestHelper_Test {
int64 database_size = 0;
tracker->DatabaseOpened(kOriginId, kName, kDescription, 0,
&database_size);
- FilePath spoof_db_file = tracker->GetFullDBFilePath(kOriginId, kName);
+ base::FilePath spoof_db_file = tracker->GetFullDBFilePath(kOriginId, kName);
EXPECT_FALSE(tracker->GetFullDBFilePath(kOriginId, kName).empty());
EXPECT_TRUE(file_util::CreateDirectory(spoof_db_file.DirName()));
EXPECT_TRUE(EnsureFileOfSize(spoof_db_file, 1));
@@ -787,7 +787,7 @@ class DatabaseTracker_TestHelper_Test {
// a spoof_db_file on disk in the expected location.
tracker->DatabaseOpened(kOriginId, kName, kDescription, 0,
&database_size);
- FilePath spoof_db_file2 = tracker->GetFullDBFilePath(kOriginId, kName);
+ base::FilePath spoof_db_file2 = tracker->GetFullDBFilePath(kOriginId, kName);
EXPECT_FALSE(tracker->GetFullDBFilePath(kOriginId, kName).empty());
EXPECT_NE(spoof_db_file, spoof_db_file2);
EXPECT_TRUE(file_util::CreateDirectory(spoof_db_file2.DirName()));
diff --git a/webkit/database/database_util.cc b/webkit/database/database_util.cc
index be56a4b..6d5ff95 100644
--- a/webkit/database/database_util.cc
+++ b/webkit/database/database_util.cc
@@ -45,17 +45,17 @@ bool DatabaseUtil::CrackVfsFileName(const string16& vfs_file_name,
return true;
}
-FilePath DatabaseUtil::GetFullFilePathForVfsFile(
+base::FilePath DatabaseUtil::GetFullFilePathForVfsFile(
DatabaseTracker* db_tracker, const string16& vfs_file_name) {
string16 origin_identifier;
string16 database_name;
string16 sqlite_suffix;
if (!CrackVfsFileName(vfs_file_name, &origin_identifier,
&database_name, &sqlite_suffix)) {
- return FilePath(); // invalid vfs_file_name
+ return base::FilePath(); // invalid vfs_file_name
}
- FilePath full_path = db_tracker->GetFullDBFilePath(
+ base::FilePath full_path = db_tracker->GetFullDBFilePath(
origin_identifier, database_name);
if (!full_path.empty() && !sqlite_suffix.empty()) {
DCHECK(full_path.Extension().empty());
@@ -64,8 +64,8 @@ FilePath DatabaseUtil::GetFullFilePathForVfsFile(
}
// Watch out for directory traversal attempts from a compromised renderer.
if (full_path.value().find(FILE_PATH_LITERAL("..")) !=
- FilePath::StringType::npos)
- return FilePath();
+ base::FilePath::StringType::npos)
+ return base::FilePath();
return full_path;
}
diff --git a/webkit/database/database_util.h b/webkit/database/database_util.h
index 67296b3..8158f39 100644
--- a/webkit/database/database_util.h
+++ b/webkit/database/database_util.h
@@ -9,7 +9,9 @@
#include "googleurl/src/gurl.h"
#include "webkit/storage/webkit_storage_export.h"
+namespace base {
class FilePath;
+}
namespace webkit_database {
@@ -25,8 +27,8 @@ class WEBKIT_STORAGE_EXPORT DatabaseUtil {
string16* origin_identifier,
string16* database_name,
string16* sqlite_suffix);
- static FilePath GetFullFilePathForVfsFile(DatabaseTracker* db_tracker,
- const string16& vfs_file_name);
+ static base::FilePath GetFullFilePathForVfsFile(DatabaseTracker* db_tracker,
+ const string16& vfs_file_name);
static string16 GetOriginIdentifier(const GURL& url);
static GURL GetOriginFromIdentifier(const string16& origin_identifier);
};
diff --git a/webkit/database/vfs_backend.cc b/webkit/database/vfs_backend.cc
index a73035d..8d046e2 100644
--- a/webkit/database/vfs_backend.cc
+++ b/webkit/database/vfs_backend.cc
@@ -55,7 +55,7 @@ bool VfsBackend::OpenFileFlagsAreConsistent(int desired_flags) {
}
// static
-void VfsBackend::OpenFile(const FilePath& file_path,
+void VfsBackend::OpenFile(const base::FilePath& file_path,
int desired_flags,
base::PlatformFile* file_handle) {
DCHECK(!file_path.empty());
@@ -100,7 +100,7 @@ void VfsBackend::OpenFile(const FilePath& file_path,
// static
void VfsBackend::OpenTempFileInDirectory(
- const FilePath& dir_path,
+ const base::FilePath& dir_path,
int desired_flags,
base::PlatformFile* file_handle) {
// We should be able to delete temp files when they're closed
@@ -111,7 +111,7 @@ void VfsBackend::OpenTempFileInDirectory(
}
// Get a unique temp file name in the database directory.
- FilePath temp_file_path;
+ base::FilePath temp_file_path;
if (!file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path))
return;
@@ -119,7 +119,7 @@ void VfsBackend::OpenTempFileInDirectory(
}
// static
-int VfsBackend::DeleteFile(const FilePath& file_path, bool sync_dir) {
+int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) {
if (!file_util::PathExists(file_path))
return SQLITE_OK;
if (!file_util::Delete(file_path, false))
@@ -143,7 +143,7 @@ int VfsBackend::DeleteFile(const FilePath& file_path, bool sync_dir) {
}
// static
-uint32 VfsBackend::GetFileAttributes(const FilePath& file_path) {
+uint32 VfsBackend::GetFileAttributes(const base::FilePath& file_path) {
#if defined(OS_WIN)
uint32 attributes = ::GetFileAttributes(file_path.value().c_str());
#elif defined(OS_POSIX)
@@ -159,7 +159,7 @@ uint32 VfsBackend::GetFileAttributes(const FilePath& file_path) {
}
// static
-int64 VfsBackend::GetFileSize(const FilePath& file_path) {
+int64 VfsBackend::GetFileSize(const base::FilePath& file_path) {
int64 size = 0;
return (file_util::GetFileSize(file_path, &size) ? size : 0);
}
diff --git a/webkit/database/vfs_backend.h b/webkit/database/vfs_backend.h
index 8fba3fa..0459958 100644
--- a/webkit/database/vfs_backend.h
+++ b/webkit/database/vfs_backend.h
@@ -10,25 +10,27 @@
#include "base/string16.h"
#include "webkit/storage/webkit_storage_export.h"
+namespace base {
class FilePath;
+}
namespace webkit_database {
class WEBKIT_STORAGE_EXPORT VfsBackend {
public:
- static void OpenFile(const FilePath& file_path,
+ static void OpenFile(const base::FilePath& file_path,
int desired_flags,
base::PlatformFile* file_handle);
- static void OpenTempFileInDirectory(const FilePath& dir_path,
+ static void OpenTempFileInDirectory(const base::FilePath& dir_path,
int desired_flags,
base::PlatformFile* file_handle);
- static int DeleteFile(const FilePath& file_path, bool sync_dir);
+ static int DeleteFile(const base::FilePath& file_path, bool sync_dir);
- static uint32 GetFileAttributes(const FilePath& file_path);
+ static uint32 GetFileAttributes(const base::FilePath& file_path);
- static int64 GetFileSize(const FilePath& file_path);
+ static int64 GetFileSize(const base::FilePath& file_path);
// Used to make decisions in the DatabaseDispatcherHost.
static bool OpenTypeIsReadWrite(int desired_flags);
diff --git a/webkit/dom_storage/dom_storage_area.cc b/webkit/dom_storage/dom_storage_area.cc
index a0c8308..d707a3a 100644
--- a/webkit/dom_storage/dom_storage_area.cc
+++ b/webkit/dom_storage/dom_storage_area.cc
@@ -33,28 +33,28 @@ DomStorageArea::CommitBatch::~CommitBatch() {}
// static
-const FilePath::CharType DomStorageArea::kDatabaseFileExtension[] =
+const base::FilePath::CharType DomStorageArea::kDatabaseFileExtension[] =
FILE_PATH_LITERAL(".localstorage");
// static
-FilePath DomStorageArea::DatabaseFileNameFromOrigin(const GURL& origin) {
+base::FilePath DomStorageArea::DatabaseFileNameFromOrigin(const GURL& origin) {
std::string filename = fileapi::GetOriginIdentifierFromURL(origin);
- // There is no FilePath.AppendExtension() method, so start with just the
+ // There is no base::FilePath.AppendExtension() method, so start with just the
// extension as the filename, and then InsertBeforeExtension the desired
// name.
- return FilePath().Append(kDatabaseFileExtension).
+ return base::FilePath().Append(kDatabaseFileExtension).
InsertBeforeExtensionASCII(filename);
}
// static
-GURL DomStorageArea::OriginFromDatabaseFileName(const FilePath& name) {
+GURL DomStorageArea::OriginFromDatabaseFileName(const base::FilePath& name) {
DCHECK(name.MatchesExtension(kDatabaseFileExtension));
WebKit::WebString origin_id = webkit_base::FilePathToWebString(
name.BaseName().RemoveExtension());
return DatabaseUtil::GetOriginFromIdentifier(origin_id);
}
-DomStorageArea::DomStorageArea(const GURL& origin, const FilePath& directory,
+DomStorageArea::DomStorageArea(const GURL& origin, const base::FilePath& directory,
DomStorageTaskRunner* task_runner)
: namespace_id_(kLocalStorageNamespaceId), origin_(origin),
directory_(directory),
@@ -64,7 +64,7 @@ DomStorageArea::DomStorageArea(const GURL& origin, const FilePath& directory,
is_shutdown_(false),
commit_batches_in_flight_(0) {
if (!directory.empty()) {
- FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_));
+ base::FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_));
backing_.reset(new LocalStorageDatabaseAdapter(path));
is_initial_import_done_ = false;
}
diff --git a/webkit/dom_storage/dom_storage_area.h b/webkit/dom_storage/dom_storage_area.h
index 9a08acf..d9fbcae 100644
--- a/webkit/dom_storage/dom_storage_area.h
+++ b/webkit/dom_storage/dom_storage_area.h
@@ -29,13 +29,13 @@ class WEBKIT_STORAGE_EXPORT DomStorageArea
: public base::RefCountedThreadSafe<DomStorageArea> {
public:
- static const FilePath::CharType kDatabaseFileExtension[];
- static FilePath DatabaseFileNameFromOrigin(const GURL& origin);
- static GURL OriginFromDatabaseFileName(const FilePath& file_name);
+ static const base::FilePath::CharType kDatabaseFileExtension[];
+ static base::FilePath DatabaseFileNameFromOrigin(const GURL& origin);
+ static GURL OriginFromDatabaseFileName(const base::FilePath& file_name);
// Local storage. Backed on disk if directory is nonempty.
DomStorageArea(const GURL& origin,
- const FilePath& directory,
+ const base::FilePath& directory,
DomStorageTaskRunner* task_runner);
// Session storage. Backed on disk if |session_storage_backing| is not NULL.
@@ -119,7 +119,7 @@ class WEBKIT_STORAGE_EXPORT DomStorageArea
int64 namespace_id_;
std::string persistent_namespace_id_;
GURL origin_;
- FilePath directory_;
+ base::FilePath directory_;
scoped_refptr<DomStorageTaskRunner> task_runner_;
scoped_refptr<DomStorageMap> map_;
scoped_ptr<DomStorageDatabaseAdapter> backing_;
diff --git a/webkit/dom_storage/dom_storage_area_unittest.cc b/webkit/dom_storage/dom_storage_area_unittest.cc
index 4513ea3..6667312 100644
--- a/webkit/dom_storage/dom_storage_area_unittest.cc
+++ b/webkit/dom_storage/dom_storage_area_unittest.cc
@@ -126,13 +126,13 @@ TEST_F(DomStorageAreaTest, BackingDatabaseOpened) {
const int64 kSessionStorageNamespaceId = kLocalStorageNamespaceId + 1;
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- const FilePath kExpectedOriginFilePath = temp_dir.path().Append(
+ const base::FilePath kExpectedOriginFilePath = temp_dir.path().Append(
DomStorageArea::DatabaseFileNameFromOrigin(kOrigin));
// No directory, backing should be null.
{
scoped_refptr<DomStorageArea> area(
- new DomStorageArea(kOrigin, FilePath(), NULL));
+ new DomStorageArea(kOrigin, base::FilePath(), NULL));
EXPECT_EQ(NULL, area->backing_.get());
EXPECT_TRUE(area->is_initial_import_done_);
EXPECT_FALSE(file_util::PathExists(kExpectedOriginFilePath));
@@ -315,9 +315,9 @@ TEST_F(DomStorageAreaTest, DeleteOrigin) {
new MockDomStorageTaskRunner(base::MessageLoopProxy::current())));
// This test puts files on disk.
- FilePath db_file_path = static_cast<LocalStorageDatabaseAdapter*>(
+ base::FilePath db_file_path = static_cast<LocalStorageDatabaseAdapter*>(
area->backing_.get())->db_->file_path();
- FilePath db_journal_file_path =
+ base::FilePath db_journal_file_path =
DomStorageDatabase::GetJournalFilePath(db_file_path);
// Nothing bad should happen when invoked w/o any files on disk.
@@ -443,9 +443,9 @@ TEST_F(DomStorageAreaTest, DatabaseFileNames) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCases); ++i) {
GURL origin = GURL(kCases[i].origin).GetOrigin();
- FilePath file_name = FilePath().AppendASCII(kCases[i].file_name);
- FilePath journal_file_name =
- FilePath().AppendASCII(kCases[i].journal_file_name);
+ base::FilePath file_name = base::FilePath().AppendASCII(kCases[i].file_name);
+ base::FilePath journal_file_name =
+ base::FilePath().AppendASCII(kCases[i].journal_file_name);
EXPECT_EQ(file_name,
DomStorageArea::DatabaseFileNameFromOrigin(origin));
@@ -456,17 +456,17 @@ TEST_F(DomStorageAreaTest, DatabaseFileNames) {
}
// Also test some DomStorageDatabase::GetJournalFilePath cases here.
- FilePath parent = FilePath().AppendASCII("a").AppendASCII("b");
+ base::FilePath parent = base::FilePath().AppendASCII("a").AppendASCII("b");
EXPECT_EQ(
parent.AppendASCII("file-journal"),
DomStorageDatabase::GetJournalFilePath(parent.AppendASCII("file")));
EXPECT_EQ(
- FilePath().AppendASCII("-journal"),
- DomStorageDatabase::GetJournalFilePath(FilePath()));
+ base::FilePath().AppendASCII("-journal"),
+ DomStorageDatabase::GetJournalFilePath(base::FilePath()));
EXPECT_EQ(
- FilePath().AppendASCII(".extensiononly-journal"),
+ base::FilePath().AppendASCII(".extensiononly-journal"),
DomStorageDatabase::GetJournalFilePath(
- FilePath().AppendASCII(".extensiononly")));
+ base::FilePath().AppendASCII(".extensiononly")));
}
} // namespace dom_storage
diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc
index 3d32243..45aae74 100644
--- a/webkit/dom_storage/dom_storage_context.cc
+++ b/webkit/dom_storage/dom_storage_context.cc
@@ -25,8 +25,8 @@ namespace dom_storage {
static const int kSessionStoraceScavengingSeconds = 60;
DomStorageContext::DomStorageContext(
- const FilePath& localstorage_directory,
- const FilePath& sessionstorage_directory,
+ const base::FilePath& localstorage_directory,
+ const base::FilePath& sessionstorage_directory,
quota::SpecialStoragePolicy* special_storage_policy,
DomStorageTaskRunner* task_runner)
: localstorage_directory_(localstorage_directory),
@@ -69,7 +69,7 @@ DomStorageNamespace* DomStorageContext::GetStorageNamespace(
if (!file_util::CreateDirectory(localstorage_directory_)) {
LOG(ERROR) << "Failed to create 'Local Storage' directory,"
" falling back to in-memory only.";
- localstorage_directory_ = FilePath();
+ localstorage_directory_ = base::FilePath();
}
}
DomStorageNamespace* local =
@@ -89,7 +89,7 @@ void DomStorageContext::GetLocalStorageUsage(
return;
FileEnumerator enumerator(localstorage_directory_, false,
FileEnumerator::FILES);
- for (FilePath path = enumerator.Next(); !path.empty();
+ for (base::FilePath path = enumerator.Next(); !path.empty();
path = enumerator.Next()) {
if (path.MatchesExtension(DomStorageArea::kDatabaseFileExtension)) {
LocalStorageUsageInfo info;
@@ -313,7 +313,7 @@ void DomStorageContext::ClearSessionOnlyOrigins() {
continue;
const bool kNotRecursive = false;
- FilePath database_file_path = localstorage_directory_.Append(
+ base::FilePath database_file_path = localstorage_directory_.Append(
DomStorageArea::DatabaseFileNameFromOrigin(origin));
file_util::Delete(database_file_path, kNotRecursive);
file_util::Delete(
diff --git a/webkit/dom_storage/dom_storage_context.h b/webkit/dom_storage/dom_storage_context.h
index 3b48833f..76a92b0 100644
--- a/webkit/dom_storage/dom_storage_context.h
+++ b/webkit/dom_storage/dom_storage_context.h
@@ -19,10 +19,10 @@
#include "googleurl/src/gurl.h"
#include "webkit/storage/webkit_storage_export.h"
-class FilePath;
class NullableString16;
namespace base {
+class FilePath;
class Time;
}
@@ -86,18 +86,18 @@ class WEBKIT_STORAGE_EXPORT DomStorageContext
};
DomStorageContext(
- const FilePath& localstorage_directory, // empty for incognito profiles
- const FilePath& sessionstorage_directory, // empty for incognito profiles
+ const base::FilePath& localstorage_directory, // empty for incognito profiles
+ const base::FilePath& sessionstorage_directory, // empty for incognito profiles
quota::SpecialStoragePolicy* special_storage_policy,
DomStorageTaskRunner* task_runner);
// Returns the directory path for localStorage, or an empty directory, if
// there is no backing on disk.
- const FilePath& localstorage_directory() { return localstorage_directory_; }
+ const base::FilePath& localstorage_directory() { return localstorage_directory_; }
// Returns the directory path for sessionStorage, or an empty directory, if
// there is no backing on disk.
- const FilePath& sessionstorage_directory() {
+ const base::FilePath& sessionstorage_directory() {
return sessionstorage_directory_;
}
@@ -190,12 +190,12 @@ class WEBKIT_STORAGE_EXPORT DomStorageContext
StorageNamespaceMap namespaces_;
// Where localstorage data is stored, maybe empty for the incognito use case.
- FilePath localstorage_directory_;
+ base::FilePath localstorage_directory_;
// Where sessionstorage data is stored, maybe empty for the incognito use
// case. Always empty until the file-backed session storage feature is
// implemented.
- FilePath sessionstorage_directory_;
+ base::FilePath sessionstorage_directory_;
// Used to schedule sequenced background tasks.
scoped_refptr<DomStorageTaskRunner> task_runner_;
diff --git a/webkit/dom_storage/dom_storage_context_unittest.cc b/webkit/dom_storage/dom_storage_context_unittest.cc
index 39e8252..f2bebc1 100644
--- a/webkit/dom_storage/dom_storage_context_unittest.cc
+++ b/webkit/dom_storage/dom_storage_context_unittest.cc
@@ -42,7 +42,7 @@ class DomStorageContextTest : public testing::Test {
task_runner_ = new MockDomStorageTaskRunner(
base::MessageLoopProxy::current());
context_ = new DomStorageContext(temp_dir_.path(),
- FilePath(),
+ base::FilePath(),
storage_policy_,
task_runner_);
}
@@ -54,7 +54,7 @@ class DomStorageContextTest : public testing::Test {
void VerifySingleOriginRemains(const GURL& origin) {
// Use a new instance to examine the contexts of temp_dir_.
scoped_refptr<DomStorageContext> context =
- new DomStorageContext(temp_dir_.path(), FilePath(), NULL, NULL);
+ new DomStorageContext(temp_dir_.path(), base::FilePath(), NULL, NULL);
std::vector<LocalStorageUsageInfo> infos;
context->GetLocalStorageUsage(&infos, kDontIncludeFileInfo);
ASSERT_EQ(1u, infos.size());
@@ -75,7 +75,7 @@ TEST_F(DomStorageContextTest, Basics) {
// initializes members properly and that invoking methods
// on a newly created object w/o any data on disk do no harm.
EXPECT_EQ(temp_dir_.path(), context_->localstorage_directory());
- EXPECT_EQ(FilePath(), context_->sessionstorage_directory());
+ EXPECT_EQ(base::FilePath(), context_->sessionstorage_directory());
EXPECT_EQ(storage_policy_.get(), context_->special_storage_policy_.get());
context_->PurgeMemory();
context_->DeleteLocalStorage(GURL("http://chromium.org/"));
@@ -108,7 +108,7 @@ TEST_F(DomStorageContextTest, UsageInfo) {
// Create a new context that points to the same directory, see that
// it knows about the origin that we stored data for.
- context_ = new DomStorageContext(temp_dir_.path(), FilePath(), NULL, NULL);
+ context_ = new DomStorageContext(temp_dir_.path(), base::FilePath(), NULL, NULL);
context_->GetLocalStorageUsage(&infos, kDontIncludeFileInfo);
EXPECT_EQ(1u, infos.size());
EXPECT_EQ(kOrigin, infos[0].origin);
diff --git a/webkit/dom_storage/dom_storage_database.cc b/webkit/dom_storage/dom_storage_database.cc
index 97fd3da..a49e93b 100644
--- a/webkit/dom_storage/dom_storage_database.cc
+++ b/webkit/dom_storage/dom_storage_database.cc
@@ -13,7 +13,7 @@
namespace {
-const FilePath::CharType kJournal[] = FILE_PATH_LITERAL("-journal");
+const base::FilePath::CharType kJournal[] = FILE_PATH_LITERAL("-journal");
class HistogramUniquifier {
public:
@@ -29,14 +29,14 @@ sql::ErrorDelegate* GetErrorHandlerForDomStorageDatabase() {
namespace dom_storage {
// static
-FilePath DomStorageDatabase::GetJournalFilePath(
- const FilePath& database_path) {
- FilePath::StringType journal_file_name =
+base::FilePath DomStorageDatabase::GetJournalFilePath(
+ const base::FilePath& database_path) {
+ base::FilePath::StringType journal_file_name =
database_path.BaseName().value() + kJournal;
return database_path.DirName().Append(journal_file_name);
}
-DomStorageDatabase::DomStorageDatabase(const FilePath& file_path)
+DomStorageDatabase::DomStorageDatabase(const base::FilePath& file_path)
: file_path_(file_path) {
// Note: in normal use we should never get an empty backing path here.
// However, the unit test for this class can contruct an instance
diff --git a/webkit/dom_storage/dom_storage_database.h b/webkit/dom_storage/dom_storage_database.h
index e6fd0db..e11a507 100644
--- a/webkit/dom_storage/dom_storage_database.h
+++ b/webkit/dom_storage/dom_storage_database.h
@@ -22,9 +22,9 @@ namespace dom_storage {
// class is designed to be used on a single thread.
class WEBKIT_STORAGE_EXPORT DomStorageDatabase {
public:
- static FilePath GetJournalFilePath(const FilePath& database_path);
+ static base::FilePath GetJournalFilePath(const base::FilePath& database_path);
- explicit DomStorageDatabase(const FilePath& file_path);
+ explicit DomStorageDatabase(const base::FilePath& file_path);
virtual ~DomStorageDatabase(); // virtual for unit testing
// Reads all the key, value pairs stored in the database and returns
@@ -41,7 +41,7 @@ class WEBKIT_STORAGE_EXPORT DomStorageDatabase {
bool CommitChanges(bool clear_all_first, const ValuesMap& changes);
// Simple getter for the path we were constructed with.
- const FilePath& file_path() const { return file_path_; }
+ const base::FilePath& file_path() const { return file_path_; }
protected:
// Constructor that uses an in-memory sqlite database, for testing.
@@ -107,7 +107,7 @@ class WEBKIT_STORAGE_EXPORT DomStorageDatabase {
void Init();
// Path to the database on disk.
- const FilePath file_path_;
+ const base::FilePath file_path_;
scoped_ptr<sql::Connection> db_;
bool failed_to_open_;
bool tried_to_recreate_;
diff --git a/webkit/dom_storage/dom_storage_database_unittest.cc b/webkit/dom_storage/dom_storage_database_unittest.cc
index 3e9bfbd..79f8afbf 100644
--- a/webkit/dom_storage/dom_storage_database_unittest.cc
+++ b/webkit/dom_storage/dom_storage_database_unittest.cc
@@ -110,7 +110,7 @@ TEST(DomStorageDatabaseTest, SimpleOpenAndClose) {
TEST(DomStorageDatabaseTest, CloseEmptyDatabaseDeletesFile) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
+ base::FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
ValuesMap storage;
CreateMapWithValues(&storage);
@@ -167,7 +167,7 @@ TEST(DomStorageDatabaseTest, TestLazyOpenIsLazy) {
// open a file that already exists when only invoking ReadAllValues.
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
+ base::FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
DomStorageDatabase db(file_name);
EXPECT_FALSE(db.IsOpen());
@@ -214,7 +214,7 @@ TEST(DomStorageDatabaseTest, TestLazyOpenUpgradesDatabase) {
// early if the database is already open).
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
+ base::FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
DomStorageDatabase db(file_name);
db.db_.reset(new sql::Connection());
@@ -301,7 +301,7 @@ TEST(DomStorageDatabaseTest, TestSimpleRemoveOneValue) {
}
TEST(DomStorageDatabaseTest, TestCanOpenAndReadWebCoreDatabase) {
- FilePath webcore_database;
+ base::FilePath webcore_database;
PathService::Get(base::DIR_SOURCE_ROOT, &webcore_database);
webcore_database = webcore_database.AppendASCII("webkit");
webcore_database = webcore_database.AppendASCII("data");
@@ -334,7 +334,7 @@ TEST(DomStorageDatabaseTest, TestCanOpenFileThatIsNotADatabase) {
// Write into the temporary file first.
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
+ base::FilePath file_name = temp_dir.path().AppendASCII("TestDomStorageDatabase.db");
const char kData[] = "I am not a database.";
file_util::WriteFile(file_name, kData, strlen(kData));
diff --git a/webkit/dom_storage/dom_storage_namespace.cc b/webkit/dom_storage/dom_storage_namespace.cc
index ee91ca2..4c1cbd7 100644
--- a/webkit/dom_storage/dom_storage_namespace.cc
+++ b/webkit/dom_storage/dom_storage_namespace.cc
@@ -16,7 +16,7 @@
namespace dom_storage {
DomStorageNamespace::DomStorageNamespace(
- const FilePath& directory,
+ const base::FilePath& directory,
DomStorageTaskRunner* task_runner)
: namespace_id_(kLocalStorageNamespaceId),
directory_(directory),
diff --git a/webkit/dom_storage/dom_storage_namespace.h b/webkit/dom_storage/dom_storage_namespace.h
index e1c72f0..00439c0 100644
--- a/webkit/dom_storage/dom_storage_namespace.h
+++ b/webkit/dom_storage/dom_storage_namespace.h
@@ -27,7 +27,7 @@ class WEBKIT_STORAGE_EXPORT DomStorageNamespace
public:
// Constructor for a LocalStorage namespace with id of 0
// and an optional backing directory on disk.
- DomStorageNamespace(const FilePath& directory, // may be empty
+ DomStorageNamespace(const base::FilePath& directory, // may be empty
DomStorageTaskRunner* task_runner);
// Constructor for a SessionStorage namespace with a non-zero id and an
@@ -83,7 +83,7 @@ class WEBKIT_STORAGE_EXPORT DomStorageNamespace
int64 namespace_id_;
std::string persistent_namespace_id_;
- FilePath directory_;
+ base::FilePath directory_;
AreaMap areas_;
scoped_refptr<DomStorageTaskRunner> task_runner_;
scoped_refptr<SessionStorageDatabase> session_storage_database_;
diff --git a/webkit/dom_storage/local_storage_database_adapter.cc b/webkit/dom_storage/local_storage_database_adapter.cc
index 6e715d7..32f724f 100644
--- a/webkit/dom_storage/local_storage_database_adapter.cc
+++ b/webkit/dom_storage/local_storage_database_adapter.cc
@@ -10,7 +10,7 @@
namespace dom_storage {
LocalStorageDatabaseAdapter::LocalStorageDatabaseAdapter(
- const FilePath& path)
+ const base::FilePath& path)
: db_(new DomStorageDatabase(path)) {
}
diff --git a/webkit/dom_storage/local_storage_database_adapter.h b/webkit/dom_storage/local_storage_database_adapter.h
index f69e87b..e9e646b 100644
--- a/webkit/dom_storage/local_storage_database_adapter.h
+++ b/webkit/dom_storage/local_storage_database_adapter.h
@@ -10,7 +10,9 @@
#include "webkit/dom_storage/dom_storage_database_adapter.h"
#include "webkit/storage/webkit_storage_export.h"
+namespace base {
class FilePath;
+}
namespace dom_storage {
@@ -19,7 +21,7 @@ class DomStorageDatabase;
class WEBKIT_STORAGE_EXPORT LocalStorageDatabaseAdapter :
public DomStorageDatabaseAdapter {
public:
- explicit LocalStorageDatabaseAdapter(const FilePath& path);
+ explicit LocalStorageDatabaseAdapter(const base::FilePath& path);
virtual ~LocalStorageDatabaseAdapter();
virtual void ReadAllValues(ValuesMap* result) OVERRIDE;
virtual bool CommitChanges(bool clear_all_first,
diff --git a/webkit/dom_storage/session_storage_database.cc b/webkit/dom_storage/session_storage_database.cc
index 0f26f56..7944738 100644
--- a/webkit/dom_storage/session_storage_database.cc
+++ b/webkit/dom_storage/session_storage_database.cc
@@ -36,7 +36,7 @@
namespace dom_storage {
-SessionStorageDatabase::SessionStorageDatabase(const FilePath& file_path)
+SessionStorageDatabase::SessionStorageDatabase(const base::FilePath& file_path)
: file_path_(file_path),
db_error_(false),
is_inconsistent_(false) {
diff --git a/webkit/dom_storage/session_storage_database.h b/webkit/dom_storage/session_storage_database.h
index c9fc813..44ecb97 100644
--- a/webkit/dom_storage/session_storage_database.h
+++ b/webkit/dom_storage/session_storage_database.h
@@ -36,7 +36,7 @@ namespace dom_storage {
class WEBKIT_STORAGE_EXPORT SessionStorageDatabase :
public base::RefCountedThreadSafe<SessionStorageDatabase> {
public:
- explicit SessionStorageDatabase(const FilePath& file_path);
+ explicit SessionStorageDatabase(const base::FilePath& file_path);
// Reads the (key, value) pairs for |namespace_id| and |origin|. |result| is
// assumed to be empty and any duplicate keys will be overwritten. If the
@@ -187,7 +187,7 @@ class WEBKIT_STORAGE_EXPORT SessionStorageDatabase :
static const char* NextMapIdKey();
scoped_ptr<leveldb::DB> db_;
- FilePath file_path_;
+ base::FilePath file_path_;
// For protecting the database opening code.
base::Lock db_lock_;
diff --git a/webkit/fileapi/async_file_util.h b/webkit/fileapi/async_file_util.h
index 651d0a51..d00dc82 100644
--- a/webkit/fileapi/async_file_util.h
+++ b/webkit/fileapi/async_file_util.h
@@ -42,7 +42,7 @@ class WEBKIT_STORAGE_EXPORT AsyncFileUtil {
typedef base::Callback<
void(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path)> GetFileInfoCallback;
+ const base::FilePath& platform_path)> GetFileInfoCallback;
typedef base::FileUtilProxy::Entry Entry;
typedef std::vector<base::FileUtilProxy::Entry> EntryList;
@@ -54,7 +54,7 @@ class WEBKIT_STORAGE_EXPORT AsyncFileUtil {
typedef base::Callback<
void(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
SnapshotFilePolicy policy)> CreateSnapshotFileCallback;
AsyncFileUtil() {}
@@ -243,7 +243,7 @@ class WEBKIT_STORAGE_EXPORT AsyncFileUtil {
//
virtual bool CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) = 0;
diff --git a/webkit/fileapi/async_file_util_adapter.cc b/webkit/fileapi/async_file_util_adapter.cc
index 4c6dca1..0b9f2c8 100644
--- a/webkit/fileapi/async_file_util_adapter.cc
+++ b/webkit/fileapi/async_file_util_adapter.cc
@@ -78,7 +78,7 @@ class GetFileInfoHelper {
private:
base::PlatformFileError error_;
base::PlatformFileInfo file_info_;
- FilePath platform_path_;
+ base::FilePath platform_path_;
SnapshotFilePolicy snapshot_policy_;
DISALLOW_COPY_AND_ASSIGN(GetFileInfoHelper);
};
@@ -91,7 +91,7 @@ class ReadDirectoryHelper {
FileSystemOperationContext* context,
const FileSystemURL& url) {
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
PlatformFileError error = file_util->GetFileInfo(
context, url, &file_info, &platform_path);
if (error != base::PLATFORM_FILE_OK) {
@@ -106,7 +106,7 @@ class ReadDirectoryHelper {
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum(
file_util->CreateFileEnumerator(context, url, false /* recursive */));
- FilePath current;
+ base::FilePath current;
while (!(current = file_enum->Next()).empty()) {
AsyncFileUtil::Entry entry;
entry.is_directory = file_enum->IsDirectory();
@@ -257,7 +257,7 @@ bool AsyncFileUtilAdapter::MoveFileLocal(
bool AsyncFileUtilAdapter::CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
return base::PostTaskAndReplyWithResult(
diff --git a/webkit/fileapi/async_file_util_adapter.h b/webkit/fileapi/async_file_util_adapter.h
index da8bb4c..065354d 100644
--- a/webkit/fileapi/async_file_util_adapter.h
+++ b/webkit/fileapi/async_file_util_adapter.h
@@ -82,7 +82,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE AsyncFileUtilAdapter
const StatusCallback& callback) OVERRIDE;
virtual bool CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) OVERRIDE;
virtual bool DeleteFile(
diff --git a/webkit/fileapi/cross_operation_delegate.cc b/webkit/fileapi/cross_operation_delegate.cc
index 86868e2..28bd6da 100644
--- a/webkit/fileapi/cross_operation_delegate.cc
+++ b/webkit/fileapi/cross_operation_delegate.cc
@@ -169,7 +169,7 @@ void CrossOperationDelegate::DidCreateSnapshot(
const StatusCallback& callback,
base::PlatformFileError error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
if (error != base::PLATFORM_FILE_OK) {
callback.Run(error);
@@ -222,7 +222,7 @@ FileSystemURL CrossOperationDelegate::CreateDestURL(
DCHECK_EQ(src_root_.type(), src_url.type());
DCHECK_EQ(src_root_.origin(), src_url.origin());
- FilePath path = dest_root_.path();
+ base::FilePath path = dest_root_.path();
src_root_.path().AppendRelativePath(src_url.path(), &path);
return dest_root_.WithPath(path);
}
diff --git a/webkit/fileapi/cross_operation_delegate.h b/webkit/fileapi/cross_operation_delegate.h
index 1b169f7..3be003a 100644
--- a/webkit/fileapi/cross_operation_delegate.h
+++ b/webkit/fileapi/cross_operation_delegate.h
@@ -55,7 +55,7 @@ class CrossOperationDelegate
const StatusCallback& callback,
base::PlatformFileError error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
void DidFinishCopy(
const FileSystemURL& src,
diff --git a/webkit/fileapi/external_mount_points.cc b/webkit/fileapi/external_mount_points.cc
index bca5b2b..b129911 100644
--- a/webkit/fileapi/external_mount_points.cc
+++ b/webkit/fileapi/external_mount_points.cc
@@ -20,15 +20,15 @@ namespace {
// For example, /a/b/c(1)/d would be erroneously resolved as c/d if the
// following mount points were registered: "/a/b/c", "/a/b/c(1)". (Note:
// "/a/b/c" < "/a/b/c(1)" < "/a/b/c/").
-FilePath NormalizeFilePath(const FilePath& path) {
+base::FilePath NormalizeFilePath(const base::FilePath& path) {
if (path.empty())
return path;
- FilePath::StringType path_str = path.StripTrailingSeparators().value();
- if (!FilePath::IsSeparator(path_str[path_str.length() - 1]))
+ base::FilePath::StringType path_str = path.StripTrailingSeparators().value();
+ if (!base::FilePath::IsSeparator(path_str[path_str.length() - 1]))
path_str.append(FILE_PATH_LITERAL("/"));
- return FilePath(path_str).NormalizePathSeparators();
+ return base::FilePath(path_str).NormalizePathSeparators();
}
// Wrapper around ref-counted ExternalMountPoints that will be used to lazily
@@ -53,15 +53,15 @@ class SystemMountPointsLazyWrapper {
system_mount_points_->RegisterFileSystem(
"archive",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FILE_PATH_LITERAL("/media/archive")));
+ base::FilePath(FILE_PATH_LITERAL("/media/archive")));
system_mount_points_->RegisterFileSystem(
"removable",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FILE_PATH_LITERAL("/media/removable")));
+ base::FilePath(FILE_PATH_LITERAL("/media/removable")));
system_mount_points_->RegisterFileSystem(
"oem",
fileapi::kFileSystemTypeRestrictedNativeLocal,
- FilePath(FILE_PATH_LITERAL("/usr/share/oem")));
+ base::FilePath(FILE_PATH_LITERAL("/usr/share/oem")));
#endif // defined(OS_CHROMEOS)
}
@@ -78,20 +78,20 @@ namespace fileapi {
class ExternalMountPoints::Instance {
public:
Instance(FileSystemType type,
- const FilePath& path,
+ const base::FilePath& path,
RemoteFileSystemProxyInterface* remote_proxy);
~Instance();
FileSystemType type() const { return type_; }
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
RemoteFileSystemProxyInterface* remote_proxy() const {
return remote_proxy_.get();
}
private:
const FileSystemType type_;
- const FilePath path_;
+ const base::FilePath path_;
// For file systems that have a remote file system proxy.
scoped_refptr<RemoteFileSystemProxyInterface> remote_proxy_;
@@ -100,7 +100,7 @@ class ExternalMountPoints::Instance {
};
ExternalMountPoints::Instance::Instance(FileSystemType type,
- const FilePath& path,
+ const base::FilePath& path,
RemoteFileSystemProxyInterface* proxy)
: type_(type),
path_(path.StripTrailingSeparators()),
@@ -125,7 +125,7 @@ scoped_refptr<ExternalMountPoints> ExternalMountPoints::CreateRefCounted() {
bool ExternalMountPoints::RegisterFileSystem(
const std::string& mount_name,
FileSystemType type,
- const FilePath& path) {
+ const base::FilePath& path) {
return RegisterRemoteFileSystem(mount_name, type, NULL, path);
}
@@ -133,10 +133,10 @@ bool ExternalMountPoints::RegisterRemoteFileSystem(
const std::string& mount_name,
FileSystemType type,
RemoteFileSystemProxyInterface* remote_proxy,
- const FilePath& path_in) {
+ const base::FilePath& path_in) {
base::AutoLock locker(lock_);
- FilePath path = NormalizeFilePath(path_in);
+ base::FilePath path = NormalizeFilePath(path_in);
if (!ValidateNewMountPoint(mount_name, path))
return false;
@@ -164,7 +164,7 @@ bool ExternalMountPoints::RevokeFileSystem(const std::string& mount_name) {
}
bool ExternalMountPoints::GetRegisteredPath(
- const std::string& filesystem_id, FilePath* path) const {
+ const std::string& filesystem_id, base::FilePath* path) const {
DCHECK(path);
base::AutoLock locker(lock_);
NameToInstance::const_iterator found = instance_map_.find(filesystem_id);
@@ -174,10 +174,10 @@ bool ExternalMountPoints::GetRegisteredPath(
return true;
}
-bool ExternalMountPoints::CrackVirtualPath(const FilePath& virtual_path,
+bool ExternalMountPoints::CrackVirtualPath(const base::FilePath& virtual_path,
std::string* mount_name,
FileSystemType* type,
- FilePath* path) const {
+ base::FilePath* path) const {
DCHECK(mount_name);
DCHECK(path);
@@ -186,18 +186,18 @@ bool ExternalMountPoints::CrackVirtualPath(const FilePath& virtual_path,
return false;
// The virtual_path should comprise of <mount_name> and <relative_path> parts.
- std::vector<FilePath::StringType> components;
+ std::vector<base::FilePath::StringType> components;
virtual_path.GetComponents(&components);
if (components.size() < 1)
return false;
- std::vector<FilePath::StringType>::iterator component_iter =
+ std::vector<base::FilePath::StringType>::iterator component_iter =
components.begin();
- std::string maybe_mount_name = FilePath(*component_iter++).MaybeAsASCII();
+ std::string maybe_mount_name = base::FilePath(*component_iter++).MaybeAsASCII();
if (maybe_mount_name.empty())
return false;
- FilePath cracked_path;
+ base::FilePath cracked_path;
{
base::AutoLock locker(lock_);
NameToInstance::const_iterator found_instance =
@@ -230,13 +230,13 @@ FileSystemURL ExternalMountPoints::CrackURL(const GURL& url) const {
FileSystemURL ExternalMountPoints::CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
- const FilePath& path) const {
+ const base::FilePath& path) const {
if (!HandlesFileSystemMountType(type))
return FileSystemURL();
std::string mount_name;
FileSystemType cracked_type;
- FilePath cracked_path;
+ base::FilePath cracked_path;
if (!CrackVirtualPath(path, &mount_name, &cracked_type, &cracked_path))
return FileSystemURL();
@@ -263,14 +263,14 @@ void ExternalMountPoints::AddMountPointInfosTo(
}
}
-bool ExternalMountPoints::GetVirtualPath(const FilePath& path_in,
- FilePath* virtual_path) {
+bool ExternalMountPoints::GetVirtualPath(const base::FilePath& path_in,
+ base::FilePath* virtual_path) {
DCHECK(virtual_path);
base::AutoLock locker(lock_);
- FilePath path = NormalizeFilePath(path_in);
- std::map<FilePath, std::string>::reverse_iterator iter(
+ base::FilePath path = NormalizeFilePath(path_in);
+ std::map<base::FilePath, std::string>::reverse_iterator iter(
path_to_name_map_.upper_bound(path));
if (iter == path_to_name_map_.rend())
return false;
@@ -281,9 +281,9 @@ bool ExternalMountPoints::GetVirtualPath(const FilePath& path_in,
return iter->first.AppendRelativePath(path, virtual_path);
}
-FilePath ExternalMountPoints::CreateVirtualRootPath(
+base::FilePath ExternalMountPoints::CreateVirtualRootPath(
const std::string& mount_name) const {
- return FilePath().AppendASCII(mount_name);
+ return base::FilePath().AppendASCII(mount_name);
}
ExternalMountPoints::ExternalMountPoints() {}
@@ -294,7 +294,7 @@ ExternalMountPoints::~ExternalMountPoints() {
}
bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
- const FilePath& path) {
+ const base::FilePath& path) {
lock_.AssertAcquired();
// Mount name must not be empty.
@@ -315,7 +315,7 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
return false;
// Check there the new path does not overlap with one of the existing ones.
- std::map<FilePath, std::string>::reverse_iterator potential_parent(
+ std::map<base::FilePath, std::string>::reverse_iterator potential_parent(
path_to_name_map_.upper_bound(path));
if (potential_parent != path_to_name_map_.rend()) {
if (potential_parent->first == path ||
@@ -324,7 +324,7 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
}
}
- std::map<FilePath, std::string>::iterator potential_child =
+ std::map<base::FilePath, std::string>::iterator potential_child =
path_to_name_map_.upper_bound(path);
if (potential_child == path_to_name_map_.end())
return true;
@@ -335,13 +335,13 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name,
ScopedExternalFileSystem::ScopedExternalFileSystem(
const std::string& mount_name,
FileSystemType type,
- const FilePath& path)
+ const base::FilePath& path)
: mount_name_(mount_name) {
ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
mount_name, type, path);
}
-FilePath ScopedExternalFileSystem::GetVirtualRootPath() const {
+base::FilePath ScopedExternalFileSystem::GetVirtualRootPath() const {
return ExternalMountPoints::GetSystemInstance()->
CreateVirtualRootPath(mount_name_);
}
diff --git a/webkit/fileapi/external_mount_points.h b/webkit/fileapi/external_mount_points.h
index f2d8e29..a2660c2 100644
--- a/webkit/fileapi/external_mount_points.h
+++ b/webkit/fileapi/external_mount_points.h
@@ -15,7 +15,9 @@
#include "webkit/fileapi/mount_points.h"
#include "webkit/storage/webkit_storage_export.h"
+namespace base {
class FilePath;
+}
namespace fileapi {
class FileSystemURL;
@@ -60,29 +62,29 @@ class WEBKIT_STORAGE_EXPORT ExternalMountPoints
// by calling RevokeFileSystem with |mount_name|.
bool RegisterFileSystem(const std::string& mount_name,
FileSystemType type,
- const FilePath& path);
+ const base::FilePath& path);
// Same as |RegisterExternalFileSystem|, but also registers a remote file
// system proxy for the file system.
bool RegisterRemoteFileSystem(const std::string& mount_name,
FileSystemType type,
RemoteFileSystemProxyInterface* remote_proxy,
- const FilePath& path);
+ const base::FilePath& path);
// MountPoints overrides.
virtual bool HandlesFileSystemMountType(FileSystemType type) const OVERRIDE;
virtual bool RevokeFileSystem(const std::string& mount_name) OVERRIDE;
virtual bool GetRegisteredPath(const std::string& mount_name,
- FilePath* path) const OVERRIDE;
- virtual bool CrackVirtualPath(const FilePath& virtual_path,
+ base::FilePath* path) const OVERRIDE;
+ virtual bool CrackVirtualPath(const base::FilePath& virtual_path,
std::string* mount_name,
FileSystemType* type,
- FilePath* path) const OVERRIDE;
+ base::FilePath* path) const OVERRIDE;
virtual FileSystemURL CrackURL(const GURL& url) const OVERRIDE;
virtual FileSystemURL CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
- const FilePath& path) const OVERRIDE;
+ const base::FilePath& path) const OVERRIDE;
// Retrieves the remote file system proxy for the registered file system.
// Returns NULL if there is no file system with the given name, or if the file
@@ -102,10 +104,11 @@ class WEBKIT_STORAGE_EXPORT ExternalMountPoints
// part of any registered filesystem).
//
// Returned virtual_path will have normalized path separators.
- bool GetVirtualPath(const FilePath& absolute_path, FilePath* virtual_path);
+ bool GetVirtualPath(const base::FilePath& absolute_path,
+ base::FilePath* virtual_path);
// Returns the virtual root path that looks like /<mount_name>.
- FilePath CreateVirtualRootPath(const std::string& mount_name) const;
+ base::FilePath CreateVirtualRootPath(const std::string& mount_name) const;
private:
friend class base::RefCountedThreadSafe<ExternalMountPoints>;
@@ -116,7 +119,7 @@ class WEBKIT_STORAGE_EXPORT ExternalMountPoints
typedef std::map<std::string, Instance*> NameToInstance;
// Reverse map from registered path to its corresponding mount name.
- typedef std::map<FilePath, std::string> PathToName;
+ typedef std::map<base::FilePath, std::string> PathToName;
// Use |GetSystemInstance| of |CreateRefCounted| to get an instance.
ExternalMountPoints();
@@ -131,7 +134,7 @@ class WEBKIT_STORAGE_EXPORT ExternalMountPoints
//
// |lock_| should be taken before calling this method.
bool ValidateNewMountPoint(const std::string& mount_name,
- const FilePath& path);
+ const base::FilePath& path);
// This lock needs to be obtained when accessing the instance_map_.
mutable base::Lock lock_;
@@ -147,10 +150,10 @@ class WEBKIT_STORAGE_EXPORT ScopedExternalFileSystem {
public:
ScopedExternalFileSystem(const std::string& mount_name,
FileSystemType type,
- const FilePath& path);
+ const base::FilePath& path);
~ScopedExternalFileSystem();
- FilePath GetVirtualRootPath() const;
+ base::FilePath GetVirtualRootPath() const;
private:
const std::string mount_name_;
diff --git a/webkit/fileapi/external_mount_points_unittest.cc b/webkit/fileapi/external_mount_points_unittest.cc
index 4668264..c8edbdd 100644
--- a/webkit/fileapi/external_mount_points_unittest.cc
+++ b/webkit/fileapi/external_mount_points_unittest.cc
@@ -30,12 +30,12 @@ TEST(ExternalMountPointsTest, AddMountPoint) {
// The mount point's name.
const char* const name;
// The mount point's path.
- const FilePath::CharType* const path;
+ const base::FilePath::CharType* const path;
// Whether the mount point registration should succeed.
bool success;
// Path returned by GetRegisteredPath. NULL if the method is expected to
// fail.
- const FilePath::CharType* const registered_path;
+ const base::FilePath::CharType* const registered_path;
};
const TestCase kTestCases[] = {
@@ -111,20 +111,20 @@ TEST(ExternalMountPointsTest, AddMountPoint) {
mount_points->RegisterFileSystem(
kTestCases[i].name,
fileapi::kFileSystemTypeNativeLocal,
- FilePath(kTestCases[i].path)))
+ base::FilePath(kTestCases[i].path)))
<< "Adding mount point: " << kTestCases[i].name << " with path "
<< kTestCases[i].path;
}
// Test that final mount point presence state is as expected.
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- FilePath found_path;
+ base::FilePath found_path;
EXPECT_EQ(kTestCases[i].registered_path != NULL,
mount_points->GetRegisteredPath(kTestCases[i].name, &found_path))
<< "Test case: " << i;
if (kTestCases[i].registered_path) {
- FilePath expected_path(kTestCases[i].registered_path);
+ base::FilePath expected_path(kTestCases[i].registered_path);
EXPECT_EQ(expected_path.NormalizePathSeparators(), found_path);
}
}
@@ -136,30 +136,30 @@ TEST(ExternalMountPointsTest, GetVirtualPath) {
mount_points->RegisterFileSystem("c",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/a/b/c")));
+ base::FilePath(DRIVE FPL("/a/b/c")));
// Note that "/a/b/c" < "/a/b/c(1)" < "/a/b/c/".
mount_points->RegisterFileSystem("c(1)",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/a/b/c(1)")));
+ base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem("x",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/z/y/x")));
+ base::FilePath(DRIVE FPL("/z/y/x")));
mount_points->RegisterFileSystem("o",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/m/n/o")));
+ base::FilePath(DRIVE FPL("/m/n/o")));
// A mount point whose name does not match its path base name.
mount_points->RegisterFileSystem("mount",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/root/foo")));
+ base::FilePath(DRIVE FPL("/root/foo")));
// A mount point with an empty path.
mount_points->RegisterFileSystem("empty_path",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(FPL("")));
+ base::FilePath(FPL("")));
struct TestCase {
- const FilePath::CharType* const local_path;
+ const base::FilePath::CharType* const local_path;
bool success;
- const FilePath::CharType* const virtual_path;
+ const base::FilePath::CharType* const virtual_path;
};
const TestCase kTestCases[] = {
@@ -209,8 +209,8 @@ TEST(ExternalMountPointsTest, GetVirtualPath) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
// Initialize virtual path with a value.
- FilePath virtual_path(DRIVE FPL("/mount"));
- FilePath local_path(kTestCases[i].local_path);
+ base::FilePath virtual_path(DRIVE FPL("/mount"));
+ base::FilePath local_path(kTestCases[i].local_path);
EXPECT_EQ(kTestCases[i].success,
mount_points->GetVirtualPath(local_path, &virtual_path))
<< "Resolving " << kTestCases[i].local_path;
@@ -220,7 +220,7 @@ TEST(ExternalMountPointsTest, GetVirtualPath) {
if (!kTestCases[i].success)
continue;
- FilePath expected_virtual_path(kTestCases[i].virtual_path);
+ base::FilePath expected_virtual_path(kTestCases[i].virtual_path);
EXPECT_EQ(expected_virtual_path.NormalizePathSeparators(), virtual_path)
<< "Resolving " << kTestCases[i].local_path;
}
@@ -231,7 +231,7 @@ TEST(ExternalMountPointsTest, HandlesFileSystemMountType) {
fileapi::ExternalMountPoints::CreateRefCounted());
const GURL test_origin("http://chromium.org");
- const FilePath test_path(FPL("/mount"));
+ const base::FilePath test_path(FPL("/mount"));
// Should handle External File System.
EXPECT_TRUE(mount_points->HandlesFileSystemMountType(
@@ -265,16 +265,16 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
mount_points->RegisterFileSystem("c",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/a/b/c")));
+ base::FilePath(DRIVE FPL("/a/b/c")));
mount_points->RegisterFileSystem("c(1)",
fileapi::kFileSystemTypeDrive,
- FilePath(DRIVE FPL("/a/b/c(1)")));
+ base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem("empty_path",
fileapi::kFileSystemTypeSyncable,
- FilePath(FPL("")));
+ base::FilePath(FPL("")));
mount_points->RegisterFileSystem("mount",
fileapi::kFileSystemTypeDrive,
- FilePath(DRIVE FPL("/root")));
+ base::FilePath(DRIVE FPL("/root")));
// Try cracking invalid GURL.
FileSystemURL invalid = mount_points->CrackURL(GURL("http://chromium.og"));
@@ -282,19 +282,19 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
// Try cracking isolated path.
FileSystemURL isolated = mount_points->CreateCrackedFileSystemURL(
- kTestOrigin, fileapi::kFileSystemTypeIsolated, FilePath(FPL("c")));
+ kTestOrigin, fileapi::kFileSystemTypeIsolated, base::FilePath(FPL("c")));
EXPECT_FALSE(isolated.is_valid());
// Try native local which is not cracked.
FileSystemURL native_local = mount_points->CreateCrackedFileSystemURL(
- kTestOrigin, fileapi::kFileSystemTypeNativeLocal, FilePath(FPL("c")));
+ kTestOrigin, fileapi::kFileSystemTypeNativeLocal, base::FilePath(FPL("c")));
EXPECT_FALSE(native_local.is_valid());
struct TestCase {
- const FilePath::CharType* const path;
+ const base::FilePath::CharType* const path;
bool expect_valid;
fileapi::FileSystemType expect_type;
- const FilePath::CharType* const expect_path;
+ const base::FilePath::CharType* const expect_path;
const char* const expect_fs_id;
};
@@ -343,7 +343,7 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
FileSystemURL cracked = mount_points->CreateCrackedFileSystemURL(
kTestOrigin,
fileapi::kFileSystemTypeExternal,
- FilePath(kTestCases[i].path));
+ base::FilePath(kTestCases[i].path));
EXPECT_EQ(kTestCases[i].expect_valid, cracked.is_valid())
<< "Test case index: " << i;
@@ -355,10 +355,10 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
<< "Test case index: " << i;
EXPECT_EQ(kTestCases[i].expect_type, cracked.type())
<< "Test case index: " << i;
- EXPECT_EQ(FilePath(kTestCases[i].expect_path).NormalizePathSeparators(),
+ EXPECT_EQ(base::FilePath(kTestCases[i].expect_path).NormalizePathSeparators(),
cracked.path())
<< "Test case index: " << i;
- EXPECT_EQ(FilePath(kTestCases[i].path).NormalizePathSeparators(),
+ EXPECT_EQ(base::FilePath(kTestCases[i].path).NormalizePathSeparators(),
cracked.virtual_path())
<< "Test case index: " << i;
EXPECT_EQ(kTestCases[i].expect_fs_id, cracked.filesystem_id())
@@ -376,22 +376,22 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
mount_points->RegisterFileSystem("c",
fileapi::kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/a/b/c")));
+ base::FilePath(DRIVE FPL("/a/b/c")));
mount_points->RegisterFileSystem("c(1)",
fileapi::kFileSystemTypeDrive,
- FilePath(DRIVE FPL("/a/b/c(1)")));
+ base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem("empty_path",
fileapi::kFileSystemTypeSyncable,
- FilePath(FPL("")));
+ base::FilePath(FPL("")));
mount_points->RegisterFileSystem("mount",
fileapi::kFileSystemTypeDrive,
- FilePath(DRIVE FPL("/root")));
+ base::FilePath(DRIVE FPL("/root")));
struct TestCase {
- const FilePath::CharType* const path;
+ const base::FilePath::CharType* const path;
bool expect_valid;
fileapi::FileSystemType expect_type;
- const FilePath::CharType* const expect_path;
+ const base::FilePath::CharType* const expect_path;
const char* const expect_name;
};
@@ -439,9 +439,9 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
std::string cracked_name;
fileapi::FileSystemType cracked_type;
- FilePath cracked_path;
+ base::FilePath cracked_path;
EXPECT_EQ(kTestCases[i].expect_valid,
- mount_points->CrackVirtualPath(FilePath(kTestCases[i].path),
+ mount_points->CrackVirtualPath(base::FilePath(kTestCases[i].path),
&cracked_name, &cracked_type, &cracked_path))
<< "Test case index: " << i;
@@ -450,7 +450,7 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
EXPECT_EQ(kTestCases[i].expect_type, cracked_type)
<< "Test case index: " << i;
- EXPECT_EQ(FilePath(kTestCases[i].expect_path).NormalizePathSeparators(),
+ EXPECT_EQ(base::FilePath(kTestCases[i].expect_path).NormalizePathSeparators(),
cracked_path)
<< "Test case index: " << i;
EXPECT_EQ(kTestCases[i].expect_name, cracked_name)
diff --git a/webkit/fileapi/file_system_callback_dispatcher.h b/webkit/fileapi/file_system_callback_dispatcher.h
index af0a757..990e633 100644
--- a/webkit/fileapi/file_system_callback_dispatcher.h
+++ b/webkit/fileapi/file_system_callback_dispatcher.h
@@ -30,7 +30,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemCallbackDispatcher {
// Callback to report information for a file.
virtual void DidReadMetadata(
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) = 0;
+ const base::FilePath& platform_path) = 0;
// Callback to report the contents of a directory. If the contents of
// the given directory are reported in one batch, then |entries| will have
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
index 67cbc6d..ab8c929 100644
--- a/webkit/fileapi/file_system_context.cc
+++ b/webkit/fileapi/file_system_context.cc
@@ -58,7 +58,7 @@ FileSystemContext::FileSystemContext(
ExternalMountPoints* external_mount_points,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
- const FilePath& partition_path,
+ const base::FilePath& partition_path,
const FileSystemOptions& options)
: task_runners_(task_runners.Pass()),
quota_manager_proxy_(quota_manager_proxy),
@@ -322,7 +322,7 @@ FileSystemURL FileSystemContext::CrackURL(const GURL& url) const {
FileSystemURL FileSystemContext::CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
- const FilePath& path) const {
+ const base::FilePath& path) const {
return CrackFileSystemURL(FileSystemURL(origin, type, path));
}
diff --git a/webkit/fileapi/file_system_context.h b/webkit/fileapi/file_system_context.h
index c5db158..ec9fc6e 100644
--- a/webkit/fileapi/file_system_context.h
+++ b/webkit/fileapi/file_system_context.h
@@ -19,7 +19,9 @@
#include "webkit/fileapi/task_runner_bound_observer_list.h"
#include "webkit/storage/webkit_storage_export.h"
+namespace base {
class FilePath;
+}
namespace quota {
class QuotaManagerProxy;
@@ -75,7 +77,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
ExternalMountPoints* external_mount_points,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
- const FilePath& partition_path,
+ const base::FilePath& partition_path,
const FileSystemOptions& options);
bool DeleteDataForOriginOnFileThread(const GURL& origin_url);
@@ -186,7 +188,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
LocalFileSyncContext* sync_context() { return sync_context_.get(); }
void set_sync_context(LocalFileSyncContext* sync_context);
- const FilePath& partition_path() const { return partition_path_; }
+ const base::FilePath& partition_path() const { return partition_path_; }
// Same as |CrackFileSystemURL|, but cracks FileSystemURL created from |url|.
FileSystemURL CrackURL(const GURL& url) const;
@@ -194,7 +196,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
// arguments.
FileSystemURL CreateCrackedFileSystemURL(const GURL& origin,
FileSystemType type,
- const FilePath& path) const;
+ const base::FilePath& path) const;
private:
// Friended for GetFileUtil.
@@ -257,7 +259,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
std::vector<MountPoints*> url_crackers_;
// The base path of the storage partition for this context.
- const FilePath partition_path_;
+ const base::FilePath partition_path_;
// For syncable file systems.
scoped_ptr<LocalFileChangeTracker> change_tracker_;
diff --git a/webkit/fileapi/file_system_context_unittest.cc b/webkit/fileapi/file_system_context_unittest.cc
index 5155636..0c13501 100644
--- a/webkit/fileapi/file_system_context_unittest.cc
+++ b/webkit/fileapi/file_system_context_unittest.cc
@@ -28,7 +28,7 @@ namespace fileapi {
namespace {
const char kTestOrigin[] = "http://chromium.org/";
-const FilePath::CharType kVirtualPathNoRoot[] = FPL("root/file");
+const base::FilePath::CharType kVirtualPathNoRoot[] = FPL("root/file");
GURL CreateRawFileSystemURL(const std::string& type_str,
const std::string& fs_id) {
@@ -73,8 +73,8 @@ class FileSystemContextTest : public testing::Test {
const GURL& expect_origin,
FileSystemType expect_mount_type,
FileSystemType expect_type,
- const FilePath& expect_path,
- const FilePath& expect_virtual_path,
+ const base::FilePath& expect_path,
+ const base::FilePath& expect_virtual_path,
const std::string& expect_filesystem_id) {
EXPECT_TRUE(url.is_valid());
@@ -105,13 +105,13 @@ TEST_F(FileSystemContextTest, NullExternalMountPoints) {
std::string isolated_id =
IsolatedContext::GetInstance()->RegisterFileSystemForPath(
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/isolated/root")),
+ base::FilePath(DRIVE FPL("/test/isolated/root")),
&isolated_name);
// Register system external mount point.
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
"system",
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/sys/"))));
+ base::FilePath(DRIVE FPL("/test/sys/"))));
FileSystemURL cracked_isolated = file_system_context->CrackURL(
CreateRawFileSystemURL("isolated", isolated_id));
@@ -121,8 +121,8 @@ TEST_F(FileSystemContextTest, NullExternalMountPoints) {
GURL(kTestOrigin),
kFileSystemTypeIsolated,
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/isolated/root/file")).NormalizePathSeparators(),
- FilePath::FromUTF8Unsafe(isolated_id).Append(FPL("root/file")).
+ base::FilePath(DRIVE FPL("/test/isolated/root/file")).NormalizePathSeparators(),
+ base::FilePath::FromUTF8Unsafe(isolated_id).Append(FPL("root/file")).
NormalizePathSeparators(),
isolated_id);
@@ -134,8 +134,8 @@ TEST_F(FileSystemContextTest, NullExternalMountPoints) {
GURL(kTestOrigin),
kFileSystemTypeExternal,
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/sys/root/file")).NormalizePathSeparators(),
- FilePath(FPL("system/root/file")).NormalizePathSeparators(),
+ base::FilePath(DRIVE FPL("/test/sys/root/file")).NormalizePathSeparators(),
+ base::FilePath(FPL("system/root/file")).NormalizePathSeparators(),
"system");
@@ -152,7 +152,7 @@ TEST_F(FileSystemContextTest, FileSystemContextKeepsMountPointsAlive) {
ASSERT_TRUE(mount_points->RegisterFileSystem(
"system",
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/sys/"))));
+ base::FilePath(DRIVE FPL("/test/sys/"))));
scoped_refptr<FileSystemContext> file_system_context(
CreateFileSystemContextForTest(mount_points.get()));
@@ -170,8 +170,8 @@ TEST_F(FileSystemContextTest, FileSystemContextKeepsMountPointsAlive) {
GURL(kTestOrigin),
kFileSystemTypeExternal,
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/sys/root/file")).NormalizePathSeparators(),
- FilePath(FPL("system/root/file")).NormalizePathSeparators(),
+ base::FilePath(DRIVE FPL("/test/sys/root/file")).NormalizePathSeparators(),
+ base::FilePath(FPL("system/root/file")).NormalizePathSeparators(),
"system");
// No need to revoke the registered filesystem since |mount_points| lifetime
@@ -189,32 +189,32 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
const std::string kIsolatedFileSystemID =
IsolatedContext::GetInstance()->RegisterFileSystemForPath(
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/isolated/root")),
+ base::FilePath(DRIVE FPL("/test/isolated/root")),
&isolated_file_system_name);
// Register system external mount point.
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
"system",
kFileSystemTypeDrive,
- FilePath(DRIVE FPL("/test/sys/"))));
+ base::FilePath(DRIVE FPL("/test/sys/"))));
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
"ext",
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/ext"))));
+ base::FilePath(DRIVE FPL("/test/ext"))));
// Register a system external mount point with the same name/id as the
// registered isolated mount point.
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
kIsolatedFileSystemID,
kFileSystemTypeRestrictedNativeLocal,
- FilePath(DRIVE FPL("/test/system/isolated"))));
+ base::FilePath(DRIVE FPL("/test/system/isolated"))));
// Add a mount points with the same name as a system mount point to
// FileSystemContext's external mount points.
ASSERT_TRUE(external_mount_points->RegisterFileSystem(
"ext",
kFileSystemTypeNativeLocal,
- FilePath(DRIVE FPL("/test/local/ext/"))));
+ base::FilePath(DRIVE FPL("/test/local/ext/"))));
const GURL kTestOrigin = GURL("http://chromium.org/");
- const FilePath kVirtualPathNoRoot = FilePath(FPL("root/file"));
+ const base::FilePath kVirtualPathNoRoot = base::FilePath(FPL("root/file"));
struct TestCase {
// Test case values.
@@ -225,7 +225,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
bool expect_is_valid;
FileSystemType expect_mount_type;
FileSystemType expect_type;
- const FilePath::CharType* expect_path;
+ const base::FilePath::CharType* expect_path;
bool expect_virtual_path_empty;
std::string expect_filesystem_id;
};
@@ -290,8 +290,8 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- const FilePath virtual_path =
- FilePath::FromUTF8Unsafe(kTestCases[i].root).Append(kVirtualPathNoRoot);
+ const base::FilePath virtual_path =
+ base::FilePath::FromUTF8Unsafe(kTestCases[i].root).Append(kVirtualPathNoRoot);
GURL raw_url =
CreateRawFileSystemURL(kTestCases[i].type_str, kTestCases[i].root);
@@ -309,14 +309,14 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
GURL(kTestOrigin),
kTestCases[i].expect_mount_type,
kTestCases[i].expect_type,
- FilePath(kTestCases[i].expect_path).NormalizePathSeparators(),
+ base::FilePath(kTestCases[i].expect_path).NormalizePathSeparators(),
kTestCases[i].expect_virtual_path_empty ?
- FilePath() : virtual_path.NormalizePathSeparators(),
+ base::FilePath() : virtual_path.NormalizePathSeparators(),
kTestCases[i].expect_filesystem_id);
}
IsolatedContext::GetInstance()->RevokeFileSystemByPath(
- FilePath(DRIVE FPL("/test/isolated/root")));
+ base::FilePath(DRIVE FPL("/test/isolated/root")));
ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("system");
ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("ext");
ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(
diff --git a/webkit/fileapi/file_system_database_test_helper.cc b/webkit/fileapi/file_system_database_test_helper.cc
index 838173a..da1a5e1 100644
--- a/webkit/fileapi/file_system_database_test_helper.cc
+++ b/webkit/fileapi/file_system_database_test_helper.cc
@@ -15,15 +15,15 @@
namespace fileapi {
-void CorruptDatabase(const FilePath& db_path,
+void CorruptDatabase(const base::FilePath& db_path,
leveldb::FileType type,
ptrdiff_t offset,
size_t size) {
file_util::FileEnumerator file_enum(db_path, false /* not recursive */,
file_util::FileEnumerator::DIRECTORIES |
file_util::FileEnumerator::FILES);
- FilePath file_path;
- FilePath picked_file_path;
+ base::FilePath file_path;
+ base::FilePath picked_file_path;
uint64 picked_file_number = kuint64max;
while (!(file_path = file_enum.Next()).empty()) {
diff --git a/webkit/fileapi/file_system_database_test_helper.h b/webkit/fileapi/file_system_database_test_helper.h
index 87e35e0..67689c1 100644
--- a/webkit/fileapi/file_system_database_test_helper.h
+++ b/webkit/fileapi/file_system_database_test_helper.h
@@ -9,11 +9,13 @@
#include "third_party/leveldatabase/src/db/filename.h"
+namespace base {
class FilePath;
+}
namespace fileapi {
-void CorruptDatabase(const FilePath& db_path,
+void CorruptDatabase(const base::FilePath& db_path,
leveldb::FileType type,
ptrdiff_t offset,
size_t size);
diff --git a/webkit/fileapi/file_system_dir_url_request_job.cc b/webkit/fileapi/file_system_dir_url_request_job.cc
index e1031df..5943bcd 100644
--- a/webkit/fileapi/file_system_dir_url_request_job.cc
+++ b/webkit/fileapi/file_system_dir_url_request_job.cc
@@ -108,9 +108,9 @@ void FileSystemDirURLRequestJob::DidReadDirectory(
return;
if (data_.empty()) {
- FilePath relative_path = url_.path();
+ base::FilePath relative_path = url_.path();
#if defined(OS_POSIX)
- relative_path = FilePath(FILE_PATH_LITERAL("/") + relative_path.value());
+ relative_path = base::FilePath(FILE_PATH_LITERAL("/") + relative_path.value());
#endif
const string16& title = relative_path.LossyDisplayName();
data_.append(net::GetDirectoryListingHeader(title));
@@ -118,7 +118,7 @@ void FileSystemDirURLRequestJob::DidReadDirectory(
typedef std::vector<base::FileUtilProxy::Entry>::const_iterator EntryIterator;
for (EntryIterator it = entries.begin(); it != entries.end(); ++it) {
- const string16& name = FilePath(it->name).LossyDisplayName();
+ const string16& name = base::FilePath(it->name).LossyDisplayName();
data_.append(net::GetDirectoryListingEntry(
name, std::string(), it->is_directory, it->size,
it->last_modified_time));
diff --git a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
index 0af56c4..b825c61 100644
--- a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
@@ -106,7 +106,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test {
TestRequestHelper(url, false);
}
- FileSystemURL CreateURL(const FilePath& file_path) {
+ FileSystemURL CreateURL(const base::FilePath& file_path) {
return file_system_context_->CreateCrackedFileSystemURL(
GURL("http://remote"),
fileapi::kFileSystemTypeTemporary,
@@ -121,7 +121,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test {
}
void CreateDirectory(const base::StringPiece& dir_name) {
- FilePath path = FilePath().AppendASCII(dir_name);
+ base::FilePath path = base::FilePath().AppendASCII(dir_name);
scoped_ptr<FileSystemOperationContext> context(NewOperationContext());
ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->CreateDirectory(
context.get(),
@@ -131,22 +131,22 @@ class FileSystemDirURLRequestJobTest : public testing::Test {
}
void EnsureFileExists(const base::StringPiece file_name) {
- FilePath path = FilePath().AppendASCII(file_name);
+ base::FilePath path = base::FilePath().AppendASCII(file_name);
scoped_ptr<FileSystemOperationContext> context(NewOperationContext());
ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->EnsureFileExists(
context.get(), CreateURL(path), NULL));
}
void TruncateFile(const base::StringPiece file_name, int64 length) {
- FilePath path = FilePath().AppendASCII(file_name);
+ base::FilePath path = base::FilePath().AppendASCII(file_name);
scoped_ptr<FileSystemOperationContext> context(NewOperationContext());
ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->Truncate(
context.get(), CreateURL(path), length));
}
- base::PlatformFileError GetFileInfo(const FilePath& path,
+ base::PlatformFileError GetFileInfo(const base::FilePath& path,
base::PlatformFileInfo* file_info,
- FilePath* platform_file_path) {
+ base::FilePath* platform_file_path) {
scoped_ptr<FileSystemOperationContext> context(NewOperationContext());
return file_util()->GetFileInfo(context.get(),
CreateURL(path),
diff --git a/webkit/fileapi/file_system_directory_database.cc b/webkit/fileapi/file_system_directory_database.cc
index 6dea063..900ef57 100644
--- a/webkit/fileapi/file_system_directory_database.cc
+++ b/webkit/fileapi/file_system_directory_database.cc
@@ -33,7 +33,7 @@ bool PickleFromFileInfo(
std::string name;
data_path = fileapi::FilePathToString(info.data_path);
- name = fileapi::FilePathToString(FilePath(info.name));
+ name = fileapi::FilePathToString(base::FilePath(info.name));
if (pickle->WriteInt64(info.parent_id) &&
pickle->WriteString(data_path) &&
@@ -66,7 +66,7 @@ bool FileInfoFromPickle(
return false;
}
-const FilePath::CharType kDirectoryDatabaseName[] = FILE_PATH_LITERAL("Paths");
+const base::FilePath::CharType kDirectoryDatabaseName[] = FILE_PATH_LITERAL("Paths");
const char kChildLookupPrefix[] = "CHILD_OF:";
const char kChildLookupSeparator[] = ":";
const char kLastFileIdKey[] = "LAST_FILE_ID";
@@ -84,9 +84,9 @@ enum InitStatus {
std::string GetChildLookupKey(
fileapi::FileSystemDirectoryDatabase::FileId parent_id,
- const FilePath::StringType& child_name) {
+ const base::FilePath::StringType& child_name) {
std::string name;
- name = fileapi::FilePathToString(FilePath(child_name));
+ name = fileapi::FilePathToString(base::FilePath(child_name));
return std::string(kChildLookupPrefix) + base::Int64ToString(parent_id) +
std::string(kChildLookupSeparator) + name;
}
@@ -129,7 +129,7 @@ class DatabaseCheckHelper {
DatabaseCheckHelper(fileapi::FileSystemDirectoryDatabase* dir_db,
leveldb::DB* db,
- const FilePath& path);
+ const base::FilePath& path);
bool IsFileSystemConsistent() {
return IsDatabaseEmpty() ||
@@ -147,9 +147,9 @@ class DatabaseCheckHelper {
fileapi::FileSystemDirectoryDatabase* dir_db_;
leveldb::DB* db_;
- FilePath path_;
+ base::FilePath path_;
- std::set<FilePath> files_in_db_;
+ std::set<base::FilePath> files_in_db_;
size_t num_directories_in_db_;
size_t num_files_in_db_;
@@ -162,7 +162,7 @@ class DatabaseCheckHelper {
DatabaseCheckHelper::DatabaseCheckHelper(
fileapi::FileSystemDirectoryDatabase* dir_db,
leveldb::DB* db,
- const FilePath& path)
+ const base::FilePath& path)
: dir_db_(dir_db), db_(db), path_(path),
num_directories_in_db_(0),
num_files_in_db_(0),
@@ -260,17 +260,17 @@ bool DatabaseCheckHelper::ScanDatabase() {
bool DatabaseCheckHelper::ScanDirectory() {
// TODO(kinuko): Scans all local file system entries to verify each of them
// has a database entry.
- const FilePath kExcludes[] = {
- FilePath(kDirectoryDatabaseName),
- FilePath(fileapi::FileSystemUsageCache::kUsageFileName),
+ const base::FilePath kExcludes[] = {
+ base::FilePath(kDirectoryDatabaseName),
+ base::FilePath(fileapi::FileSystemUsageCache::kUsageFileName),
};
// Any path in |pending_directories| is relative to |path_|.
- std::stack<FilePath> pending_directories;
- pending_directories.push(FilePath());
+ std::stack<base::FilePath> pending_directories;
+ pending_directories.push(base::FilePath());
while (!pending_directories.empty()) {
- FilePath dir_path = pending_directories.top();
+ base::FilePath dir_path = pending_directories.top();
pending_directories.pop();
file_util::FileEnumerator file_enum(
@@ -279,12 +279,12 @@ bool DatabaseCheckHelper::ScanDirectory() {
file_util::FileEnumerator::DIRECTORIES |
file_util::FileEnumerator::FILES);
- FilePath absolute_file_path;
+ base::FilePath absolute_file_path;
while (!(absolute_file_path = file_enum.Next()).empty()) {
file_util::FileEnumerator::FindInfo find_info;
file_enum.GetFindInfo(&find_info);
- FilePath relative_file_path;
+ base::FilePath relative_file_path;
if (!path_.AppendRelativePath(absolute_file_path, &relative_file_path))
return false;
@@ -298,7 +298,7 @@ bool DatabaseCheckHelper::ScanDirectory() {
}
// Check if the file has a database entry.
- std::set<FilePath>::iterator itr = files_in_db_.find(relative_file_path);
+ std::set<base::FilePath>::iterator itr = files_in_db_.find(relative_file_path);
if (itr == files_in_db_.end()) {
if (!file_util::Delete(absolute_file_path, false))
return false;
@@ -373,15 +373,15 @@ bool DatabaseCheckHelper::ScanHierarchy() {
// and does not refer to special system files.
// This is called in GetFileInfo, AddFileInfo and UpdateFileInfo to
// ensure we're only dealing with valid data paths.
-bool VerifyDataPath(const FilePath& data_path) {
+bool VerifyDataPath(const base::FilePath& data_path) {
// |data_path| should not contain any ".." and should be a relative path
// (to the filesystem_data_directory_).
if (data_path.ReferencesParent() || data_path.IsAbsolute())
return false;
// See if it's not pointing to the special system paths.
- const FilePath kExcludes[] = {
- FilePath(kDirectoryDatabaseName),
- FilePath(fileapi::FileSystemUsageCache::kUsageFileName),
+ const base::FilePath kExcludes[] = {
+ base::FilePath(kDirectoryDatabaseName),
+ base::FilePath(fileapi::FileSystemUsageCache::kUsageFileName),
};
for (size_t i = 0; i < arraysize(kExcludes); ++i) {
if (data_path == kExcludes[i] || kExcludes[i].IsParent(data_path))
@@ -401,7 +401,7 @@ FileSystemDirectoryDatabase::FileInfo::~FileInfo() {
}
FileSystemDirectoryDatabase::FileSystemDirectoryDatabase(
- const FilePath& filesystem_data_directory)
+ const base::FilePath& filesystem_data_directory)
: filesystem_data_directory_(filesystem_data_directory) {
}
@@ -409,7 +409,7 @@ FileSystemDirectoryDatabase::~FileSystemDirectoryDatabase() {
}
bool FileSystemDirectoryDatabase::GetChildWithName(
- FileId parent_id, const FilePath::StringType& name, FileId* child_id) {
+ FileId parent_id, const base::FilePath::StringType& name, FileId* child_id) {
if (!Init(REPAIR_ON_CORRUPTION))
return false;
DCHECK(child_id);
@@ -431,13 +431,13 @@ bool FileSystemDirectoryDatabase::GetChildWithName(
}
bool FileSystemDirectoryDatabase::GetFileWithPath(
- const FilePath& path, FileId* file_id) {
- std::vector<FilePath::StringType> components;
+ const base::FilePath& path, FileId* file_id) {
+ std::vector<base::FilePath::StringType> components;
VirtualPath::GetComponents(path, &components);
FileId local_id = 0;
- std::vector<FilePath::StringType>::iterator iter;
+ std::vector<base::FilePath::StringType>::iterator iter;
for (iter = components.begin(); iter != components.end(); ++iter) {
- FilePath::StringType name;
+ base::FilePath::StringType name;
name = *iter;
if (name == FILE_PATH_LITERAL("/"))
continue;
@@ -497,8 +497,8 @@ bool FileSystemDirectoryDatabase::GetFileInfo(FileId file_id, FileInfo* info) {
// Without this, a query for the root's file info, made before creating the
// first file in the database, will fail and confuse callers.
if (status.IsNotFound() && !file_id) {
- info->name = FilePath::StringType();
- info->data_path = FilePath();
+ info->name = base::FilePath::StringType();
+ info->data_path = base::FilePath();
info->modification_time = base::Time::Now();
info->parent_id = 0;
return true;
@@ -686,7 +686,7 @@ bool FileSystemDirectoryDatabase::GetNextInteger(int64* next) {
}
// static
-bool FileSystemDirectoryDatabase::DestroyDatabase(const FilePath& path) {
+bool FileSystemDirectoryDatabase::DestroyDatabase(const base::FilePath& path) {
std::string name = FilePathToString(path.Append(kDirectoryDatabaseName));
leveldb::Status status = leveldb::DestroyDB(name, leveldb::Options());
if (status.ok())
diff --git a/webkit/fileapi/file_system_directory_database.h b/webkit/fileapi/file_system_directory_database.h
index c411f49..5ab9ec1 100644
--- a/webkit/fileapi/file_system_directory_database.h
+++ b/webkit/fileapi/file_system_directory_database.h
@@ -47,8 +47,8 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemDirectoryDatabase {
}
FileId parent_id;
- FilePath data_path;
- FilePath::StringType name;
+ base::FilePath data_path;
+ base::FilePath::StringType name;
// This modification time is valid only for directories, not files, as
// FileWriter will get the files out of sync.
// For files, look at the modification time of the underlying data_path.
@@ -56,12 +56,12 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemDirectoryDatabase {
};
explicit FileSystemDirectoryDatabase(
- const FilePath& filesystem_data_directory);
+ const base::FilePath& filesystem_data_directory);
~FileSystemDirectoryDatabase();
bool GetChildWithName(
- FileId parent_id, const FilePath::StringType& name, FileId* child_id);
- bool GetFileWithPath(const FilePath& path, FileId* file_id);
+ FileId parent_id, const base::FilePath::StringType& name, FileId* child_id);
+ bool GetFileWithPath(const base::FilePath& path, FileId* file_id);
// ListChildren will succeed, returning 0 children, if parent_id doesn't
// exist.
bool ListChildren(FileId parent_id, std::vector<FileId>* children);
@@ -88,7 +88,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemDirectoryDatabase {
// Returns true if the database looks consistent with local filesystem.
bool IsFileSystemConsistent();
- static bool DestroyDatabase(const FilePath& path);
+ static bool DestroyDatabase(const base::FilePath& path);
private:
enum RecoveryOption {
@@ -111,7 +111,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemDirectoryDatabase {
void HandleError(const tracked_objects::Location& from_here,
const leveldb::Status& status);
- const FilePath filesystem_data_directory_;
+ const base::FilePath filesystem_data_directory_;
scoped_ptr<leveldb::DB> db_;
base::Time last_reported_time_;
DISALLOW_COPY_AND_ASSIGN(FileSystemDirectoryDatabase);
diff --git a/webkit/fileapi/file_system_directory_database_unittest.cc b/webkit/fileapi/file_system_directory_database_unittest.cc
index d5c31ae..3f15e7e 100644
--- a/webkit/fileapi/file_system_directory_database_unittest.cc
+++ b/webkit/fileapi/file_system_directory_database_unittest.cc
@@ -23,7 +23,7 @@
namespace fileapi {
namespace {
-const FilePath::CharType kDirectoryDatabaseName[] = FPL("Paths");
+const base::FilePath::CharType kDirectoryDatabaseName[] = FPL("Paths");
}
class FileSystemDirectoryDatabaseTest : public testing::Test {
@@ -51,7 +51,7 @@ class FileSystemDirectoryDatabaseTest : public testing::Test {
db_.reset();
}
- bool AddFileInfo(FileId parent_id, const FilePath::StringType& name) {
+ bool AddFileInfo(FileId parent_id, const base::FilePath::StringType& name) {
FileId file_id;
FileInfo info;
info.parent_id = parent_id;
@@ -60,7 +60,7 @@ class FileSystemDirectoryDatabaseTest : public testing::Test {
}
void CreateDirectory(FileId parent_id,
- const FilePath::StringType& name,
+ const base::FilePath::StringType& name,
FileId* file_id_out) {
FileInfo info;
info.parent_id = parent_id;
@@ -69,18 +69,18 @@ class FileSystemDirectoryDatabaseTest : public testing::Test {
}
void CreateFile(FileId parent_id,
- const FilePath::StringType& name,
- const FilePath::StringType& data_path,
+ const base::FilePath::StringType& name,
+ const base::FilePath::StringType& data_path,
FileId* file_id_out) {
FileId file_id;
FileInfo info;
info.parent_id = parent_id;
info.name = name;
- info.data_path = FilePath(data_path).NormalizePathSeparators();
+ info.data_path = base::FilePath(data_path).NormalizePathSeparators();
ASSERT_TRUE(db_->AddFileInfo(info, &file_id));
- FilePath local_path = path().Append(data_path);
+ base::FilePath local_path = path().Append(data_path);
if (!file_util::DirectoryExists(local_path.DirName()))
ASSERT_TRUE(file_util::CreateDirectory(local_path.DirName()));
@@ -110,18 +110,18 @@ class FileSystemDirectoryDatabaseTest : public testing::Test {
FilePathToString(path().Append(kDirectoryDatabaseName)));
}
- const FilePath& path() {
+ const base::FilePath& path() {
return base_.path();
}
// Makes link from |parent_id| to |child_id| with |name|.
void MakeHierarchyLink(FileId parent_id,
FileId child_id,
- const FilePath::StringType& name) {
+ const base::FilePath::StringType& name) {
ASSERT_TRUE(db()->db_->Put(
leveldb::WriteOptions(),
"CHILD_OF:" + base::Int64ToString(parent_id) + ":" +
- FilePathToString(FilePath(name)),
+ FilePathToString(base::FilePath(name)),
base::Int64ToString(child_id)).ok());
}
@@ -132,7 +132,7 @@ class FileSystemDirectoryDatabaseTest : public testing::Test {
ASSERT_TRUE(db()->db_->Delete(
leveldb::WriteOptions(),
"CHILD_OF:" + base::Int64ToString(file_info.parent_id) + ":" +
- FilePathToString(FilePath(file_info.name))).ok());
+ FilePathToString(base::FilePath(file_info.name))).ok());
}
protected:
@@ -171,7 +171,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestAddNameClash) {
EXPECT_TRUE(db()->AddFileInfo(info, &file_id));
// Check for name clash in the root directory.
- FilePath::StringType name = info.name;
+ base::FilePath::StringType name = info.name;
EXPECT_FALSE(AddFileInfo(0, name));
name = FILE_PATH_LITERAL("dir 1");
EXPECT_TRUE(AddFileInfo(0, name));
@@ -188,9 +188,9 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestAddNameClash) {
TEST_F(FileSystemDirectoryDatabaseTest, TestRenameNoMoveNameClash) {
FileInfo info;
FileId file_id0;
- FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
- FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
- FilePath::StringType name2 = FILE_PATH_LITERAL("bas");
+ base::FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
+ base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
+ base::FilePath::StringType name2 = FILE_PATH_LITERAL("bas");
info.parent_id = 0;
info.name = name0;
EXPECT_TRUE(db()->AddFileInfo(info, &file_id0));
@@ -205,8 +205,8 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestMoveSameNameNameClash) {
FileInfo info;
FileId file_id0;
FileId file_id1;
- FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
- FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
+ base::FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
+ base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
info.parent_id = 0;
info.name = name0;
EXPECT_TRUE(db()->AddFileInfo(info, &file_id0));
@@ -222,9 +222,9 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestMoveRenameNameClash) {
FileInfo info;
FileId file_id0;
FileId file_id1;
- FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
- FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
- FilePath::StringType name2 = FILE_PATH_LITERAL("bas");
+ base::FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
+ base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
+ base::FilePath::StringType name2 = FILE_PATH_LITERAL("bas");
info.parent_id = 0;
info.name = name0;
EXPECT_TRUE(db()->AddFileInfo(info, &file_id0));
@@ -260,8 +260,8 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestGetChildWithName) {
FileInfo info;
FileId file_id0;
FileId file_id1;
- FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
- FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
+ base::FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
+ base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
info.parent_id = 0;
info.name = name0;
EXPECT_TRUE(db()->AddFileInfo(info, &file_id0));
@@ -284,9 +284,9 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestGetFileWithPath) {
FileId file_id0;
FileId file_id1;
FileId file_id2;
- FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
- FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
- FilePath::StringType name2 = FILE_PATH_LITERAL("dog");
+ base::FilePath::StringType name0 = FILE_PATH_LITERAL("foo");
+ base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar");
+ base::FilePath::StringType name2 = FILE_PATH_LITERAL("dog");
info.parent_id = 0;
info.name = name0;
@@ -302,7 +302,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestGetFileWithPath) {
EXPECT_NE(file_id1, file_id2);
FileId check_file_id;
- FilePath path = FilePath(name0);
+ base::FilePath path = base::FilePath(name0);
EXPECT_TRUE(db()->GetFileWithPath(path, &check_file_id));
EXPECT_EQ(file_id0, check_file_id);
@@ -376,7 +376,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestUpdateModificationTime) {
FileId file_id;
info0.parent_id = 0;
info0.name = FILE_PATH_LITERAL("name");
- info0.data_path = FilePath(FILE_PATH_LITERAL("fake path"));
+ info0.data_path = base::FilePath(FILE_PATH_LITERAL("fake path"));
info0.modification_time = base::Time::Now();
EXPECT_TRUE(db()->AddFileInfo(info0, &file_id));
FileInfo info1;
@@ -406,7 +406,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestSimpleFileOperations) {
FileInfo info0;
EXPECT_FALSE(db()->GetFileInfo(file_id, &info0));
info0.parent_id = 0;
- info0.data_path = FilePath(FILE_PATH_LITERAL("foo"));
+ info0.data_path = base::FilePath(FILE_PATH_LITERAL("foo"));
info0.name = FILE_PATH_LITERAL("file name");
info0.modification_time = base::Time::Now();
EXPECT_TRUE(db()->AddFileInfo(info0, &file_id));
@@ -431,7 +431,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestOverwritingMoveFileSrcDirectory) {
FileId file_id;
FileInfo info1;
info1.parent_id = 0;
- info1.data_path = FilePath(FILE_PATH_LITERAL("bar"));
+ info1.data_path = base::FilePath(FILE_PATH_LITERAL("bar"));
info1.name = FILE_PATH_LITERAL("file");
info1.modification_time = base::Time::UnixEpoch();
EXPECT_TRUE(db()->AddFileInfo(info1, &file_id));
@@ -444,7 +444,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestOverwritingMoveFileDestDirectory) {
FileInfo info0;
info0.parent_id = 0;
info0.name = FILE_PATH_LITERAL("file");
- info0.data_path = FilePath(FILE_PATH_LITERAL("bar"));
+ info0.data_path = base::FilePath(FILE_PATH_LITERAL("bar"));
info0.modification_time = base::Time::Now();
EXPECT_TRUE(db()->AddFileInfo(info0, &file_id));
@@ -462,7 +462,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestOverwritingMoveFileSuccess) {
FileId file_id0;
FileInfo info0;
info0.parent_id = 0;
- info0.data_path = FilePath(FILE_PATH_LITERAL("foo"));
+ info0.data_path = base::FilePath(FILE_PATH_LITERAL("foo"));
info0.name = FILE_PATH_LITERAL("file name 0");
info0.modification_time = base::Time::Now();
EXPECT_TRUE(db()->AddFileInfo(info0, &file_id0));
@@ -476,7 +476,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestOverwritingMoveFileSuccess) {
FileId file_id1;
FileInfo info1;
info1.parent_id = dir_id;
- info1.data_path = FilePath(FILE_PATH_LITERAL("bar"));
+ info1.data_path = base::FilePath(FILE_PATH_LITERAL("bar"));
info1.name = FILE_PATH_LITERAL("file name 1");
info1.modification_time = base::Time::UnixEpoch();
EXPECT_TRUE(db()->AddFileInfo(info1, &file_id1));
@@ -486,9 +486,9 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestOverwritingMoveFileSuccess) {
FileInfo check_info;
FileId check_id;
- EXPECT_FALSE(db()->GetFileWithPath(FilePath(info0.name), &check_id));
+ EXPECT_FALSE(db()->GetFileWithPath(base::FilePath(info0.name), &check_id));
EXPECT_TRUE(db()->GetFileWithPath(
- FilePath(dir_info.name).Append(info1.name), &check_id));
+ base::FilePath(dir_info.name).Append(info1.name), &check_id));
EXPECT_TRUE(db()->GetFileInfo(check_id, &check_info));
EXPECT_EQ(info0.data_path, check_info.data_path);
@@ -531,7 +531,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_Consistent) {
TEST_F(FileSystemDirectoryDatabaseTest,
TestConsistencyCheck_BackingMultiEntry) {
- const FilePath::CharType kBackingFileName[] = FPL("the celeb");
+ const base::FilePath::CharType kBackingFileName[] = FPL("the celeb");
CreateFile(0, FPL("foo"), kBackingFileName, NULL);
EXPECT_TRUE(db()->IsFileSystemConsistent());
@@ -541,7 +541,7 @@ TEST_F(FileSystemDirectoryDatabaseTest,
}
TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_FileLost) {
- const FilePath::CharType kBackingFileName[] = FPL("hoge");
+ const base::FilePath::CharType kBackingFileName[] = FPL("hoge");
CreateFile(0, FPL("foo"), kBackingFileName, NULL);
EXPECT_TRUE(db()->IsFileSystemConsistent());
@@ -576,7 +576,7 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_RootLoop) {
TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_DirectoryLoop) {
FileId dir1_id;
FileId dir2_id;
- FilePath::StringType dir1_name = FPL("foo");
+ base::FilePath::StringType dir1_name = FPL("foo");
CreateDirectory(0, dir1_name, &dir1_id);
CreateDirectory(dir1_id, FPL("bar"), &dir2_id);
@@ -610,13 +610,13 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestConsistencyCheck_WreckedEntries) {
}
TEST_F(FileSystemDirectoryDatabaseTest, TestRepairDatabase_Success) {
- FilePath::StringType kFileName = FPL("bar");
+ base::FilePath::StringType kFileName = FPL("bar");
FileId file_id_prev;
CreateFile(0, FPL("foo"), FPL("hoge"), NULL);
CreateFile(0, kFileName, FPL("fuga"), &file_id_prev);
- const FilePath kDatabaseDirectory = path().Append(kDirectoryDatabaseName);
+ const base::FilePath kDatabaseDirectory = path().Append(kDirectoryDatabaseName);
CloseDatabase();
CorruptDatabase(kDatabaseDirectory, leveldb::kDescriptorFile,
0, std::numeric_limits<size_t>::max());
@@ -631,12 +631,12 @@ TEST_F(FileSystemDirectoryDatabaseTest, TestRepairDatabase_Success) {
}
TEST_F(FileSystemDirectoryDatabaseTest, TestRepairDatabase_Failure) {
- FilePath::StringType kFileName = FPL("bar");
+ base::FilePath::StringType kFileName = FPL("bar");
CreateFile(0, FPL("foo"), FPL("hoge"), NULL);
CreateFile(0, kFileName, FPL("fuga"), NULL);
- const FilePath kDatabaseDirectory = path().Append(kDirectoryDatabaseName);
+ const base::FilePath kDatabaseDirectory = path().Append(kDirectoryDatabaseName);
CloseDatabase();
CorruptDatabase(kDatabaseDirectory, leveldb::kDescriptorFile,
0, std::numeric_limits<size_t>::max());
diff --git a/webkit/fileapi/file_system_file_stream_reader.cc b/webkit/fileapi/file_system_file_stream_reader.cc
index cb5f5dd..e5e0299 100644
--- a/webkit/fileapi/file_system_file_stream_reader.cc
+++ b/webkit/fileapi/file_system_file_stream_reader.cc
@@ -107,7 +107,7 @@ void FileSystemFileStreamReader::DidCreateSnapshot(
const net::CompletionCallback& error_callback,
base::PlatformFileError file_error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
DCHECK(has_pending_create_snapshot_);
DCHECK(!local_file_reader_.get());
diff --git a/webkit/fileapi/file_system_file_stream_reader.h b/webkit/fileapi/file_system_file_stream_reader.h
index 5115f72..0a6e750 100644
--- a/webkit/fileapi/file_system_file_stream_reader.h
+++ b/webkit/fileapi/file_system_file_stream_reader.h
@@ -14,9 +14,8 @@
#include "webkit/fileapi/file_system_url.h"
#include "webkit/storage/webkit_storage_export.h"
-class FilePath;
-
namespace base {
+class FilePath;
class SequencedTaskRunner;
}
@@ -60,7 +59,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemFileStreamReader
const net::CompletionCallback& error_callback,
base::PlatformFileError file_error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
scoped_refptr<FileSystemContext> file_system_context_;
diff --git a/webkit/fileapi/file_system_file_stream_reader_unittest.cc b/webkit/fileapi/file_system_file_stream_reader_unittest.cc
index 55d0b9fd..327cb64 100644
--- a/webkit/fileapi/file_system_file_stream_reader_unittest.cc
+++ b/webkit/fileapi/file_system_file_stream_reader_unittest.cc
@@ -133,7 +133,7 @@ class FileSystemFileStreamReaderTest : public testing::Test {
base::ClosePlatformFile(handle);
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util->GetFileInfo(&context, url, &file_info,
&platform_path));
@@ -150,7 +150,7 @@ class FileSystemFileStreamReaderTest : public testing::Test {
return file_system_context_->CreateCrackedFileSystemURL(
GURL(kURLOrigin),
kFileSystemTypeTemporary,
- FilePath().AppendASCII(file_name));
+ base::FilePath().AppendASCII(file_name));
}
MessageLoop message_loop_;
diff --git a/webkit/fileapi/file_system_file_util.cc b/webkit/fileapi/file_system_file_util.cc
index 46b8b02..9d786ef 100644
--- a/webkit/fileapi/file_system_file_util.cc
+++ b/webkit/fileapi/file_system_file_util.cc
@@ -6,8 +6,8 @@
namespace fileapi {
-FilePath FileSystemFileUtil::EmptyFileEnumerator::Next() {
- return FilePath();
+base::FilePath FileSystemFileUtil::EmptyFileEnumerator::Next() {
+ return base::FilePath();
}
int64 FileSystemFileUtil::EmptyFileEnumerator::Size() {
diff --git a/webkit/fileapi/file_system_file_util.h b/webkit/fileapi/file_system_file_util.h
index 5d4b72c..e4e94be 100644
--- a/webkit/fileapi/file_system_file_util.h
+++ b/webkit/fileapi/file_system_file_util.h
@@ -33,7 +33,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemFileUtil {
virtual ~AbstractFileEnumerator() {}
// Returns an empty string if there are no more results.
- virtual FilePath Next() = 0;
+ virtual base::FilePath Next() = 0;
// These methods return metadata for the file most recently returned by
// Next(). If Next() has never been called, or if Next() most recently
@@ -46,7 +46,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemFileUtil {
class WEBKIT_STORAGE_EXPORT EmptyFileEnumerator
: public AbstractFileEnumerator {
- virtual FilePath Next() OVERRIDE;
+ virtual base::FilePath Next() OVERRIDE;
virtual int64 Size() OVERRIDE;
virtual base::Time LastModifiedTime() OVERRIDE;
virtual bool IsDirectory() OVERRIDE;
@@ -91,7 +91,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemFileUtil {
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path) = 0;
+ base::FilePath* platform_path) = 0;
// Returns a pointer to a new instance of AbstractFileEnumerator which is
// implemented for each FileSystemFileUtil subclass. The instance needs to be
@@ -114,7 +114,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemFileUtil {
virtual base::PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path) = 0;
+ base::FilePath* local_file_path) = 0;
// Updates the file metadata information.
// See header comments for AsyncFileUtil::Touch() for more details.
@@ -154,7 +154,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemFileUtil {
// more details.
virtual base::PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) = 0;
// Deletes a single file.
@@ -178,7 +178,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemFileUtil {
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
SnapshotFilePolicy* policy) = 0;
protected:
diff --git a/webkit/fileapi/file_system_file_util_proxy.cc b/webkit/fileapi/file_system_file_util_proxy.cc
index 35c08bf..8ab1c4f 100644
--- a/webkit/fileapi/file_system_file_util_proxy.cc
+++ b/webkit/fileapi/file_system_file_util_proxy.cc
@@ -79,7 +79,7 @@ class GetFileInfoHelper {
private:
base::PlatformFileError error_;
base::PlatformFileInfo file_info_;
- FilePath platform_path_;
+ base::FilePath platform_path_;
FileSystemFileUtil::SnapshotFilePolicy snapshot_policy_;
DISALLOW_COPY_AND_ASSIGN(GetFileInfoHelper);
};
@@ -181,7 +181,7 @@ bool FileSystemFileUtilProxy::MoveFileLocal(
bool FileSystemFileUtilProxy::CopyInForeignFile(
FileSystemOperationContext* context,
FileSystemFileUtil* file_util,
- const FilePath& src_local_disk_file_path,
+ const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
return base::PostTaskAndReplyWithResult(
diff --git a/webkit/fileapi/file_system_file_util_proxy.h b/webkit/fileapi/file_system_file_util_proxy.h
index 3c43e30..c20b8b5 100644
--- a/webkit/fileapi/file_system_file_util_proxy.h
+++ b/webkit/fileapi/file_system_file_util_proxy.h
@@ -37,7 +37,7 @@ class FileSystemFileUtilProxy {
typedef base::Callback<
void(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
FileSystemFileUtil::SnapshotFilePolicy snapshot_policy)>
SnapshotFileCallback;
@@ -85,7 +85,7 @@ class FileSystemFileUtilProxy {
static bool CopyInForeignFile(
FileSystemOperationContext* context,
FileSystemFileUtil* file_util,
- const FilePath& src_local_disk_file_path,
+ const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback);
diff --git a/webkit/fileapi/file_system_file_util_unittest.cc b/webkit/fileapi/file_system_file_util_unittest.cc
index b33b32a..9e12299 100644
--- a/webkit/fileapi/file_system_file_util_unittest.cc
+++ b/webkit/fileapi/file_system_file_util_unittest.cc
@@ -116,7 +116,7 @@ class FileSystemFileUtilTest : public testing::Test {
dest_root.path().Append(test_case.path));
base::PlatformFileInfo dest_file_info;
- FilePath data_path;
+ base::FilePath data_path;
context.reset(NewContext(&dest_helper));
EXPECT_EQ(base::PLATFORM_FILE_OK,
file_util->GetFileInfo(
@@ -140,7 +140,7 @@ class FileSystemFileUtilTest : public testing::Test {
FileSystemURL url = src_root.WithPath(
src_root.path().Append(test_case.path));
base::PlatformFileInfo src_file_info;
- FilePath data_path;
+ base::FilePath data_path;
context.reset(NewContext(&src_helper));
base::PlatformFileError expected_result;
if (copy)
diff --git a/webkit/fileapi/file_system_mount_point_provider.h b/webkit/fileapi/file_system_mount_point_provider.h
index 585b3cd..2e19372 100644
--- a/webkit/fileapi/file_system_mount_point_provider.h
+++ b/webkit/fileapi/file_system_mount_point_provider.h
@@ -56,7 +56,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemMountPointProvider {
// file system url on the file thread.
// If |create| is true this may also create the root directory for
// the filesystem if it doesn't exist.
- virtual FilePath GetFileSystemRootPathOnFileThread(
+ virtual base::FilePath GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) = 0;
@@ -65,7 +65,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemMountPointProvider {
// Checks if a given |name| contains any restricted names/chars in it.
// Callable on any thread.
- virtual bool IsRestrictedFileName(const FilePath& filename) const = 0;
+ virtual bool IsRestrictedFileName(const base::FilePath& filename) const = 0;
// Returns the specialized FileSystemFileUtil for this mount point.
// It is ok to return NULL if the filesystem doesn't support synchronous
@@ -135,21 +135,21 @@ class ExternalFileSystemMountPointProvider
// Returns the list of top level directories that are exposed by this
// provider. This list is used to set appropriate child process file access
// permissions.
- virtual std::vector<FilePath> GetRootDirectories() const = 0;
+ virtual std::vector<base::FilePath> GetRootDirectories() const = 0;
// Grants access to all external file system from extension identified with
// |extension_id|.
virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0;
// Grants access to |virtual_path| from |origin_url|.
virtual void GrantFileAccessToExtension(
const std::string& extension_id,
- const FilePath& virtual_path) = 0;
+ const base::FilePath& virtual_path) = 0;
// Revokes file access from extension identified with |extension_id|.
virtual void RevokeAccessForExtension(
const std::string& extension_id) = 0;
// Gets virtual path by known filesystem path. Returns false when filesystem
// path is not exposed by this provider.
- virtual bool GetVirtualPath(const FilePath& file_system_path,
- FilePath* virtual_path) = 0;
+ virtual bool GetVirtualPath(const base::FilePath& file_system_path,
+ base::FilePath* virtual_path) = 0;
};
} // namespace fileapi
diff --git a/webkit/fileapi/file_system_mount_point_provider_unittest.cc b/webkit/fileapi/file_system_mount_point_provider_unittest.cc
index c36aa9b..e3abb47 100644
--- a/webkit/fileapi/file_system_mount_point_provider_unittest.cc
+++ b/webkit/fileapi/file_system_mount_point_provider_unittest.cc
@@ -88,7 +88,7 @@ const struct RootPathFileURITest {
};
const struct CheckValidPathTest {
- FilePath::StringType path;
+ base::FilePath::StringType path;
bool expected_valid;
} kCheckValidPathTestCases[] = {
{ FILE_PATH_LITERAL("//tmp/foo.txt"), false, },
@@ -102,7 +102,7 @@ const struct CheckValidPathTest {
};
const struct IsRestrictedNameTest {
- FilePath::StringType name;
+ base::FilePath::StringType name;
bool expected_dangerous;
} kIsRestrictedNameTestCases[] = {
// Names that contain strings that used to be restricted, but are now allowed.
@@ -193,9 +193,9 @@ const struct IsRestrictedNameTest {
};
// For External filesystem.
-const FilePath::CharType kMountPoint[] = FILE_PATH_LITERAL("/tmp/testing");
-const FilePath::CharType kRootPath[] = FILE_PATH_LITERAL("/tmp");
-const FilePath::CharType kVirtualPath[] = FILE_PATH_LITERAL("testing");
+const base::FilePath::CharType kMountPoint[] = FILE_PATH_LITERAL("/tmp/testing");
+const base::FilePath::CharType kRootPath[] = FILE_PATH_LITERAL("/tmp");
+const base::FilePath::CharType kVirtualPath[] = FILE_PATH_LITERAL("testing");
} // namespace
@@ -222,7 +222,7 @@ class FileSystemMountPointProviderTest : public testing::Test {
data_dir_.path(),
options);
#if defined(OS_CHROMEOS)
- FilePath mount_point_path = FilePath(kMountPoint);
+ base::FilePath mount_point_path = base::FilePath(kMountPoint);
external_mount_points->RegisterFileSystem(
mount_point_path.BaseName().AsUTF8Unsafe(),
kFileSystemTypeNativeLocal,
@@ -238,21 +238,21 @@ class FileSystemMountPointProviderTest : public testing::Test {
bool GetRootPath(const GURL& origin_url,
fileapi::FileSystemType type,
bool create,
- FilePath* root_path) {
- FilePath virtual_path = FilePath();
+ base::FilePath* root_path) {
+ base::FilePath virtual_path = base::FilePath();
if (type == kFileSystemTypeExternal)
- virtual_path = FilePath(kVirtualPath);
+ virtual_path = base::FilePath(kVirtualPath);
FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL(
origin_url, type, virtual_path);
- FilePath returned_root_path =
+ base::FilePath returned_root_path =
provider(type)->GetFileSystemRootPathOnFileThread(url, create);
if (root_path)
*root_path = returned_root_path;
return !returned_root_path.empty();
}
- FilePath data_path() const { return data_dir_.path(); }
- FilePath file_system_path() const {
+ base::FilePath data_path() const { return data_dir_.path(); }
+ base::FilePath file_system_path() const {
return data_dir_.path().Append(
SandboxMountPointProvider::kFileSystemDirectory);
}
@@ -272,7 +272,7 @@ class FileSystemMountPointProviderTest : public testing::Test {
};
TEST_F(FileSystemMountPointProviderTest, GetRootPathCreateAndExamine) {
- std::vector<FilePath> returned_root_path(
+ std::vector<base::FilePath> returned_root_path(
ARRAYSIZE_UNSAFE(kRootPathTestCases));
SetupNewContext(CreateAllowFileAccessOptions());
@@ -281,13 +281,13 @@ TEST_F(FileSystemMountPointProviderTest, GetRootPathCreateAndExamine) {
SCOPED_TRACE(testing::Message() << "RootPath (create) #" << i << " "
<< kRootPathTestCases[i].expected_path);
- FilePath root_path;
+ base::FilePath root_path;
EXPECT_TRUE(GetRootPath(GURL(kRootPathTestCases[i].origin_url),
kRootPathTestCases[i].type,
true /* create */, &root_path));
if (kRootPathTestCases[i].type != kFileSystemTypeExternal) {
- FilePath expected = file_system_path().AppendASCII(
+ base::FilePath expected = file_system_path().AppendASCII(
kRootPathTestCases[i].expected_path);
EXPECT_EQ(expected.value(), root_path.value());
EXPECT_TRUE(file_util::DirectoryExists(root_path));
@@ -306,7 +306,7 @@ TEST_F(FileSystemMountPointProviderTest, GetRootPathCreateAndExamine) {
SCOPED_TRACE(testing::Message() << "RootPath (get) #" << i << " "
<< kRootPathTestCases[i].expected_path);
- FilePath root_path;
+ base::FilePath root_path;
EXPECT_TRUE(GetRootPath(GURL(kRootPathTestCases[i].origin_url),
kRootPathTestCases[i].type,
false /* create */, &root_path));
@@ -317,18 +317,18 @@ TEST_F(FileSystemMountPointProviderTest, GetRootPathCreateAndExamine) {
TEST_F(FileSystemMountPointProviderTest,
GetRootPathCreateAndExamineWithNewProvider) {
- std::vector<FilePath> returned_root_path(
+ std::vector<base::FilePath> returned_root_path(
ARRAYSIZE_UNSAFE(kRootPathTestCases));
SetupNewContext(CreateAllowFileAccessOptions());
GURL origin_url("http://foo.com:1/");
- FilePath root_path1;
+ base::FilePath root_path1;
EXPECT_TRUE(GetRootPath(origin_url,
kFileSystemTypeTemporary, true, &root_path1));
SetupNewContext(CreateDisallowFileAccessOptions());
- FilePath root_path2;
+ base::FilePath root_path2;
EXPECT_TRUE(GetRootPath(origin_url,
kFileSystemTypeTemporary, false, &root_path2));
@@ -383,11 +383,11 @@ TEST_F(FileSystemMountPointProviderTest, GetRootPathFileURIWithAllowFlag) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathFileURITestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPathFileURI (allow) #"
<< i << " " << kRootPathFileURITestCases[i].expected_path);
- FilePath root_path;
+ base::FilePath root_path;
EXPECT_TRUE(GetRootPath(GURL(kRootPathFileURITestCases[i].origin_url),
kRootPathFileURITestCases[i].type,
true /* create */, &root_path));
- FilePath expected = file_system_path().AppendASCII(
+ base::FilePath expected = file_system_path().AppendASCII(
kRootPathFileURITestCases[i].expected_path);
EXPECT_EQ(expected.value(), root_path.value());
EXPECT_TRUE(file_util::DirectoryExists(root_path));
@@ -399,7 +399,7 @@ TEST_F(FileSystemMountPointProviderTest, IsRestrictedName) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " "
<< kIsRestrictedNameTestCases[i].name);
- FilePath name(kIsRestrictedNameTestCases[i].name);
+ base::FilePath name(kIsRestrictedNameTestCases[i].name);
EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous,
provider(kFileSystemTypeTemporary)->IsRestrictedFileName(name));
}
diff --git a/webkit/fileapi/file_system_operation.h b/webkit/fileapi/file_system_operation.h
index 5b23194..21bdf40 100644
--- a/webkit/fileapi/file_system_operation.h
+++ b/webkit/fileapi/file_system_operation.h
@@ -64,7 +64,7 @@ class FileSystemOperation {
typedef base::Callback<
void(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path)> GetMetadataCallback;
+ const base::FilePath& platform_path)> GetMetadataCallback;
// Used for OpenFile(). |result| is the return code of the operation.
typedef base::Callback<
@@ -107,7 +107,7 @@ class FileSystemOperation {
typedef base::Callback<
void(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)>
SnapshotFileCallback;
diff --git a/webkit/fileapi/file_system_origin_database.cc b/webkit/fileapi/file_system_origin_database.cc
index 0c9207a..0300da2 100644
--- a/webkit/fileapi/file_system_origin_database.cc
+++ b/webkit/fileapi/file_system_origin_database.cc
@@ -20,7 +20,8 @@
namespace {
-const FilePath::CharType kOriginDatabaseName[] = FILE_PATH_LITERAL("Origins");
+const base::FilePath::CharType kOriginDatabaseName[] =
+ FILE_PATH_LITERAL("Origins");
const char kOriginKeyPrefix[] = "ORIGIN:";
const char kLastPathKey[] = "LAST_PATH";
const int64 kMinimumReportIntervalHours = 1;
@@ -51,7 +52,7 @@ FileSystemOriginDatabase::OriginRecord::OriginRecord() {
}
FileSystemOriginDatabase::OriginRecord::OriginRecord(
- const std::string& origin_in, const FilePath& path_in)
+ const std::string& origin_in, const base::FilePath& path_in)
: origin(origin_in), path(path_in) {
}
@@ -59,7 +60,7 @@ FileSystemOriginDatabase::OriginRecord::~OriginRecord() {
}
FileSystemOriginDatabase::FileSystemOriginDatabase(
- const FilePath& file_system_directory)
+ const base::FilePath& file_system_directory)
: file_system_directory_(file_system_directory) {
}
@@ -116,15 +117,15 @@ bool FileSystemOriginDatabase::RepairDatabase(const std::string& db_path) {
}
// See if the repaired entries match with what we have on disk.
- std::set<FilePath> directories;
+ std::set<base::FilePath> directories;
file_util::FileEnumerator file_enum(file_system_directory_,
false /* recursive */,
file_util::FileEnumerator::DIRECTORIES);
- FilePath path_each;
+ base::FilePath path_each;
while (!(path_each = file_enum.Next()).empty())
directories.insert(path_each.BaseName());
- std::set<FilePath>::iterator db_dir_itr =
- directories.find(FilePath(kOriginDatabaseName));
+ std::set<base::FilePath>::iterator db_dir_itr =
+ directories.find(base::FilePath(kOriginDatabaseName));
// Make sure we have the database file in its directory and therefore we are
// working on the correct path.
DCHECK(db_dir_itr != directories.end());
@@ -140,7 +141,7 @@ bool FileSystemOriginDatabase::RepairDatabase(const std::string& db_path) {
for (std::vector<OriginRecord>::iterator db_origin_itr = origins.begin();
db_origin_itr != origins.end();
++db_origin_itr) {
- std::set<FilePath>::iterator dir_itr =
+ std::set<base::FilePath>::iterator dir_itr =
directories.find(db_origin_itr->path);
if (dir_itr == directories.end()) {
if (!RemovePathForOrigin(db_origin_itr->origin)) {
@@ -153,7 +154,7 @@ bool FileSystemOriginDatabase::RepairDatabase(const std::string& db_path) {
}
// Delete any directories not listed in the origins database.
- for (std::set<FilePath>::iterator dir_itr = directories.begin();
+ for (std::set<base::FilePath>::iterator dir_itr = directories.begin();
dir_itr != directories.end();
++dir_itr) {
if (!file_util::Delete(file_system_directory_.Append(*dir_itr),
@@ -214,7 +215,7 @@ bool FileSystemOriginDatabase::HasOriginPath(const std::string& origin) {
}
bool FileSystemOriginDatabase::GetPathForOrigin(
- const std::string& origin, FilePath* directory) {
+ const std::string& origin, base::FilePath* directory) {
if (!Init(REPAIR_ON_CORRUPTION))
return false;
DCHECK(directory);
@@ -271,7 +272,7 @@ bool FileSystemOriginDatabase::ListAllOrigins(
StartsWithASCII(iter->key().ToString(), origin_key_prefix, true)) {
std::string origin =
iter->key().ToString().substr(origin_key_prefix.length());
- FilePath path = StringToFilePath(iter->value().ToString());
+ base::FilePath path = StringToFilePath(iter->value().ToString());
origins->push_back(OriginRecord(origin, path));
iter->Next();
}
diff --git a/webkit/fileapi/file_system_origin_database.h b/webkit/fileapi/file_system_origin_database.h
index ea71822..98eb212 100644
--- a/webkit/fileapi/file_system_origin_database.h
+++ b/webkit/fileapi/file_system_origin_database.h
@@ -31,23 +31,23 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOriginDatabase {
public:
struct WEBKIT_STORAGE_EXPORT_PRIVATE OriginRecord {
std::string origin;
- FilePath path;
+ base::FilePath path;
OriginRecord();
- OriginRecord(const std::string& origin, const FilePath& path);
+ OriginRecord(const std::string& origin, const base::FilePath& path);
~OriginRecord();
};
// Only one instance of FileSystemOriginDatabase should exist for a given path
// at a given time.
- explicit FileSystemOriginDatabase(const FilePath& file_system_directory);
+ explicit FileSystemOriginDatabase(const base::FilePath& file_system_directory);
~FileSystemOriginDatabase();
bool HasOriginPath(const std::string& origin);
// This will produce a unique path and add it to its database, if it's not
// already present.
- bool GetPathForOrigin(const std::string& origin, FilePath* directory);
+ bool GetPathForOrigin(const std::string& origin, base::FilePath* directory);
// Also returns success if the origin is not found.
bool RemovePathForOrigin(const std::string& origin);
@@ -71,7 +71,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOriginDatabase {
void ReportInitStatus(const leveldb::Status& status);
bool GetLastPathNumber(int* number);
- FilePath file_system_directory_;
+ base::FilePath file_system_directory_;
scoped_ptr<leveldb::DB> db_;
base::Time last_reported_time_;
DISALLOW_COPY_AND_ASSIGN(FileSystemOriginDatabase);
diff --git a/webkit/fileapi/file_system_origin_database_unittest.cc b/webkit/fileapi/file_system_origin_database_unittest.cc
index 695bea8..e3cc8fb 100644
--- a/webkit/fileapi/file_system_origin_database_unittest.cc
+++ b/webkit/fileapi/file_system_origin_database_unittest.cc
@@ -22,15 +22,15 @@
namespace fileapi {
namespace {
-const FilePath::CharType kFileSystemDirName[] =
+const base::FilePath::CharType kFileSystemDirName[] =
FILE_PATH_LITERAL("File System");
-const FilePath::CharType kOriginDatabaseName[] = FILE_PATH_LITERAL("Origins");
+const base::FilePath::CharType kOriginDatabaseName[] = FILE_PATH_LITERAL("Origins");
} // namespace
TEST(FileSystemOriginDatabaseTest, BasicTest) {
base::ScopedTempDir dir;
ASSERT_TRUE(dir.CreateUniqueTempDir());
- const FilePath kFSDir = dir.path().Append(kFileSystemDirName);
+ const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName);
EXPECT_FALSE(file_util::PathExists(kFSDir));
EXPECT_TRUE(file_util::CreateDirectory(kFSDir));
@@ -41,8 +41,8 @@ TEST(FileSystemOriginDatabaseTest, BasicTest) {
// Double-check to make sure that had no side effects.
EXPECT_FALSE(database.HasOriginPath(origin));
- FilePath path0;
- FilePath path1;
+ base::FilePath path0;
+ base::FilePath path1;
// Empty strings aren't valid origins.
EXPECT_FALSE(database.GetPathForOrigin(std::string(), &path0));
@@ -60,7 +60,7 @@ TEST(FileSystemOriginDatabaseTest, BasicTest) {
TEST(FileSystemOriginDatabaseTest, TwoPathTest) {
base::ScopedTempDir dir;
ASSERT_TRUE(dir.CreateUniqueTempDir());
- const FilePath kFSDir = dir.path().Append(kFileSystemDirName);
+ const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName);
EXPECT_FALSE(file_util::PathExists(kFSDir));
EXPECT_TRUE(file_util::CreateDirectory(kFSDir));
@@ -71,8 +71,8 @@ TEST(FileSystemOriginDatabaseTest, TwoPathTest) {
EXPECT_FALSE(database.HasOriginPath(origin0));
EXPECT_FALSE(database.HasOriginPath(origin1));
- FilePath path0;
- FilePath path1;
+ base::FilePath path0;
+ base::FilePath path1;
EXPECT_TRUE(database.GetPathForOrigin(origin0, &path0));
EXPECT_TRUE(database.HasOriginPath(origin0));
EXPECT_FALSE(database.HasOriginPath(origin1));
@@ -88,7 +88,7 @@ TEST(FileSystemOriginDatabaseTest, TwoPathTest) {
TEST(FileSystemOriginDatabaseTest, DropDatabaseTest) {
base::ScopedTempDir dir;
ASSERT_TRUE(dir.CreateUniqueTempDir());
- const FilePath kFSDir = dir.path().Append(kFileSystemDirName);
+ const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName);
EXPECT_FALSE(file_util::PathExists(kFSDir));
EXPECT_TRUE(file_util::CreateDirectory(kFSDir));
@@ -97,7 +97,7 @@ TEST(FileSystemOriginDatabaseTest, DropDatabaseTest) {
EXPECT_FALSE(database.HasOriginPath(origin));
- FilePath path0;
+ base::FilePath path0;
EXPECT_TRUE(database.GetPathForOrigin(origin, &path0));
EXPECT_TRUE(database.HasOriginPath(origin));
EXPECT_FALSE(path0.empty());
@@ -106,7 +106,7 @@ TEST(FileSystemOriginDatabaseTest, DropDatabaseTest) {
database.DropDatabase();
- FilePath path1;
+ base::FilePath path1;
EXPECT_TRUE(database.HasOriginPath(origin));
EXPECT_TRUE(database.GetPathForOrigin(origin, &path1));
EXPECT_FALSE(path1.empty());
@@ -116,7 +116,7 @@ TEST(FileSystemOriginDatabaseTest, DropDatabaseTest) {
TEST(FileSystemOriginDatabaseTest, DeleteOriginTest) {
base::ScopedTempDir dir;
ASSERT_TRUE(dir.CreateUniqueTempDir());
- const FilePath kFSDir = dir.path().Append(kFileSystemDirName);
+ const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName);
EXPECT_FALSE(file_util::PathExists(kFSDir));
EXPECT_TRUE(file_util::CreateDirectory(kFSDir));
@@ -126,7 +126,7 @@ TEST(FileSystemOriginDatabaseTest, DeleteOriginTest) {
EXPECT_FALSE(database.HasOriginPath(origin));
EXPECT_TRUE(database.RemovePathForOrigin(origin));
- FilePath path0;
+ base::FilePath path0;
EXPECT_TRUE(database.GetPathForOrigin(origin, &path0));
EXPECT_TRUE(database.HasOriginPath(origin));
EXPECT_FALSE(path0.empty());
@@ -134,7 +134,7 @@ TEST(FileSystemOriginDatabaseTest, DeleteOriginTest) {
EXPECT_TRUE(database.RemovePathForOrigin(origin));
EXPECT_FALSE(database.HasOriginPath(origin));
- FilePath path1;
+ base::FilePath path1;
EXPECT_TRUE(database.GetPathForOrigin(origin, &path1));
EXPECT_FALSE(path1.empty());
EXPECT_NE(path0, path1);
@@ -143,7 +143,7 @@ TEST(FileSystemOriginDatabaseTest, DeleteOriginTest) {
TEST(FileSystemOriginDatabaseTest, ListOriginsTest) {
base::ScopedTempDir dir;
ASSERT_TRUE(dir.CreateUniqueTempDir());
- const FilePath kFSDir = dir.path().Append(kFileSystemDirName);
+ const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName);
EXPECT_FALSE(file_util::PathExists(kFSDir));
EXPECT_TRUE(file_util::CreateDirectory(kFSDir));
@@ -160,8 +160,8 @@ TEST(FileSystemOriginDatabaseTest, ListOriginsTest) {
EXPECT_FALSE(database.HasOriginPath(origin0));
EXPECT_FALSE(database.HasOriginPath(origin1));
- FilePath path0;
- FilePath path1;
+ base::FilePath path0;
+ base::FilePath path1;
EXPECT_TRUE(database.GetPathForOrigin(origin0, &path0));
EXPECT_TRUE(database.ListAllOrigins(&origins));
EXPECT_EQ(origins.size(), 1UL);
@@ -192,8 +192,8 @@ TEST(FileSystemOriginDatabaseTest, DatabaseRecoveryTest) {
base::ScopedTempDir dir;
ASSERT_TRUE(dir.CreateUniqueTempDir());
- const FilePath kFSDir = dir.path().Append(kFileSystemDirName);
- const FilePath kDBDir = kFSDir.Append(kOriginDatabaseName);
+ const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName);
+ const base::FilePath kDBDir = kFSDir.Append(kOriginDatabaseName);
EXPECT_FALSE(file_util::PathExists(kFSDir));
EXPECT_TRUE(file_util::CreateDirectory(kFSDir));
@@ -208,7 +208,7 @@ TEST(FileSystemOriginDatabaseTest, DatabaseRecoveryTest) {
scoped_ptr<FileSystemOriginDatabase> database(
new FileSystemOriginDatabase(kFSDir));
for (size_t i = 0; i < arraysize(kOrigins); ++i) {
- FilePath path;
+ base::FilePath path;
EXPECT_FALSE(database->HasOriginPath(kOrigins[i]));
EXPECT_TRUE(database->GetPathForOrigin(kOrigins[i], &path));
EXPECT_FALSE(path.empty());
@@ -219,8 +219,8 @@ TEST(FileSystemOriginDatabaseTest, DatabaseRecoveryTest) {
}
database.reset();
- const FilePath kGarbageDir = kFSDir.AppendASCII("foo");
- const FilePath kGarbageFile = kGarbageDir.AppendASCII("bar");
+ const base::FilePath kGarbageDir = kFSDir.AppendASCII("foo");
+ const base::FilePath kGarbageFile = kGarbageDir.AppendASCII("bar");
EXPECT_TRUE(file_util::CreateDirectory(kGarbageDir));
bool created = false;
base::PlatformFileError error;
@@ -239,7 +239,7 @@ TEST(FileSystemOriginDatabaseTest, DatabaseRecoveryTest) {
0, std::numeric_limits<size_t>::max());
CorruptDatabase(kDBDir, leveldb::kLogFile, -1, 1);
- FilePath path;
+ base::FilePath path;
database.reset(new FileSystemOriginDatabase(kFSDir));
std::vector<FileSystemOriginDatabase::OriginRecord> origins_in_db;
EXPECT_TRUE(database->ListAllOrigins(&origins_in_db));
diff --git a/webkit/fileapi/file_system_quota_client_unittest.cc b/webkit/fileapi/file_system_quota_client_unittest.cc
index ae858e0..8859ddd 100644
--- a/webkit/fileapi/file_system_quota_client_unittest.cc
+++ b/webkit/fileapi/file_system_quota_client_unittest.cc
@@ -129,7 +129,7 @@ class FileSystemQuotaClientTest : public testing::Test {
return context;
}
- bool CreateFileSystemDirectory(const FilePath& file_path,
+ bool CreateFileSystemDirectory(const base::FilePath& file_path,
const std::string& origin_url,
quota::StorageType storage_type) {
FileSystemType type = QuotaStorageTypeToFileSystemType(storage_type);
@@ -147,7 +147,7 @@ class FileSystemQuotaClientTest : public testing::Test {
return true;
}
- bool CreateFileSystemFile(const FilePath& file_path,
+ bool CreateFileSystemFile(const base::FilePath& file_path,
int64 file_size,
const std::string& origin_url,
quota::StorageType storage_type) {
@@ -178,7 +178,7 @@ class FileSystemQuotaClientTest : public testing::Test {
const TestFile* files,
int num_files) {
for (int i = 0; i < num_files; i++) {
- FilePath path = FilePath().AppendASCII(files[i].name);
+ base::FilePath path = base::FilePath().AppendASCII(files[i].name);
if (files[i].isDirectory) {
ASSERT_TRUE(CreateFileSystemDirectory(
path, files[i].origin_url, files[i].type));
@@ -210,7 +210,7 @@ class FileSystemQuotaClientTest : public testing::Test {
for (int i = 0; i < num_files; i++) {
if (files[i].type == type &&
GURL(files[i].origin_url) == GURL(origin_url)) {
- FilePath path = FilePath().AppendASCII(files[i].name);
+ base::FilePath path = base::FilePath().AppendASCII(files[i].name);
if (!path.empty()) {
file_paths_cost += ObfuscatedFileUtil::ComputeFilePathCost(path);
}
diff --git a/webkit/fileapi/file_system_url.cc b/webkit/fileapi/file_system_url.cc
index 7d88f14..5f38e53 100644
--- a/webkit/fileapi/file_system_url.cc
+++ b/webkit/fileapi/file_system_url.cc
@@ -21,7 +21,7 @@ namespace {
bool ParseFileSystemURL(const GURL& url,
GURL* origin_url,
FileSystemType* type,
- FilePath* file_path) {
+ base::FilePath* file_path) {
GURL origin;
FileSystemType file_system_type = kFileSystemTypeUnknown;
@@ -60,7 +60,7 @@ bool ParseFileSystemURL(const GURL& url,
while (!path.empty() && path[0] == '/')
path.erase(0, 1);
- FilePath converted_path = FilePath::FromUTF8Unsafe(path);
+ base::FilePath converted_path = base::FilePath::FromUTF8Unsafe(path);
// All parent references should have been resolved in the renderer.
if (converted_path.ReferencesParent())
@@ -92,7 +92,7 @@ FileSystemURL FileSystemURL::CreateForTest(const GURL& url) {
FileSystemURL FileSystemURL::CreateForTest(const GURL& origin,
FileSystemType type,
- const FilePath& path) {
+ const base::FilePath& path) {
return FileSystemURL(origin, type, path);
}
@@ -105,7 +105,7 @@ FileSystemURL::FileSystemURL(const GURL& url)
FileSystemURL::FileSystemURL(const GURL& origin,
FileSystemType type,
- const FilePath& path)
+ const base::FilePath& path)
: is_valid_(true),
origin_(origin),
type_(type),
@@ -115,10 +115,10 @@ FileSystemURL::FileSystemURL(const GURL& origin,
FileSystemURL::FileSystemURL(const GURL& origin,
FileSystemType original_type,
- const FilePath& original_path,
+ const base::FilePath& original_path,
const std::string& filesystem_id,
FileSystemType cracked_type,
- const FilePath& cracked_path)
+ const base::FilePath& cracked_path)
: is_valid_(true),
origin_(origin),
type_(cracked_type),
@@ -149,7 +149,7 @@ std::string FileSystemURL::DebugString() const {
return ss.str();
}
-FileSystemURL FileSystemURL::WithPath(const FilePath& path) const {
+FileSystemURL FileSystemURL::WithPath(const base::FilePath& path) const {
FileSystemURL url = *this;
url.path_ = path;
url.virtual_path_.clear();
diff --git a/webkit/fileapi/file_system_url.h b/webkit/fileapi/file_system_url.h
index 0245d94..99b187b 100644
--- a/webkit/fileapi/file_system_url.h
+++ b/webkit/fileapi/file_system_url.h
@@ -62,11 +62,11 @@ namespace fileapi {
// one of the friended classes.
//
// TODO(ericu): Look into making path() [and all FileSystem API virtual
-// paths] just an std::string, to prevent platform-specific FilePath behavior
-// from getting invoked by accident. Currently the FilePath returned here needs
+// paths] just an std::string, to prevent platform-specific base::FilePath behavior
+// from getting invoked by accident. Currently the base::FilePath returned here needs
// special treatment, as it may contain paths that are illegal on the current
// platform. To avoid problems, use VirtualPath::BaseName and
-// VirtualPath::GetComponents instead of the FilePath methods.
+// VirtualPath::GetComponents instead of the base::FilePath methods.
class WEBKIT_STORAGE_EXPORT FileSystemURL {
public:
FileSystemURL();
@@ -77,7 +77,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemURL {
static FileSystemURL CreateForTest(const GURL& url);
static FileSystemURL CreateForTest(const GURL& origin,
FileSystemType type,
- const FilePath& path);
+ const base::FilePath& path);
// Returns true if this instance represents a valid FileSystem URL.
bool is_valid() const { return is_valid_; }
@@ -90,12 +90,12 @@ class WEBKIT_STORAGE_EXPORT FileSystemURL {
// Returns the path part of this URL. See the class comment for details.
// TODO(kinuko): this must return std::string.
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
// Returns the original path part of this URL.
// See the class comment for details.
// TODO(kinuko): this must return std::string.
- const FilePath& virtual_path() const { return virtual_path_; }
+ const base::FilePath& virtual_path() const { return virtual_path_; }
// Returns the filesystem ID/mount name for isolated/external filesystem URLs.
// See the class comment for details.
@@ -112,7 +112,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemURL {
// Note that the resulting FileSystemURL loses original URL information
// if it was a cracked filesystem; i.e. virtual_path and mount_type will
// be set to empty values.
- FileSystemURL WithPath(const FilePath& path) const;
+ FileSystemURL WithPath(const base::FilePath& path) const;
// Returns true if this URL is a strict parent of the |child|.
bool IsParent(const FileSystemURL& child) const;
@@ -131,25 +131,25 @@ class WEBKIT_STORAGE_EXPORT FileSystemURL {
explicit FileSystemURL(const GURL& filesystem_url);
FileSystemURL(const GURL& origin,
FileSystemType type,
- const FilePath& internal_path);
+ const base::FilePath& internal_path);
// Creates a cracked FileSystemURL.
FileSystemURL(const GURL& origin,
FileSystemType original_type,
- const FilePath& original_path,
+ const base::FilePath& original_path,
const std::string& filesystem_id,
FileSystemType cracked_type,
- const FilePath& cracked_path);
+ const base::FilePath& cracked_path);
bool is_valid_;
GURL origin_;
FileSystemType type_;
FileSystemType mount_type_;
- FilePath path_;
+ base::FilePath path_;
// Values specific to cracked URLs.
std::string filesystem_id_;
- FilePath virtual_path_;
+ base::FilePath virtual_path_;
};
diff --git a/webkit/fileapi/file_system_url_request_job.cc b/webkit/fileapi/file_system_url_request_job.cc
index 18bf738..4db776a 100644
--- a/webkit/fileapi/file_system_url_request_job.cc
+++ b/webkit/fileapi/file_system_url_request_job.cc
@@ -117,7 +117,7 @@ bool FileSystemURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size,
bool FileSystemURLRequestJob::GetMimeType(std::string* mime_type) const {
DCHECK(request_);
DCHECK(url_.is_valid());
- FilePath::StringType extension = url_.path().Extension();
+ base::FilePath::StringType extension = url_.path().Extension();
if (!extension.empty())
extension = extension.substr(1);
return net::GetWellKnownMimeTypeFromExtension(extension, mime_type);
@@ -174,7 +174,7 @@ void FileSystemURLRequestJob::StartAsync() {
void FileSystemURLRequestJob::DidGetMetadata(
base::PlatformFileError error_code,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
if (error_code != base::PLATFORM_FILE_OK) {
NotifyFailed(error_code == base::PLATFORM_FILE_ERROR_INVALID_URL ?
net::ERR_INVALID_URL : net::ERR_FILE_NOT_FOUND);
diff --git a/webkit/fileapi/file_system_url_request_job.h b/webkit/fileapi/file_system_url_request_job.h
index 5b6e42d..55f6e70 100644
--- a/webkit/fileapi/file_system_url_request_job.h
+++ b/webkit/fileapi/file_system_url_request_job.h
@@ -17,7 +17,10 @@
#include "webkit/storage/webkit_storage_export.h"
class GURL;
+
+namespace base {
class FilePath;
+}
namespace webkit_blob {
class FileStreamReader;
@@ -60,7 +63,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemURLRequestJob
void DidGetMetadata(
base::PlatformFileError error_code,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
void DidRead(int result);
void NotifyFailed(int rv);
diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc
index 5168886..b142d6c 100644
--- a/webkit/fileapi/file_system_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_url_request_job_unittest.cc
@@ -138,7 +138,7 @@ class FileSystemURLRequestJobTest : public testing::Test {
FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL(
GURL("http://remote"),
kFileSystemTypeTemporary,
- FilePath().AppendASCII(dir_name));
+ base::FilePath().AppendASCII(dir_name));
FileSystemOperationContext context(file_system_context_);
context.set_allowed_bytes_growth(1024);
@@ -157,7 +157,7 @@ class FileSystemURLRequestJobTest : public testing::Test {
FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL(
GURL("http://remote"),
kFileSystemTypeTemporary,
- FilePath().AppendASCII(file_name));
+ base::FilePath().AppendASCII(file_name));
FileSystemOperationContext context(file_system_context_);
context.set_allowed_bytes_growth(1024);
@@ -353,8 +353,8 @@ TEST_F(FileSystemURLRequestJobTest, GetMimeType) {
const char kFilename[] = "hoge.html";
std::string mime_type_direct;
- FilePath::StringType extension =
- FilePath().AppendASCII(kFilename).Extension();
+ base::FilePath::StringType extension =
+ base::FilePath().AppendASCII(kFilename).Extension();
if (!extension.empty())
extension = extension.substr(1);
EXPECT_TRUE(net::GetWellKnownMimeTypeFromExtension(
diff --git a/webkit/fileapi/file_system_url_unittest.cc b/webkit/fileapi/file_system_url_unittest.cc
index 58a4b7a..158f768 100644
--- a/webkit/fileapi/file_system_url_unittest.cc
+++ b/webkit/fileapi/file_system_url_unittest.cc
@@ -41,12 +41,12 @@ FileSystemURL CreateFileSystemURL(const std::string& url_string) {
FileSystemURL CreateExternalFileSystemURL(const GURL& origin,
FileSystemType type,
- const FilePath& path) {
+ const base::FilePath& path) {
return ExternalMountPoints::GetSystemInstance()->CreateCrackedFileSystemURL(
origin, type, path);
}
-std::string NormalizedUTF8Path(const FilePath& path) {
+std::string NormalizedUTF8Path(const base::FilePath& path) {
return path.NormalizePathSeparators().AsUTF8Unsafe();
}
@@ -140,7 +140,7 @@ TEST(FileSystemURLTest, CompareURLs) {
TEST(FileSystemURLTest, WithPath) {
const GURL kURL("filesystem:http://chromium.org/temporary/dir");
- const FilePath::StringType paths[] = {
+ const base::FilePath::StringType paths[] = {
FPL("dir a"),
FPL("dir a/file 1"),
FPL("dir a/dir b"),
@@ -149,7 +149,7 @@ TEST(FileSystemURLTest, WithPath) {
const FileSystemURL base = FileSystemURL::CreateForTest(kURL);
for (size_t i = 0; i < arraysize(paths); ++i) {
- const FileSystemURL url = base.WithPath(FilePath(paths[i]));
+ const FileSystemURL url = base.WithPath(base::FilePath(paths[i]));
EXPECT_EQ(paths[i], url.path().value());
EXPECT_EQ(base.origin().spec(), url.origin().spec());
EXPECT_EQ(base.type(), url.type());
@@ -160,11 +160,11 @@ TEST(FileSystemURLTest, WithPath) {
TEST(FileSystemURLTest, WithPathForExternal) {
const std::string kId = "foo";
- ScopedExternalFileSystem scoped_fs(kId, kFileSystemTypeSyncable, FilePath());
- const FilePath kVirtualRoot = scoped_fs.GetVirtualRootPath();
+ ScopedExternalFileSystem scoped_fs(kId, kFileSystemTypeSyncable, base::FilePath());
+ const base::FilePath kVirtualRoot = scoped_fs.GetVirtualRootPath();
- const FilePath::CharType kBasePath[] = FPL("dir");
- const FilePath::StringType paths[] = {
+ const base::FilePath::CharType kBasePath[] = FPL("dir");
+ const base::FilePath::StringType paths[] = {
FPL("dir a"),
FPL("dir a/file 1"),
FPL("dir a/dir b"),
@@ -177,7 +177,7 @@ TEST(FileSystemURLTest, WithPathForExternal) {
kVirtualRoot.Append(kBasePath));
for (size_t i = 0; i < arraysize(paths); ++i) {
- const FileSystemURL url = base.WithPath(FilePath(paths[i]));
+ const FileSystemURL url = base.WithPath(base::FilePath(paths[i]));
EXPECT_EQ(paths[i], url.path().value());
EXPECT_EQ(base.origin().spec(), url.origin().spec());
EXPECT_EQ(base.type(), url.type());
@@ -187,8 +187,8 @@ TEST(FileSystemURLTest, WithPathForExternal) {
}
TEST(FileSystemURLTest, IsParent) {
- ScopedExternalFileSystem scoped1("foo", kFileSystemTypeSyncable, FilePath());
- ScopedExternalFileSystem scoped2("bar", kFileSystemTypeSyncable, FilePath());
+ ScopedExternalFileSystem scoped1("foo", kFileSystemTypeSyncable, base::FilePath());
+ ScopedExternalFileSystem scoped2("bar", kFileSystemTypeSyncable, base::FilePath());
const std::string root1 = GetFileSystemRootURI(
GURL("http://example.com"), kFileSystemTypeTemporary).spec();
@@ -232,7 +232,7 @@ TEST(FileSystemURLTest, IsParent) {
TEST(FileSystemURLTest, DebugString) {
const GURL kOrigin("http://example.com");
- const FilePath kPath(FPL("dir/file"));
+ const base::FilePath kPath(FPL("dir/file"));
const FileSystemURL kURL1 = FileSystemURL::CreateForTest(
kOrigin, kFileSystemTypeTemporary, kPath);
@@ -240,7 +240,7 @@ TEST(FileSystemURLTest, DebugString) {
NormalizedUTF8Path(kPath),
kURL1.DebugString());
- const FilePath kRoot(DRIVE FPL("/root"));
+ const base::FilePath kRoot(DRIVE FPL("/root"));
ScopedExternalFileSystem scoped_fs("foo",
kFileSystemTypeNativeLocal,
kRoot.NormalizePathSeparators());
diff --git a/webkit/fileapi/file_system_usage_cache.cc b/webkit/fileapi/file_system_usage_cache.cc
index 1c5e824..fedb79e 100644
--- a/webkit/fileapi/file_system_usage_cache.cc
+++ b/webkit/fileapi/file_system_usage_cache.cc
@@ -10,7 +10,7 @@
namespace fileapi {
-const FilePath::CharType FileSystemUsageCache::kUsageFileName[] =
+const base::FilePath::CharType FileSystemUsageCache::kUsageFileName[] =
FILE_PATH_LITERAL(".usage");
const char FileSystemUsageCache::kUsageFileHeader[] = "FSU5";
const int FileSystemUsageCache::kUsageFileHeaderSize = 4;
@@ -22,7 +22,7 @@ const int FileSystemUsageCache::kUsageFileSize =
sizeof(int) + sizeof(int32) + sizeof(int64);
// static
-int64 FileSystemUsageCache::GetUsage(const FilePath& usage_file_path) {
+int64 FileSystemUsageCache::GetUsage(const base::FilePath& usage_file_path) {
bool is_valid = true;
uint32 dirty = 0;
int64 fs_usage;
@@ -35,7 +35,7 @@ int64 FileSystemUsageCache::GetUsage(const FilePath& usage_file_path) {
}
// static
-int32 FileSystemUsageCache::GetDirty(const FilePath& usage_file_path) {
+int32 FileSystemUsageCache::GetDirty(const base::FilePath& usage_file_path) {
bool is_valid = true;
uint32 dirty = 0;
int64 fs_usage;
@@ -48,7 +48,7 @@ int32 FileSystemUsageCache::GetDirty(const FilePath& usage_file_path) {
}
// static
-bool FileSystemUsageCache::IncrementDirty(const FilePath& usage_file_path) {
+bool FileSystemUsageCache::IncrementDirty(const base::FilePath& usage_file_path) {
bool is_valid = true;
uint32 dirty = 0;
int64 fs_usage;
@@ -61,7 +61,7 @@ bool FileSystemUsageCache::IncrementDirty(const FilePath& usage_file_path) {
}
// static
-bool FileSystemUsageCache::DecrementDirty(const FilePath& usage_file_path) {
+bool FileSystemUsageCache::DecrementDirty(const base::FilePath& usage_file_path) {
bool is_valid = true;
uint32 dirty = 0;
int64 fs_usage;
@@ -74,7 +74,7 @@ bool FileSystemUsageCache::DecrementDirty(const FilePath& usage_file_path) {
}
// static
-bool FileSystemUsageCache::Invalidate(const FilePath& usage_file_path) {
+bool FileSystemUsageCache::Invalidate(const base::FilePath& usage_file_path) {
bool is_valid = true;
uint32 dirty = 0;
int64 fs_usage;
@@ -83,7 +83,7 @@ bool FileSystemUsageCache::Invalidate(const FilePath& usage_file_path) {
return fs_usage >= 0 && Write(usage_file_path, false, dirty, fs_usage);
}
-bool FileSystemUsageCache::IsValid(const FilePath& usage_file_path) {
+bool FileSystemUsageCache::IsValid(const base::FilePath& usage_file_path) {
bool is_valid = true;
uint32 dirty = 0;
int64 result = Read(usage_file_path, &is_valid, &dirty);
@@ -95,7 +95,7 @@ bool FileSystemUsageCache::IsValid(const FilePath& usage_file_path) {
// static
int FileSystemUsageCache::AtomicUpdateUsageByDelta(
- const FilePath& usage_file_path, int64 delta) {
+ const base::FilePath& usage_file_path, int64 delta) {
bool is_valid = true;
uint32 dirty = 0;
int64 fs_usage;
@@ -109,23 +109,23 @@ int FileSystemUsageCache::AtomicUpdateUsageByDelta(
}
// static
-int FileSystemUsageCache::UpdateUsage(const FilePath& usage_file_path,
+int FileSystemUsageCache::UpdateUsage(const base::FilePath& usage_file_path,
int64 fs_usage) {
return Write(usage_file_path, true, 0, fs_usage);
}
// static
-bool FileSystemUsageCache::Exists(const FilePath& usage_file_path) {
+bool FileSystemUsageCache::Exists(const base::FilePath& usage_file_path) {
return file_util::PathExists(usage_file_path);
}
// static
-bool FileSystemUsageCache::Delete(const FilePath& usage_file_path) {
+bool FileSystemUsageCache::Delete(const base::FilePath& usage_file_path) {
return file_util::Delete(usage_file_path, true);
}
// static
-int64 FileSystemUsageCache::Read(const FilePath& usage_file_path,
+int64 FileSystemUsageCache::Read(const base::FilePath& usage_file_path,
bool* is_valid,
uint32* dirty) {
char buffer[kUsageFileSize];
@@ -154,7 +154,7 @@ int64 FileSystemUsageCache::Read(const FilePath& usage_file_path,
}
// static
-int FileSystemUsageCache::Write(const FilePath& usage_file_path,
+int FileSystemUsageCache::Write(const base::FilePath& usage_file_path,
bool is_valid,
uint32 dirty,
int64 fs_usage) {
@@ -164,7 +164,7 @@ int FileSystemUsageCache::Write(const FilePath& usage_file_path,
write_pickle.WriteUInt32(dirty);
write_pickle.WriteInt64(fs_usage);
- FilePath temporary_usage_file_path;
+ base::FilePath temporary_usage_file_path;
if (usage_file_path.empty() ||
!file_util::CreateTemporaryFileInDir(usage_file_path.DirName(),
&temporary_usage_file_path)) {
diff --git a/webkit/fileapi/file_system_usage_cache.h b/webkit/fileapi/file_system_usage_cache.h
index 3d25120..428aa4b 100644
--- a/webkit/fileapi/file_system_usage_cache.h
+++ b/webkit/fileapi/file_system_usage_cache.h
@@ -16,34 +16,34 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemUsageCache {
// Gets the size described in the .usage file even if dirty > 0 or
// is_valid == false. Returns less than zero if the .usage file is not
// available.
- static int64 GetUsage(const FilePath& usage_file_path);
+ static int64 GetUsage(const base::FilePath& usage_file_path);
// Gets the dirty count in the .usage file.
// Returns less than zero if the .usage file is not available.
- static int32 GetDirty(const FilePath& usage_file_path);
+ static int32 GetDirty(const base::FilePath& usage_file_path);
// Increments or decrements the "dirty" entry in the .usage file.
// Returns false if no .usage is available.
- static bool IncrementDirty(const FilePath& usage_file_path);
- static bool DecrementDirty(const FilePath& usage_file_path);
+ static bool IncrementDirty(const base::FilePath& usage_file_path);
+ static bool DecrementDirty(const base::FilePath& usage_file_path);
// Notifies quota system that it needs to recalculate the usage cache of the
// origin. Returns false if no .usage is available.
- static bool Invalidate(const FilePath& usage_file_path);
- static bool IsValid(const FilePath& usage_file_path);
+ static bool Invalidate(const base::FilePath& usage_file_path);
+ static bool IsValid(const base::FilePath& usage_file_path);
// Updates the size described in the .usage file.
- static int UpdateUsage(const FilePath& usage_file_path, int64 fs_usage);
+ static int UpdateUsage(const base::FilePath& usage_file_path, int64 fs_usage);
// Updates the size described in the .usage file by delta with keeping dirty
// even if dirty > 0.
static int AtomicUpdateUsageByDelta(
- const FilePath& usage_file_path, int64 delta);
+ const base::FilePath& usage_file_path, int64 delta);
- static bool Exists(const FilePath& usage_file_path);
- static bool Delete(const FilePath& usage_file_path);
+ static bool Exists(const base::FilePath& usage_file_path);
+ static bool Delete(const base::FilePath& usage_file_path);
- static const FilePath::CharType kUsageFileName[];
+ static const base::FilePath::CharType kUsageFileName[];
static const char kUsageFileHeader[];
static const int kUsageFileSize;
static const int kUsageFileHeaderSize;
@@ -51,11 +51,11 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemUsageCache {
private:
// Read the size, validity and the "dirty" entry described in the .usage file.
// Returns less than zero if no .usage file is available.
- static int64 Read(const FilePath& usage_file_path,
+ static int64 Read(const base::FilePath& usage_file_path,
bool* is_valid,
uint32* dirty);
- static int Write(const FilePath& usage_file_path,
+ static int Write(const base::FilePath& usage_file_path,
bool is_valid,
uint32 dirty,
int64 fs_usage);
diff --git a/webkit/fileapi/file_system_usage_cache_unittest.cc b/webkit/fileapi/file_system_usage_cache_unittest.cc
index 8662dc8..edc4457 100644
--- a/webkit/fileapi/file_system_usage_cache_unittest.cc
+++ b/webkit/fileapi/file_system_usage_cache_unittest.cc
@@ -20,7 +20,7 @@ class FileSystemUsageCacheTest : public testing::Test {
}
protected:
- FilePath GetUsageFilePath() {
+ base::FilePath GetUsageFilePath() {
return data_dir_.path().Append(FileSystemUsageCache::kUsageFileName);
}
@@ -31,14 +31,14 @@ class FileSystemUsageCacheTest : public testing::Test {
};
TEST_F(FileSystemUsageCacheTest, CreateTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
EXPECT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, 0));
}
TEST_F(FileSystemUsageCacheTest, SetSizeTest) {
static const int64 size = 240122;
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, size));
EXPECT_EQ(size, FileSystemUsageCache::GetUsage(usage_file_path));
@@ -46,14 +46,14 @@ TEST_F(FileSystemUsageCacheTest, SetSizeTest) {
TEST_F(FileSystemUsageCacheTest, SetLargeSizeTest) {
static const int64 size = kint64max;
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, size));
EXPECT_EQ(size, FileSystemUsageCache::GetUsage(usage_file_path));
}
TEST_F(FileSystemUsageCacheTest, IncAndGetSizeTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, 98214));
ASSERT_TRUE(FileSystemUsageCache::IncrementDirty(usage_file_path));
@@ -63,7 +63,7 @@ TEST_F(FileSystemUsageCacheTest, IncAndGetSizeTest) {
TEST_F(FileSystemUsageCacheTest, DecAndGetSizeTest) {
static const int64 size = 71839;
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, size));
// DecrementDirty for dirty = 0 is invalid. It returns false.
@@ -73,7 +73,7 @@ TEST_F(FileSystemUsageCacheTest, DecAndGetSizeTest) {
TEST_F(FileSystemUsageCacheTest, IncDecAndGetSizeTest) {
static const int64 size = 198491;
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, size));
ASSERT_TRUE(FileSystemUsageCache::IncrementDirty(usage_file_path));
@@ -82,7 +82,7 @@ TEST_F(FileSystemUsageCacheTest, IncDecAndGetSizeTest) {
}
TEST_F(FileSystemUsageCacheTest, DecIncAndGetSizeTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, 854238));
// DecrementDirty for dirty = 0 is invalid. It returns false.
@@ -96,7 +96,7 @@ TEST_F(FileSystemUsageCacheTest, DecIncAndGetSizeTest) {
TEST_F(FileSystemUsageCacheTest, ManyIncsSameDecsAndGetSizeTest) {
static const int64 size = 82412;
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, size));
for (int i = 0; i < 20; i++)
@@ -107,7 +107,7 @@ TEST_F(FileSystemUsageCacheTest, ManyIncsSameDecsAndGetSizeTest) {
}
TEST_F(FileSystemUsageCacheTest, ManyIncsLessDecsAndGetSizeTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
ASSERT_EQ(FileSystemUsageCache::kUsageFileSize,
FileSystemUsageCache::UpdateUsage(usage_file_path, 19319));
for (int i = 0; i < 20; i++)
@@ -119,17 +119,17 @@ TEST_F(FileSystemUsageCacheTest, ManyIncsLessDecsAndGetSizeTest) {
}
TEST_F(FileSystemUsageCacheTest, GetSizeWithoutCacheFileTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
EXPECT_EQ(-1, FileSystemUsageCache::GetUsage(usage_file_path));
}
TEST_F(FileSystemUsageCacheTest, IncrementDirtyWithoutCacheFileTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
EXPECT_FALSE(FileSystemUsageCache::IncrementDirty(usage_file_path));
}
TEST_F(FileSystemUsageCacheTest, DecrementDirtyWithoutCacheFileTest) {
- FilePath usage_file_path = GetUsageFilePath();
+ base::FilePath usage_file_path = GetUsageFilePath();
EXPECT_FALSE(FileSystemUsageCache::IncrementDirty(usage_file_path));
}
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index 07db153..7e017f7 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -27,26 +27,26 @@ const char kTestDir[] = "/test";
// TODO(ericu): Consider removing support for '\', even on Windows, if possible.
// There's a lot of test code that will need reworking, and we may have trouble
-// with FilePath elsewhere [e.g. DirName and other methods may also need
+// with base::FilePath elsewhere [e.g. DirName and other methods may also need
// replacement].
-FilePath VirtualPath::BaseName(const FilePath& virtual_path) {
- FilePath::StringType path = virtual_path.value();
+base::FilePath VirtualPath::BaseName(const base::FilePath& virtual_path) {
+ base::FilePath::StringType path = virtual_path.value();
// Keep everything after the final separator, but if the pathname is only
// one character and it's a separator, leave it alone.
- while (path.size() > 1 && FilePath::IsSeparator(path[path.size() - 1]))
+ while (path.size() > 1 && base::FilePath::IsSeparator(path[path.size() - 1]))
path.resize(path.size() - 1);
- FilePath::StringType::size_type last_separator =
- path.find_last_of(FilePath::kSeparators);
- if (last_separator != FilePath::StringType::npos &&
+ base::FilePath::StringType::size_type last_separator =
+ path.find_last_of(base::FilePath::kSeparators);
+ if (last_separator != base::FilePath::StringType::npos &&
last_separator < path.size() - 1)
path.erase(0, last_separator + 1);
- return FilePath(path);
+ return base::FilePath(path);
}
void VirtualPath::GetComponents(
- const FilePath& path, std::vector<FilePath::StringType>* components) {
+ const base::FilePath& path, std::vector<base::FilePath::StringType>* components) {
DCHECK(components);
if (!components)
return;
@@ -54,12 +54,12 @@ void VirtualPath::GetComponents(
if (path.value().empty())
return;
- std::vector<FilePath::StringType> ret_val;
- FilePath current = path;
- FilePath base;
+ std::vector<base::FilePath::StringType> ret_val;
+ base::FilePath current = path;
+ base::FilePath base;
- // Due to the way things are implemented, FilePath::DirName works here,
- // whereas FilePath::BaseName doesn't.
+ // Due to the way things are implemented, base::FilePath::DirName works here,
+ // whereas base::FilePath::BaseName doesn't.
while (current != current.DirName()) {
base = BaseName(current);
ret_val.push_back(base.value());
@@ -67,7 +67,7 @@ void VirtualPath::GetComponents(
}
*components =
- std::vector<FilePath::StringType>(ret_val.rbegin(), ret_val.rend());
+ std::vector<base::FilePath::StringType>(ret_val.rbegin(), ret_val.rend());
}
GURL GetFileSystemRootURI(const GURL& origin_url, FileSystemType type) {
@@ -193,7 +193,7 @@ std::string GetFileSystemTypeString(FileSystemType type) {
return std::string();
}
-std::string FilePathToString(const FilePath& file_path) {
+std::string FilePathToString(const base::FilePath& file_path) {
#if defined(OS_WIN)
return UTF16ToUTF8(file_path.value());
#elif defined(OS_POSIX)
@@ -201,11 +201,11 @@ std::string FilePathToString(const FilePath& file_path) {
#endif
}
-FilePath StringToFilePath(const std::string& file_path_string) {
+base::FilePath StringToFilePath(const std::string& file_path_string) {
#if defined(OS_WIN)
- return FilePath(UTF8ToUTF16(file_path_string));
+ return base::FilePath(UTF8ToUTF16(file_path_string));
#elif defined(OS_POSIX)
- return FilePath(file_path_string);
+ return base::FilePath(file_path_string);
#endif
}
@@ -282,7 +282,7 @@ std::string GetIsolatedFileSystemRootURIString(
root.append(filesystem_id);
root.append("/");
if (!optional_root_name.empty()) {
- DCHECK(!FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent());
+ DCHECK(!base::FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent());
root.append(optional_root_name);
root.append("/");
}
diff --git a/webkit/fileapi/file_system_util.h b/webkit/fileapi/file_system_util.h
index b8bc41f..be863bf 100644
--- a/webkit/fileapi/file_system_util.h
+++ b/webkit/fileapi/file_system_util.h
@@ -27,17 +27,17 @@ extern const char kTestDir[];
class WEBKIT_STORAGE_EXPORT VirtualPath {
public:
- // Use this instead of FilePath::BaseName when operating on virtual paths.
- // FilePath::BaseName will get confused by ':' on Windows when it looks like a
+ // Use this instead of base::FilePath::BaseName when operating on virtual paths.
+ // base::FilePath::BaseName will get confused by ':' on Windows when it looks like a
// drive letter separator; this will treat it as just another character.
- static FilePath BaseName(const FilePath& virtual_path);
+ static base::FilePath BaseName(const base::FilePath& virtual_path);
- // Likewise, use this instead of FilePath::GetComponents when operating on
+ // Likewise, use this instead of base::FilePath::GetComponents when operating on
// virtual paths.
// Note that this assumes very clean input, with no leading slash, and it will
// not evaluate '.' or '..' components.
- static void GetComponents(const FilePath& path,
- std::vector<FilePath::StringType>* components);
+ static void GetComponents(const base::FilePath& path,
+ std::vector<base::FilePath::StringType>* components);
};
// Returns the root URI of the filesystem that can be specified by a pair of
@@ -99,10 +99,10 @@ WEBKIT_STORAGE_EXPORT std::string GetFileSystemTypeString(FileSystemType type);
//
// TODO(tzik): Replace CreateFilePath and FilePathToString in
// third_party/leveldatabase/env_chromium.cc with them.
-WEBKIT_STORAGE_EXPORT std::string FilePathToString(const FilePath& file_path);
+WEBKIT_STORAGE_EXPORT std::string FilePathToString(const base::FilePath& file_path);
// Decode a file path from |file_path_string|.
-WEBKIT_STORAGE_EXPORT FilePath StringToFilePath(
+WEBKIT_STORAGE_EXPORT base::FilePath StringToFilePath(
const std::string& file_path_string);
// File error conversion
diff --git a/webkit/fileapi/file_system_util_unittest.cc b/webkit/fileapi/file_system_util_unittest.cc
index 946e75f..0fd4f0a 100644
--- a/webkit/fileapi/file_system_util_unittest.cc
+++ b/webkit/fileapi/file_system_util_unittest.cc
@@ -30,8 +30,8 @@ TEST_F(FileSystemUtilTest, GetPersistentFileSystemRootURI) {
TEST_F(FileSystemUtilTest, VirtualPathBaseName) {
struct test_data {
- const FilePath::StringType path;
- const FilePath::StringType base_name;
+ const base::FilePath::StringType path;
+ const base::FilePath::StringType base_name;
} test_cases[] = {
{ FILE_PATH_LITERAL("foo/bar"), FILE_PATH_LITERAL("bar") },
{ FILE_PATH_LITERAL("foo/b:bar"), FILE_PATH_LITERAL("b:bar") },
@@ -48,17 +48,17 @@ TEST_F(FileSystemUtilTest, VirtualPathBaseName) {
{ FILE_PATH_LITERAL("bar"), FILE_PATH_LITERAL("bar") }
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
- FilePath input = FilePath(test_cases[i].path);
- FilePath base_name = VirtualPath::BaseName(input);
+ base::FilePath input = base::FilePath(test_cases[i].path);
+ base::FilePath base_name = VirtualPath::BaseName(input);
EXPECT_EQ(test_cases[i].base_name, base_name.value());
}
}
TEST_F(FileSystemUtilTest, VirtualPathGetComponents) {
struct test_data {
- const FilePath::StringType path;
+ const base::FilePath::StringType path;
size_t count;
- const FilePath::StringType components[3];
+ const base::FilePath::StringType components[3];
} test_cases[] = {
{ FILE_PATH_LITERAL("foo/bar"),
2,
@@ -83,8 +83,8 @@ TEST_F(FileSystemUtilTest, VirtualPathGetComponents) {
{ FILE_PATH_LITERAL("foo"), FILE_PATH_LITERAL("bar") } },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
- FilePath input = FilePath(test_cases[i].path);
- std::vector<FilePath::StringType> components;
+ base::FilePath input = base::FilePath(test_cases[i].path);
+ std::vector<base::FilePath::StringType> components;
VirtualPath::GetComponents(input, &components);
EXPECT_EQ(test_cases[i].count, components.size());
for (size_t j = 0; j < components.size(); ++j)
diff --git a/webkit/fileapi/file_util_helper.cc b/webkit/fileapi/file_util_helper.cc
index 2582f8a..49ea72c 100644
--- a/webkit/fileapi/file_util_helper.cc
+++ b/webkit/fileapi/file_util_helper.cc
@@ -21,20 +21,20 @@ namespace {
// A helper class to delete a temporary file.
class ScopedFileDeleter {
public:
- explicit ScopedFileDeleter(const FilePath& path) : path_(path) {}
+ explicit ScopedFileDeleter(const base::FilePath& path) : path_(path) {}
~ScopedFileDeleter() {
file_util::Delete(path_, false /* recursive */);
}
private:
- FilePath path_;
+ base::FilePath path_;
};
bool IsInRoot(const FileSystemURL& url) {
// If path is in the root, path.DirName() will be ".",
// since we use paths with no leading '/'.
- FilePath parent = url.path().DirName();
- return parent.empty() || parent == FilePath(FILE_PATH_LITERAL("."));
+ base::FilePath parent = url.path().DirName();
+ return parent.empty() || parent == base::FilePath(FILE_PATH_LITERAL("."));
}
// A helper class for cross-FileUtil Copy/Move operations.
@@ -160,7 +160,7 @@ PlatformFileError CrossFileUtilHelper::CopyOrMoveDirectory(
// Store modified timestamp of the root directory.
if (operation_ == OPERATION_MOVE) {
base::PlatformFileInfo file_info;
- FilePath platform_file_path;
+ base::FilePath platform_file_path;
error = src_util_->GetFileInfo(
context_, src_url, &file_info, &platform_file_path);
if (error != base::PLATFORM_FILE_OK)
@@ -173,9 +173,9 @@ PlatformFileError CrossFileUtilHelper::CopyOrMoveDirectory(
src_util_->CreateFileEnumerator(context_,
src_url,
true /* recursive */));
- FilePath src_file_path_each;
+ base::FilePath src_file_path_each;
while (!(src_file_path_each = file_enum->Next()).empty()) {
- FilePath dest_file_path_each(dest_url.path());
+ base::FilePath dest_file_path_each(dest_url.path());
src_url.path().AppendRelativePath(
src_file_path_each, &dest_file_path_each);
@@ -229,7 +229,7 @@ PlatformFileError CrossFileUtilHelper::CopyOrMoveFile(
// Resolve the src_url's underlying file path.
base::PlatformFileInfo file_info;
- FilePath platform_file_path;
+ base::FilePath platform_file_path;
SnapshotFilePolicy snapshot_policy;
PlatformFileError error = src_util_->CreateSnapshotFile(
@@ -265,7 +265,7 @@ bool FileUtilHelper::DirectoryExists(FileSystemOperationContext* context,
return true;
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
PlatformFileError error = file_util->GetFileInfo(
context, url, &file_info, &platform_path);
return error == base::PLATFORM_FILE_OK && file_info.is_directory;
@@ -320,7 +320,7 @@ base::PlatformFileError FileUtilHelper::ReadDirectory(
DCHECK(entries);
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
PlatformFileError error = file_util->GetFileInfo(
context, url, &file_info, &platform_path);
if (error != base::PLATFORM_FILE_OK)
@@ -331,7 +331,7 @@ base::PlatformFileError FileUtilHelper::ReadDirectory(
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum(
file_util->CreateFileEnumerator(context, url, false /* recursive */));
- FilePath current;
+ base::FilePath current;
while (!(current = file_enum->Next()).empty()) {
base::FileUtilProxy::Entry entry;
entry.is_directory = file_enum->IsDirectory();
@@ -351,8 +351,8 @@ base::PlatformFileError FileUtilHelper::DeleteDirectoryRecursive(
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum(
file_util->CreateFileEnumerator(context, url, true /* recursive */));
- FilePath file_path_each;
- std::stack<FilePath> directories;
+ base::FilePath file_path_each;
+ std::stack<base::FilePath> directories;
while (!(file_path_each = file_enum->Next()).empty()) {
if (file_enum->IsDirectory()) {
directories.push(file_path_each);
diff --git a/webkit/fileapi/file_writer_delegate_unittest.cc b/webkit/fileapi/file_writer_delegate_unittest.cc
index 8a3fdf8..fa40da0 100644
--- a/webkit/fileapi/file_writer_delegate_unittest.cc
+++ b/webkit/fileapi/file_writer_delegate_unittest.cc
@@ -197,7 +197,7 @@ net::URLRequestJob* FileWriterDelegateTest::Factory(
void FileWriterDelegateTest::SetUp() {
ASSERT_TRUE(dir_.CreateUniqueTempDir());
- FilePath base_dir = dir_.path().AppendASCII("filesystem");
+ base::FilePath base_dir = dir_.path().AppendASCII("filesystem");
test_helper_.SetUp(base_dir);
scoped_ptr<FileSystemOperationContext> context(
diff --git a/webkit/fileapi/isolated_context.cc b/webkit/fileapi/isolated_context.cc
index fe1aec0..12232ce 100644
--- a/webkit/fileapi/isolated_context.cc
+++ b/webkit/fileapi/isolated_context.cc
@@ -18,15 +18,15 @@ namespace fileapi {
namespace {
-FilePath::StringType GetRegisterNameForPath(const FilePath& path) {
+base::FilePath::StringType GetRegisterNameForPath(const base::FilePath& path) {
// If it's not a root path simply return a base name.
if (path.DirName() != path)
return path.BaseName().value();
#if defined(FILE_PATH_USES_DRIVE_LETTERS)
- FilePath::StringType name;
+ base::FilePath::StringType name;
for (size_t i = 0;
- i < path.value().size() && !FilePath::IsSeparator(path.value()[i]);
+ i < path.value().size() && !base::FilePath::IsSeparator(path.value()[i]);
++i) {
if (path.value()[i] == L':') {
name.append(L"_drive");
@@ -67,19 +67,19 @@ IsolatedContext::FileInfoSet::FileInfoSet() {}
IsolatedContext::FileInfoSet::~FileInfoSet() {}
bool IsolatedContext::FileInfoSet::AddPath(
- const FilePath& path, std::string* registered_name) {
+ const base::FilePath& path, std::string* registered_name) {
// The given path should not contain any '..' and should be absolute.
if (path.ReferencesParent() || !path.IsAbsolute())
return false;
- FilePath::StringType name = GetRegisterNameForPath(path);
- std::string utf8name = FilePath(name).AsUTF8Unsafe();
- FilePath normalized_path = path.NormalizePathSeparators();
+ base::FilePath::StringType name = GetRegisterNameForPath(path);
+ std::string utf8name = base::FilePath(name).AsUTF8Unsafe();
+ base::FilePath normalized_path = path.NormalizePathSeparators();
bool inserted =
fileset_.insert(MountPointInfo(utf8name, normalized_path)).second;
if (!inserted) {
int suffix = 1;
- std::string basepart = FilePath(name).RemoveExtension().AsUTF8Unsafe();
- std::string ext = FilePath(FilePath(name).Extension()).AsUTF8Unsafe();
+ std::string basepart = base::FilePath(name).RemoveExtension().AsUTF8Unsafe();
+ std::string ext = base::FilePath(base::FilePath(name).Extension()).AsUTF8Unsafe();
while (!inserted) {
utf8name = base::StringPrintf("%s (%d)", basepart.c_str(), suffix++);
if (!ext.empty())
@@ -94,7 +94,7 @@ bool IsolatedContext::FileInfoSet::AddPath(
}
bool IsolatedContext::FileInfoSet::AddPathWithName(
- const FilePath& path, const std::string& name) {
+ const base::FilePath& path, const std::string& name) {
// The given path should not contain any '..' and should be absolute.
if (path.ReferencesParent() || !path.IsAbsolute())
return false;
@@ -126,7 +126,7 @@ class IsolatedContext::Instance {
void AddRef() { ++ref_counts_; }
void RemoveRef() { --ref_counts_; }
- bool ResolvePathForName(const std::string& name, FilePath* path) const;
+ bool ResolvePathForName(const std::string& name, base::FilePath* path) const;
// Returns true if the instance is a single-path instance.
bool IsSinglePathInstance() const;
@@ -166,13 +166,13 @@ IsolatedContext::Instance::Instance(FileSystemType type,
IsolatedContext::Instance::~Instance() {}
bool IsolatedContext::Instance::ResolvePathForName(const std::string& name,
- FilePath* path) const {
+ base::FilePath* path) const {
if (IsSinglePathIsolatedFileSystem(type_)) {
*path = file_info_.path;
return file_info_.name == name;
}
std::set<MountPointInfo>::const_iterator found = files_.find(
- MountPointInfo(name, FilePath()));
+ MountPointInfo(name, base::FilePath()));
if (found == files_.end())
return false;
*path = found->path;
@@ -206,15 +206,15 @@ std::string IsolatedContext::RegisterDraggedFileSystem(
std::string IsolatedContext::RegisterFileSystemForPath(
FileSystemType type,
- const FilePath& path_in,
+ const base::FilePath& path_in,
std::string* register_name) {
- FilePath path(path_in.NormalizePathSeparators());
+ base::FilePath path(path_in.NormalizePathSeparators());
DCHECK(!path.ReferencesParent() && path.IsAbsolute());
std::string name;
if (register_name && !register_name->empty()) {
name = *register_name;
} else {
- name = FilePath(GetRegisterNameForPath(path)).AsUTF8Unsafe();
+ name = base::FilePath(GetRegisterNameForPath(path)).AsUTF8Unsafe();
if (register_name)
register_name->assign(name);
}
@@ -236,7 +236,7 @@ bool IsolatedContext::RevokeFileSystem(const std::string& filesystem_id) {
}
bool IsolatedContext::GetRegisteredPath(
- const std::string& filesystem_id, FilePath* path) const {
+ const std::string& filesystem_id, base::FilePath* path) const {
DCHECK(path);
base::AutoLock locker(lock_);
IDToInstance::const_iterator found = instance_map_.find(filesystem_id);
@@ -246,10 +246,10 @@ bool IsolatedContext::GetRegisteredPath(
return true;
}
-bool IsolatedContext::CrackVirtualPath(const FilePath& virtual_path,
+bool IsolatedContext::CrackVirtualPath(const base::FilePath& virtual_path,
std::string* id_or_name,
FileSystemType* type,
- FilePath* path) const {
+ base::FilePath* path) const {
DCHECK(id_or_name);
DCHECK(path);
@@ -258,17 +258,17 @@ bool IsolatedContext::CrackVirtualPath(const FilePath& virtual_path,
return false;
// The virtual_path should comprise <id_or_name> and <relative_path> parts.
- std::vector<FilePath::StringType> components;
+ std::vector<base::FilePath::StringType> components;
virtual_path.GetComponents(&components);
if (components.size() < 1)
return false;
- std::vector<FilePath::StringType>::iterator component_iter =
+ std::vector<base::FilePath::StringType>::iterator component_iter =
components.begin();
- std::string fsid = FilePath(*component_iter++).MaybeAsASCII();
+ std::string fsid = base::FilePath(*component_iter++).MaybeAsASCII();
if (fsid.empty())
return false;
- FilePath cracked_path;
+ base::FilePath cracked_path;
{
base::AutoLock locker(lock_);
IDToInstance::const_iterator found_instance = instance_map_.find(fsid);
@@ -286,7 +286,7 @@ bool IsolatedContext::CrackVirtualPath(const FilePath& virtual_path,
}
// *component_iter should be a name of the registered path.
- std::string name = FilePath(*component_iter++).AsUTF8Unsafe();
+ std::string name = base::FilePath(*component_iter++).AsUTF8Unsafe();
if (!instance->ResolvePathForName(name, &cracked_path))
return false;
}
@@ -309,13 +309,13 @@ FileSystemURL IsolatedContext::CrackURL(const GURL& url) const {
FileSystemURL IsolatedContext::CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
- const FilePath& path) const {
+ const base::FilePath& path) const {
if (!HandlesFileSystemMountType(type))
return FileSystemURL();
std::string mount_name;
FileSystemType cracked_type;
- FilePath cracked_path;
+ base::FilePath cracked_path;
if (!CrackVirtualPath(path, &mount_name, &cracked_type, &cracked_path))
return FileSystemURL();
@@ -323,9 +323,9 @@ FileSystemURL IsolatedContext::CreateCrackedFileSystemURL(
mount_name, cracked_type, cracked_path);
}
-void IsolatedContext::RevokeFileSystemByPath(const FilePath& path_in) {
+void IsolatedContext::RevokeFileSystemByPath(const base::FilePath& path_in) {
base::AutoLock locker(lock_);
- FilePath path(path_in.NormalizePathSeparators());
+ base::FilePath path(path_in.NormalizePathSeparators());
PathToID::iterator ids_iter = path_to_id_map_.find(path);
if (ids_iter == path_to_id_map_.end())
return;
@@ -377,9 +377,9 @@ bool IsolatedContext::GetDraggedFileInfo(
return true;
}
-FilePath IsolatedContext::CreateVirtualRootPath(
+base::FilePath IsolatedContext::CreateVirtualRootPath(
const std::string& filesystem_id) const {
- return FilePath().AppendASCII(filesystem_id);
+ return base::FilePath().AppendASCII(filesystem_id);
}
IsolatedContext::IsolatedContext() {
diff --git a/webkit/fileapi/isolated_context.h b/webkit/fileapi/isolated_context.h
index d679bc3..faf034c 100644
--- a/webkit/fileapi/isolated_context.h
+++ b/webkit/fileapi/isolated_context.h
@@ -48,12 +48,12 @@ class WEBKIT_STORAGE_EXPORT IsolatedContext : public MountPoints {
// the registered name assigned for the path. |path| needs to be
// absolute and should not contain parent references.
// Return false if the |path| is not valid and could not be added.
- bool AddPath(const FilePath& path, std::string* registered_name);
+ bool AddPath(const base::FilePath& path, std::string* registered_name);
// Add the given |path| with the |name|.
// Return false if the |name| is already registered in the set or
// is not valid and could not be added.
- bool AddPathWithName(const FilePath& path, const std::string& name);
+ bool AddPathWithName(const base::FilePath& path, const std::string& name);
const std::set<MountPointInfo>& fileset() const { return fileset_; }
@@ -99,7 +99,7 @@ class WEBKIT_STORAGE_EXPORT IsolatedContext : public MountPoints {
// registered as the given |register_name|, otherwise it is populated
// with the name internally assigned to the path.
std::string RegisterFileSystemForPath(FileSystemType type,
- const FilePath& path,
+ const base::FilePath& path,
std::string* register_name);
// Revokes all filesystem(s) registered for the given path.
@@ -110,7 +110,7 @@ class WEBKIT_STORAGE_EXPORT IsolatedContext : public MountPoints {
// It is ok to call this for the path that has no associated filesystems.
// Note that this only works for the filesystems registered by
// |RegisterFileSystemForPath|.
- void RevokeFileSystemByPath(const FilePath& path);
+ void RevokeFileSystemByPath(const base::FilePath& path);
// Adds a reference to a filesystem specified by the given filesystem_id.
void AddReference(const std::string& filesystem_id);
@@ -133,19 +133,19 @@ class WEBKIT_STORAGE_EXPORT IsolatedContext : public MountPoints {
virtual bool HandlesFileSystemMountType(FileSystemType type) const OVERRIDE;
virtual bool RevokeFileSystem(const std::string& filesystem_id) OVERRIDE;
virtual bool GetRegisteredPath(const std::string& filesystem_id,
- FilePath* path) const OVERRIDE;
- virtual bool CrackVirtualPath(const FilePath& virtual_path,
+ base::FilePath* path) const OVERRIDE;
+ virtual bool CrackVirtualPath(const base::FilePath& virtual_path,
std::string* filesystem_id,
FileSystemType* type,
- FilePath* path) const OVERRIDE;
+ base::FilePath* path) const OVERRIDE;
virtual FileSystemURL CrackURL(const GURL& url) const OVERRIDE;
virtual FileSystemURL CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
- const FilePath& path) const OVERRIDE;
+ const base::FilePath& path) const OVERRIDE;
// Returns the virtual root path that looks like /<filesystem_id>.
- FilePath CreateVirtualRootPath(const std::string& filesystem_id) const;
+ base::FilePath CreateVirtualRootPath(const std::string& filesystem_id) const;
private:
friend struct base::DefaultLazyInstanceTraits<IsolatedContext>;
@@ -156,7 +156,7 @@ class WEBKIT_STORAGE_EXPORT IsolatedContext : public MountPoints {
typedef std::map<std::string, Instance*> IDToInstance;
// Reverse map from registered path to IDs.
- typedef std::map<FilePath, std::set<std::string> > PathToID;
+ typedef std::map<base::FilePath, std::set<std::string> > PathToID;
// Obtain an instance of this class via GetInstance().
IsolatedContext();
diff --git a/webkit/fileapi/isolated_context_unittest.cc b/webkit/fileapi/isolated_context_unittest.cc
index 4cb7a84..c2c9537 100644
--- a/webkit/fileapi/isolated_context_unittest.cc
+++ b/webkit/fileapi/isolated_context_unittest.cc
@@ -24,19 +24,19 @@ typedef IsolatedContext::MountPointInfo FileInfo;
namespace {
-const FilePath kTestPaths[] = {
- FilePath(DRIVE FPL("/a/b.txt")),
- FilePath(DRIVE FPL("/c/d/e")),
- FilePath(DRIVE FPL("/h/")),
- FilePath(DRIVE FPL("/")),
+const base::FilePath kTestPaths[] = {
+ base::FilePath(DRIVE FPL("/a/b.txt")),
+ base::FilePath(DRIVE FPL("/c/d/e")),
+ base::FilePath(DRIVE FPL("/h/")),
+ base::FilePath(DRIVE FPL("/")),
#if defined(FILE_PATH_USES_WIN_SEPARATORS)
- FilePath(DRIVE FPL("\\foo\\bar")),
- FilePath(DRIVE FPL("\\")),
+ base::FilePath(DRIVE FPL("\\foo\\bar")),
+ base::FilePath(DRIVE FPL("\\")),
#endif
// For duplicated base name test.
- FilePath(DRIVE FPL("/")),
- FilePath(DRIVE FPL("/f/e")),
- FilePath(DRIVE FPL("/f/b.txt")),
+ base::FilePath(DRIVE FPL("/")),
+ base::FilePath(DRIVE FPL("/f/e")),
+ base::FilePath(DRIVE FPL("/f/b.txt")),
};
} // namespace
@@ -71,7 +71,7 @@ class IsolatedContextTest : public testing::Test {
protected:
std::string id_;
- std::multiset<FilePath> fileset_;
+ std::multiset<base::FilePath> fileset_;
std::vector<std::string> names_;
private:
@@ -91,10 +91,10 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
// register in SetUp() by RegisterDraggedFileSystem) is properly cracked as
// a valid virtual path in the isolated filesystem.
for (size_t i = 0; i < arraysize(kTestPaths); ++i) {
- FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
+ base::FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
.AppendASCII(names_[i]);
std::string cracked_id;
- FilePath cracked_path;
+ base::FilePath cracked_path;
FileSystemType cracked_type;
ASSERT_TRUE(isolated_context()->CrackVirtualPath(
virtual_path, &cracked_id, &cracked_type, &cracked_path));
@@ -106,14 +106,14 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
// Make sure GetRegisteredPath returns false for id_ since it is
// registered for dragged files.
- FilePath path;
+ base::FilePath path;
ASSERT_FALSE(isolated_context()->GetRegisteredPath(id_, &path));
// Deref the current one and registering a new one.
isolated_context()->RemoveReference(id_);
std::string id2 = isolated_context()->RegisterFileSystemForPath(
- kFileSystemTypeNativeLocal, FilePath(DRIVE FPL("/foo")), NULL);
+ kFileSystemTypeNativeLocal, base::FilePath(DRIVE FPL("/foo")), NULL);
// Make sure the GetDraggedFileInfo returns false for both ones.
ASSERT_FALSE(isolated_context()->GetDraggedFileInfo(id2, &toplevels));
@@ -165,7 +165,7 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
TEST_F(IsolatedContextTest, CrackWithRelativePaths) {
const struct {
- FilePath::StringType path;
+ base::FilePath::StringType path;
bool valid;
} relatives[] = {
{ FPL("foo"), true },
@@ -186,10 +186,10 @@ TEST_F(IsolatedContextTest, CrackWithRelativePaths) {
for (size_t j = 0; j < ARRAYSIZE_UNSAFE(relatives); ++j) {
SCOPED_TRACE(testing::Message() << "Testing "
<< kTestPaths[i].value() << " " << relatives[j].path);
- FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
+ base::FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
.AppendASCII(names_[i]).Append(relatives[j].path);
std::string cracked_id;
- FilePath cracked_path;
+ base::FilePath cracked_path;
FileSystemType cracked_type;
if (!relatives[j].valid) {
ASSERT_FALSE(isolated_context()->CrackVirtualPath(
@@ -209,7 +209,7 @@ TEST_F(IsolatedContextTest, CrackWithRelativePaths) {
TEST_F(IsolatedContextTest, CrackURLWithRelativePaths) {
const struct {
- FilePath::StringType path;
+ base::FilePath::StringType path;
bool valid;
} relatives[] = {
{ FPL("foo"), true },
@@ -230,7 +230,7 @@ TEST_F(IsolatedContextTest, CrackURLWithRelativePaths) {
for (size_t j = 0; j < ARRAYSIZE_UNSAFE(relatives); ++j) {
SCOPED_TRACE(testing::Message() << "Testing "
<< kTestPaths[i].value() << " " << relatives[j].path);
- FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
+ base::FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
.AppendASCII(names_[i]).Append(relatives[j].path);
FileSystemURL cracked = isolated_context()->CreateCrackedFileSystemURL(
@@ -254,12 +254,12 @@ TEST_F(IsolatedContextTest, CrackURLWithRelativePaths) {
TEST_F(IsolatedContextTest, TestWithVirtualRoot) {
std::string cracked_id;
- FilePath cracked_path;
+ base::FilePath cracked_path;
// Trying to crack virtual root "/" returns true but with empty cracked path
// as "/" of the isolated filesystem is a pure virtual directory
// that has no corresponding platform directory.
- FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_);
+ base::FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_);
ASSERT_TRUE(isolated_context()->CrackVirtualPath(
virtual_path, &cracked_id, NULL, &cracked_path));
ASSERT_EQ(FPL(""), cracked_path.value());
@@ -275,7 +275,7 @@ TEST_F(IsolatedContextTest, TestWithVirtualRoot) {
TEST_F(IsolatedContextTest, CanHandleURL) {
const GURL test_origin("http://chromium.org");
- const FilePath test_path(FPL("/mount"));
+ const base::FilePath test_path(FPL("/mount"));
// Should handle isolated file system.
EXPECT_TRUE(isolated_context()->HandlesFileSystemMountType(
diff --git a/webkit/fileapi/isolated_file_util.cc b/webkit/fileapi/isolated_file_util.cc
index efe485e..66abe55 100644
--- a/webkit/fileapi/isolated_file_util.cc
+++ b/webkit/fileapi/isolated_file_util.cc
@@ -34,10 +34,10 @@ class SetFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
virtual ~SetFileEnumerator() {}
// AbstractFileEnumerator overrides.
- virtual FilePath Next() OVERRIDE {
+ virtual base::FilePath Next() OVERRIDE {
if (file_iter_ == files_.end())
- return FilePath();
- FilePath platform_file = (file_iter_++)->path;
+ return base::FilePath();
+ base::FilePath platform_file = (file_iter_++)->path;
NativeFileUtil::GetFileInfo(platform_file, &file_info_);
return platform_file;
}
@@ -65,7 +65,7 @@ class RecursiveSetFileEnumerator
virtual ~RecursiveSetFileEnumerator() {}
// AbstractFileEnumerator overrides.
- virtual FilePath Next() OVERRIDE;
+ virtual base::FilePath Next() OVERRIDE;
virtual int64 Size() OVERRIDE {
DCHECK(current_enumerator_.get());
return current_enumerator_->Size();
@@ -85,16 +85,16 @@ class RecursiveSetFileEnumerator
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> current_enumerator_;
};
-FilePath RecursiveSetFileEnumerator::Next() {
+base::FilePath RecursiveSetFileEnumerator::Next() {
if (current_enumerator_.get()) {
- FilePath path = current_enumerator_->Next();
+ base::FilePath path = current_enumerator_->Next();
if (!path.empty())
return path;
}
// We reached the end.
if (file_iter_ == files_.end())
- return FilePath();
+ return base::FilePath();
// Enumerates subdirectories of the next path.
FileInfo& next_file = *file_iter_++;
@@ -113,7 +113,7 @@ IsolatedFileUtil::IsolatedFileUtil() {}
PlatformFileError IsolatedFileUtil::GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& url,
- FilePath* local_file_path) {
+ base::FilePath* local_file_path) {
DCHECK(local_file_path);
DCHECK(url.is_valid());
if (url.path().empty()) {
@@ -132,7 +132,7 @@ PlatformFileError DraggedFileUtil::GetFileInfo(
FileSystemOperationContext* context,
const FileSystemURL& url,
PlatformFileInfo* file_info,
- FilePath* platform_path) {
+ base::FilePath* platform_path) {
DCHECK(file_info);
std::string filesystem_id;
DCHECK(url.is_valid());
@@ -149,7 +149,7 @@ PlatformFileError DraggedFileUtil::GetFileInfo(
}
base::PlatformFileError error =
NativeFileUtil::GetFileInfo(url.path(), file_info);
- if (file_util::IsLink(url.path()) && !FilePath().IsParent(url.path())) {
+ if (file_util::IsLink(url.path()) && !base::FilePath().IsParent(url.path())) {
// Don't follow symlinks unless it's the one that are selected by the user.
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
}
diff --git a/webkit/fileapi/isolated_file_util.h b/webkit/fileapi/isolated_file_util.h
index e2f65ee..9f3ae90 100644
--- a/webkit/fileapi/isolated_file_util.h
+++ b/webkit/fileapi/isolated_file_util.h
@@ -22,7 +22,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE IsolatedFileUtil : public LocalFileUtil {
virtual base::PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path) OVERRIDE;
+ base::FilePath* local_file_path) OVERRIDE;
};
// Dragged file system is a specialized IsolatedFileUtil where read access to
@@ -38,7 +38,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DraggedFileUtil : public IsolatedFileUtil {
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path) OVERRIDE;
+ base::FilePath* platform_path) OVERRIDE;
virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator(
FileSystemOperationContext* context,
const FileSystemURL& root_url,
diff --git a/webkit/fileapi/isolated_file_util_unittest.cc b/webkit/fileapi/isolated_file_util_unittest.cc
index 06c1a34..4652372 100644
--- a/webkit/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/fileapi/isolated_file_util_unittest.cc
@@ -39,16 +39,16 @@ namespace {
// Random root paths in which we create each file/directory of the
// RegularTestCases (so that we can simulate a drop with files/directories
// from multiple directories).
-static const FilePath::CharType* kRootPaths[] = {
+static const base::FilePath::CharType* kRootPaths[] = {
FILE_PATH_LITERAL("a"),
FILE_PATH_LITERAL("b/c"),
FILE_PATH_LITERAL("etc"),
};
-FilePath GetTopLevelPath(const FilePath& path) {
- std::vector<FilePath::StringType> components;
+base::FilePath GetTopLevelPath(const base::FilePath& path) {
+ std::vector<base::FilePath::StringType> components;
path.GetComponents(&components);
- return FilePath(components[0]);
+ return base::FilePath(components[0]);
}
bool IsDirectoryEmpty(FileSystemOperationContext* context,
@@ -100,7 +100,7 @@ class IsolatedFileUtilTest : public testing::Test {
IsolatedContext* isolated_context() const {
return IsolatedContext::GetInstance();
}
- const FilePath& root_path() const {
+ const base::FilePath& root_path() const {
return data_dir_.path();
}
FileSystemContext* file_system_context() const {
@@ -112,20 +112,20 @@ class IsolatedFileUtilTest : public testing::Test {
}
std::string filesystem_id() const { return filesystem_id_; }
- FilePath GetTestCasePlatformPath(const FilePath::StringType& path) {
- return toplevel_root_map_[GetTopLevelPath(FilePath(path))].Append(path).
+ base::FilePath GetTestCasePlatformPath(const base::FilePath::StringType& path) {
+ return toplevel_root_map_[GetTopLevelPath(base::FilePath(path))].Append(path).
NormalizePathSeparators();
}
- FilePath GetTestCaseLocalPath(const FilePath& path) {
- FilePath relative;
+ base::FilePath GetTestCaseLocalPath(const base::FilePath& path) {
+ base::FilePath relative;
if (data_dir_.path().AppendRelativePath(path, &relative))
return relative;
return path;
}
- FileSystemURL GetFileSystemURL(const FilePath& path) const {
- FilePath virtual_path = isolated_context()->CreateVirtualRootPath(
+ FileSystemURL GetFileSystemURL(const base::FilePath& path) const {
+ base::FilePath virtual_path = isolated_context()->CreateVirtualRootPath(
filesystem_id()).Append(path);
return file_system_context_->CreateCrackedFileSystemURL(
GURL("http://example.com"),
@@ -133,7 +133,7 @@ class IsolatedFileUtilTest : public testing::Test {
virtual_path);
}
- FileSystemURL GetOtherFileSystemURL(const FilePath& path) {
+ FileSystemURL GetOtherFileSystemURL(const base::FilePath& path) {
return other_file_util_helper_.CreateURL(GetTestCaseLocalPath(path));
}
@@ -145,7 +145,7 @@ class IsolatedFileUtilTest : public testing::Test {
// Get the file info for url1.
base::PlatformFileInfo info1;
- FilePath platform_path1;
+ base::FilePath platform_path1;
context.reset(new FileSystemOperationContext(file_system_context()));
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util1->GetFileInfo(context.get(), url1,
@@ -153,7 +153,7 @@ class IsolatedFileUtilTest : public testing::Test {
// Get the file info for url2.
base::PlatformFileInfo info2;
- FilePath platform_path2;
+ base::FilePath platform_path2;
context.reset(new FileSystemOperationContext(file_system_context()));
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util2->GetFileInfo(context.get(), url2,
@@ -176,20 +176,20 @@ class IsolatedFileUtilTest : public testing::Test {
const FileSystemURL& root1,
const FileSystemURL& root2) {
scoped_ptr<FileSystemOperationContext> context;
- FilePath root_path1 = root1.path();
- FilePath root_path2 = root2.path();
+ base::FilePath root_path1 = root1.path();
+ base::FilePath root_path2 = root2.path();
context.reset(new FileSystemOperationContext(file_system_context()));
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum1 =
file_util1->CreateFileEnumerator(context.get(), root1,
true /* recursive */);
- FilePath current;
- std::set<FilePath> file_set1;
+ base::FilePath current;
+ std::set<base::FilePath> file_set1;
while (!(current = file_enum1->Next()).empty()) {
if (file_enum1->IsDirectory())
continue;
- FilePath relative;
+ base::FilePath relative;
root_path1.AppendRelativePath(current, &relative);
file_set1.insert(relative);
}
@@ -200,7 +200,7 @@ class IsolatedFileUtilTest : public testing::Test {
true /* recursive */);
while (!(current = file_enum2->Next()).empty()) {
- FilePath relative;
+ base::FilePath relative;
root_path2.AppendRelativePath(current, &relative);
FileSystemURL url1 = root1.WithPath(root_path1.Append(relative));
FileSystemURL url2 = root2.WithPath(root_path2.Append(relative));
@@ -229,13 +229,13 @@ class IsolatedFileUtilTest : public testing::Test {
IsolatedContext::FileInfoSet toplevels;
for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) {
const test::TestCaseRecord& test_case = test::kRegularTestCases[i];
- FilePath path(test_case.path);
- FilePath toplevel = GetTopLevelPath(path);
+ base::FilePath path(test_case.path);
+ base::FilePath toplevel = GetTopLevelPath(path);
// We create the test case files under one of the kRootPaths
// to simulate a drop with multiple directories.
if (toplevel_root_map_.find(toplevel) == toplevel_root_map_.end()) {
- FilePath root = root_path().Append(
+ base::FilePath root = root_path().Append(
kRootPaths[(root_path_index++) % arraysize(kRootPaths)]);
toplevel_root_map_[toplevel] = root;
toplevels.AddPath(root.Append(path), NULL);
@@ -253,7 +253,7 @@ class IsolatedFileUtilTest : public testing::Test {
MessageLoop message_loop_;
std::string filesystem_id_;
scoped_refptr<FileSystemContext> file_system_context_;
- std::map<FilePath, FilePath> toplevel_root_map_;
+ std::map<base::FilePath, base::FilePath> toplevel_root_map_;
scoped_ptr<IsolatedFileUtil> file_util_;
LocalFileSystemTestOriginHelper other_file_util_helper_;
DISALLOW_COPY_AND_ASSIGN(IsolatedFileUtilTest);
@@ -264,13 +264,13 @@ TEST_F(IsolatedFileUtilTest, BasicTest) {
SCOPED_TRACE(testing::Message() << "Testing RegularTestCases " << i);
const test::TestCaseRecord& test_case = test::kRegularTestCases[i];
- FileSystemURL url = GetFileSystemURL(FilePath(test_case.path));
+ FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path));
// See if we can query the file info via the isolated FileUtil.
// (This should succeed since we have registered all the top-level
// entries of the test cases in SetUp())
base::PlatformFileInfo info;
- FilePath platform_path;
+ base::FilePath platform_path;
FileSystemOperationContext context(file_system_context());
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util()->GetFileInfo(&context, url, &info, &platform_path));
@@ -312,7 +312,7 @@ TEST_F(IsolatedFileUtilTest, UnregisteredPathsTest) {
for (size_t i = 0; i < arraysize(kUnregisteredCases); ++i) {
SCOPED_TRACE(testing::Message() << "Creating kUnregisteredCases " << i);
const test::TestCaseRecord& test_case = kUnregisteredCases[i];
- FileSystemURL url = GetFileSystemURL(FilePath(test_case.path));
+ FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path));
// We should not be able to get the valid URL for unregistered files.
ASSERT_FALSE(url.is_valid());
@@ -336,13 +336,13 @@ TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) {
<< ": " << test_case.path);
// Read entries in the directory to construct the expected results map.
- typedef std::map<FilePath::StringType, base::FileUtilProxy::Entry> EntryMap;
+ typedef std::map<base::FilePath::StringType, base::FileUtilProxy::Entry> EntryMap;
EntryMap expected_entry_map;
FileEnumerator file_enum(
GetTestCasePlatformPath(test_case.path), false /* not recursive */,
FileEnumerator::FILES | FileEnumerator::DIRECTORIES);
- FilePath current;
+ base::FilePath current;
while (!(current = file_enum.Next()).empty()) {
FileEnumerator::FindInfo file_info;
file_enum.GetFindInfo(&file_info);
@@ -355,7 +355,7 @@ TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) {
}
// Perform ReadDirectory in the isolated filesystem.
- FileSystemURL url = GetFileSystemURL(FilePath(test_case.path));
+ FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path));
std::vector<base::FileUtilProxy::Entry> entries;
FileSystemOperationContext context(file_system_context());
ASSERT_EQ(base::PLATFORM_FILE_OK,
@@ -379,11 +379,11 @@ TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) {
TEST_F(IsolatedFileUtilTest, GetLocalFilePathTest) {
for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) {
const test::TestCaseRecord& test_case = test::kRegularTestCases[i];
- FileSystemURL url = GetFileSystemURL(FilePath(test_case.path));
+ FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path));
FileSystemOperationContext context(file_system_context());
- FilePath local_file_path;
+ base::FilePath local_file_path;
EXPECT_EQ(base::PLATFORM_FILE_OK,
file_util()->GetLocalFilePath(&context, url, &local_file_path));
EXPECT_EQ(GetTestCasePlatformPath(test_case.path).value(),
@@ -394,12 +394,12 @@ TEST_F(IsolatedFileUtilTest, GetLocalFilePathTest) {
TEST_F(IsolatedFileUtilTest, CopyOutFileTest) {
scoped_ptr<FileSystemOperationContext> context(
new FileSystemOperationContext(file_system_context()));
- FileSystemURL root_url = GetFileSystemURL(FilePath());
+ FileSystemURL root_url = GetFileSystemURL(base::FilePath());
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum(
file_util()->CreateFileEnumerator(context.get(),
root_url,
true /* recursive */));
- FilePath current;
+ base::FilePath current;
while (!(current = file_enum->Next()).empty()) {
if (file_enum->IsDirectory())
continue;
@@ -434,12 +434,12 @@ TEST_F(IsolatedFileUtilTest, CopyOutFileTest) {
TEST_F(IsolatedFileUtilTest, CopyOutDirectoryTest) {
scoped_ptr<FileSystemOperationContext> context(
new FileSystemOperationContext(file_system_context()));
- FileSystemURL root_url = GetFileSystemURL(FilePath());
+ FileSystemURL root_url = GetFileSystemURL(base::FilePath());
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum(
file_util()->CreateFileEnumerator(context.get(),
root_url,
false /* recursive */));
- FilePath current;
+ base::FilePath current;
while (!(current = file_enum->Next()).empty()) {
if (!file_enum->IsDirectory())
continue;
@@ -477,7 +477,7 @@ TEST_F(IsolatedFileUtilTest, TouchTest) {
if (test_case.is_directory)
continue;
SCOPED_TRACE(testing::Message() << test_case.path);
- FileSystemURL url = GetFileSystemURL(FilePath(test_case.path));
+ FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path));
base::Time last_access_time = base::Time::FromTimeT(1000);
base::Time last_modified_time = base::Time::FromTimeT(2000);
@@ -489,7 +489,7 @@ TEST_F(IsolatedFileUtilTest, TouchTest) {
// Verification.
base::PlatformFileInfo info;
- FilePath platform_path;
+ base::FilePath platform_path;
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util()->GetFileInfo(GetOperationContext().get(), url,
&info, &platform_path));
@@ -505,11 +505,11 @@ TEST_F(IsolatedFileUtilTest, TruncateTest) {
continue;
SCOPED_TRACE(testing::Message() << test_case.path);
- FileSystemURL url = GetFileSystemURL(FilePath(test_case.path));
+ FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path));
// Truncate to 0.
base::PlatformFileInfo info;
- FilePath platform_path;
+ base::FilePath platform_path;
EXPECT_EQ(base::PLATFORM_FILE_OK,
file_util()->Truncate(GetOperationContext().get(), url, 0));
ASSERT_EQ(base::PLATFORM_FILE_OK,
diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc
index f21909c..160a71c 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -35,7 +35,7 @@
namespace fileapi {
IsolatedMountPointProvider::IsolatedMountPointProvider(
- const FilePath& profile_path)
+ const base::FilePath& profile_path)
: profile_path_(profile_path),
media_path_filter_(new MediaPathFilter()),
isolated_file_util_(new AsyncFileUtilAdapter(new IsolatedFileUtil())),
@@ -64,12 +64,12 @@ void IsolatedMountPointProvider::ValidateFileSystemRoot(
base::Bind(callback, base::PLATFORM_FILE_ERROR_SECURITY));
}
-FilePath IsolatedMountPointProvider::GetFileSystemRootPathOnFileThread(
+base::FilePath IsolatedMountPointProvider::GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) {
// This is not supposed to be used.
NOTREACHED();
- return FilePath();
+ return base::FilePath();
}
bool IsolatedMountPointProvider::IsAccessAllowed(const FileSystemURL& url) {
@@ -77,7 +77,7 @@ bool IsolatedMountPointProvider::IsAccessAllowed(const FileSystemURL& url) {
}
bool IsolatedMountPointProvider::IsRestrictedFileName(
- const FilePath& filename) const {
+ const base::FilePath& filename) const {
// TODO(kinuko): We need to check platform-specific restricted file names
// before we actually start allowing file creation in isolated file systems.
return false;
diff --git a/webkit/fileapi/isolated_mount_point_provider.h b/webkit/fileapi/isolated_mount_point_provider.h
index 5c89f11..64f82a6 100644
--- a/webkit/fileapi/isolated_mount_point_provider.h
+++ b/webkit/fileapi/isolated_mount_point_provider.h
@@ -17,7 +17,7 @@ class MediaPathFilter;
class IsolatedMountPointProvider : public FileSystemMountPointProvider {
public:
- explicit IsolatedMountPointProvider(const FilePath& profile_path);
+ explicit IsolatedMountPointProvider(const base::FilePath& profile_path);
virtual ~IsolatedMountPointProvider();
// FileSystemMountPointProvider implementation.
@@ -26,11 +26,11 @@ class IsolatedMountPointProvider : public FileSystemMountPointProvider {
FileSystemType type,
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
- virtual FilePath GetFileSystemRootPathOnFileThread(
+ virtual base::FilePath GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE;
- virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
+ virtual bool IsRestrictedFileName(const base::FilePath& filename) const OVERRIDE;
virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE;
virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE;
virtual FilePermissionPolicy GetPermissionPolicy(
@@ -58,7 +58,7 @@ class IsolatedMountPointProvider : public FileSystemMountPointProvider {
private:
// Store the profile path. We need this to create temporary snapshot files.
- const FilePath profile_path_;
+ const base::FilePath profile_path_;
scoped_ptr<MediaPathFilter> media_path_filter_;
diff --git a/webkit/fileapi/local_file_stream_writer.cc b/webkit/fileapi/local_file_stream_writer.cc
index f3679f9..e17784e 100644
--- a/webkit/fileapi/local_file_stream_writer.cc
+++ b/webkit/fileapi/local_file_stream_writer.cc
@@ -20,7 +20,7 @@ const int kOpenFlagsForWrite = base::PLATFORM_FILE_OPEN |
} // namespace
-LocalFileStreamWriter::LocalFileStreamWriter(const FilePath& file_path,
+LocalFileStreamWriter::LocalFileStreamWriter(const base::FilePath& file_path,
int64 initial_offset)
: file_path_(file_path),
initial_offset_(initial_offset),
diff --git a/webkit/fileapi/local_file_stream_writer.h b/webkit/fileapi/local_file_stream_writer.h
index e23b476..a6d15f9 100644
--- a/webkit/fileapi/local_file_stream_writer.h
+++ b/webkit/fileapi/local_file_stream_writer.h
@@ -28,7 +28,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileStreamWriter
public:
// Create a writer for the existing file in the path |file_path| starting from
// |initial_offset|.
- LocalFileStreamWriter(const FilePath& file_path, int64 initial_offset);
+ LocalFileStreamWriter(const base::FilePath& file_path, int64 initial_offset);
virtual ~LocalFileStreamWriter();
// FileStreamWriter overrides.
@@ -72,7 +72,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileStreamWriter
bool CancelIfRequested();
// Initialization parameters.
- const FilePath file_path_;
+ const base::FilePath file_path_;
const int64 initial_offset_;
// Current states of the operation.
diff --git a/webkit/fileapi/local_file_stream_writer_unittest.cc b/webkit/fileapi/local_file_stream_writer_unittest.cc
index 3fda6d6..d67a7da 100644
--- a/webkit/fileapi/local_file_stream_writer_unittest.cc
+++ b/webkit/fileapi/local_file_stream_writer_unittest.cc
@@ -29,7 +29,7 @@ class LocalFileStreamWriterTest : public testing::Test {
}
protected:
- FilePath Path(const std::string& name) {
+ base::FilePath Path(const std::string& name) {
return temp_dir_.path().AppendASCII(name);
}
@@ -52,15 +52,15 @@ class LocalFileStreamWriterTest : public testing::Test {
return net::OK;
}
- std::string GetFileContent(const FilePath& path) {
+ std::string GetFileContent(const base::FilePath& path) {
std::string content;
file_util::ReadFileToString(path, &content);
return content;
}
- FilePath CreateFileWithContent(const std::string& name,
+ base::FilePath CreateFileWithContent(const std::string& name,
const std::string& data) {
- FilePath path = Path(name);
+ base::FilePath path = Path(name);
file_util::WriteFile(path, data.c_str(), data.size());
return path;
}
@@ -77,7 +77,7 @@ void NeverCalled(int unused) {
} // namespace
TEST_F(LocalFileStreamWriterTest, Write) {
- FilePath path = CreateFileWithContent("file_a", "");
+ base::FilePath path = CreateFileWithContent("file_a", "");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo"));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "bar"));
@@ -88,7 +88,7 @@ TEST_F(LocalFileStreamWriterTest, Write) {
}
TEST_F(LocalFileStreamWriterTest, WriteMiddle) {
- FilePath path = CreateFileWithContent("file_a", "foobar");
+ base::FilePath path = CreateFileWithContent("file_a", "foobar");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 2));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "xxx"));
writer.reset();
@@ -98,7 +98,7 @@ TEST_F(LocalFileStreamWriterTest, WriteMiddle) {
}
TEST_F(LocalFileStreamWriterTest, WriteEnd) {
- FilePath path = CreateFileWithContent("file_a", "foobar");
+ base::FilePath path = CreateFileWithContent("file_a", "foobar");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 6));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "xxx"));
writer.reset();
@@ -108,7 +108,7 @@ TEST_F(LocalFileStreamWriterTest, WriteEnd) {
}
TEST_F(LocalFileStreamWriterTest, WriteFailForNonexistingFile) {
- FilePath path = Path("file_a");
+ base::FilePath path = Path("file_a");
ASSERT_FALSE(file_util::PathExists(path));
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
EXPECT_EQ(net::ERR_FILE_NOT_FOUND, WriteStringToWriter(writer.get(), "foo"));
@@ -118,7 +118,7 @@ TEST_F(LocalFileStreamWriterTest, WriteFailForNonexistingFile) {
}
TEST_F(LocalFileStreamWriterTest, CancelBeforeOperation) {
- FilePath path = Path("file_a");
+ base::FilePath path = Path("file_a");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
// Cancel immediately fails when there's no in-flight operation.
int cancel_result = writer->Cancel(base::Bind(&NeverCalled));
@@ -126,7 +126,7 @@ TEST_F(LocalFileStreamWriterTest, CancelBeforeOperation) {
}
TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) {
- FilePath path = CreateFileWithContent("file_a", "");
+ base::FilePath path = CreateFileWithContent("file_a", "");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo"));
@@ -142,7 +142,7 @@ TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) {
}
TEST_F(LocalFileStreamWriterTest, CancelWrite) {
- FilePath path = CreateFileWithContent("file_a", "foobar");
+ base::FilePath path = CreateFileWithContent("file_a", "foobar");
scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0));
scoped_refptr<net::StringIOBuffer> buffer(new net::StringIOBuffer("xxx"));
diff --git a/webkit/fileapi/local_file_system_operation.cc b/webkit/fileapi/local_file_system_operation.cc
index edf26b0..4cda1f8 100644
--- a/webkit/fileapi/local_file_system_operation.cc
+++ b/webkit/fileapi/local_file_system_operation.cc
@@ -193,7 +193,7 @@ void LocalFileSystemOperation::GetMetadata(
base::PlatformFileError result = SetUp(url, SETUP_FOR_READ);
if (result != base::PLATFORM_FILE_OK) {
- callback.Run(result, base::PlatformFileInfo(), FilePath());
+ callback.Run(result, base::PlatformFileInfo(), base::FilePath());
delete this;
return;
}
@@ -372,7 +372,7 @@ LocalFileSystemOperation::AsLocalFileSystemOperation() {
}
void LocalFileSystemOperation::SyncGetPlatformPath(const FileSystemURL& url,
- FilePath* platform_path) {
+ base::FilePath* platform_path) {
DCHECK(SetPendingOperationType(kOperationGetLocalPath));
base::PlatformFileError result = SetUp(url, SETUP_FOR_READ);
@@ -396,7 +396,7 @@ void LocalFileSystemOperation::CreateSnapshotFile(
base::PlatformFileError result = SetUp(url, SETUP_FOR_READ);
if (result != base::PLATFORM_FILE_OK) {
- callback.Run(result, base::PlatformFileInfo(), FilePath(), NULL);
+ callback.Run(result, base::PlatformFileInfo(), base::FilePath(), NULL);
delete this;
return;
}
@@ -408,7 +408,7 @@ void LocalFileSystemOperation::CreateSnapshotFile(
}
void LocalFileSystemOperation::CopyInForeignFile(
- const FilePath& src_local_disk_file_path,
+ const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
DCHECK(SetPendingOperationType(kOperationCopyInForeignFile));
@@ -666,7 +666,7 @@ void LocalFileSystemOperation::DoMoveFileLocal(
}
void LocalFileSystemOperation::DoCopyInForeignFile(
- const FilePath& src_local_disk_file_path,
+ const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback) {
async_file_util_->CopyInForeignFile(
@@ -737,7 +737,7 @@ void LocalFileSystemOperation::DidDirectoryExists(
const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused) {
+ const base::FilePath& unused) {
if (rv == base::PLATFORM_FILE_OK && !file_info.is_directory)
rv = base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
callback.Run(rv);
@@ -747,7 +747,7 @@ void LocalFileSystemOperation::DidFileExists(
const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused) {
+ const base::FilePath& unused) {
if (rv == base::PLATFORM_FILE_OK && file_info.is_directory)
rv = base::PLATFORM_FILE_ERROR_NOT_A_FILE;
callback.Run(rv);
@@ -757,7 +757,7 @@ void LocalFileSystemOperation::DidGetMetadata(
const GetMetadataCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
callback.Run(rv, file_info, platform_path);
}
@@ -812,7 +812,7 @@ void LocalFileSystemOperation::DidCreateSnapshotFile(
const SnapshotFileCallback& callback,
base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
SnapshotFilePolicy snapshot_policy) {
scoped_refptr<ShareableFileReference> file_ref;
if (result == base::PLATFORM_FILE_OK &&
diff --git a/webkit/fileapi/local_file_system_operation.h b/webkit/fileapi/local_file_system_operation.h
index cd828d8..73ee457 100644
--- a/webkit/fileapi/local_file_system_operation.h
+++ b/webkit/fileapi/local_file_system_operation.h
@@ -91,7 +91,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
// - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and
// its parent path is a file.
//
- void CopyInForeignFile(const FilePath& src_local_disk_path,
+ void CopyInForeignFile(const base::FilePath& src_local_disk_path,
const FileSystemURL& dest_url,
const StatusCallback& callback);
@@ -149,7 +149,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
const StatusCallback& callback);
// Synchronously gets the platform path for the given |url|.
- void SyncGetPlatformPath(const FileSystemURL& url, FilePath* platform_path);
+ void SyncGetPlatformPath(const FileSystemURL& url, base::FilePath* platform_path);
private:
class ScopedUpdateNotifier;
@@ -235,7 +235,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
void DoMoveFileLocal(const FileSystemURL& src,
const FileSystemURL& dest,
const StatusCallback& callback);
- void DoCopyInForeignFile(const FilePath& src_local_disk_file_path,
+ void DoCopyInForeignFile(const base::FilePath& src_local_disk_file_path,
const FileSystemURL& dest,
const StatusCallback& callback);
void DoTruncate(const FileSystemURL& url,
@@ -264,15 +264,15 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
void DidDirectoryExists(const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused);
+ const base::FilePath& unused);
void DidFileExists(const StatusCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& unused);
+ const base::FilePath& unused);
void DidGetMetadata(const GetMetadataCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
void DidReadDirectory(const ReadDirectoryCallback& callback,
base::PlatformFileError rv,
const std::vector<base::FileUtilProxy::Entry>& entries,
@@ -291,7 +291,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
const SnapshotFileCallback& callback,
base::PlatformFileError rv,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
SnapshotFilePolicy snapshot_policy);
// Checks the validity of a given |url| and populates |file_util| for |mode|.
diff --git a/webkit/fileapi/local_file_system_operation_unittest.cc b/webkit/fileapi/local_file_system_operation_unittest.cc
index c49e2b2..37b76a5 100644
--- a/webkit/fileapi/local_file_system_operation_unittest.cc
+++ b/webkit/fileapi/local_file_system_operation_unittest.cc
@@ -58,7 +58,7 @@ class LocalFileSystemOperationTest
int status() const { return status_; }
const base::PlatformFileInfo& info() const { return info_; }
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
const std::vector<base::FileUtilProxy::Entry>& entries() const {
return entries_;
}
@@ -101,32 +101,32 @@ class LocalFileSystemOperationTest
return context;
}
- FileSystemURL URLForPath(const FilePath& path) const {
+ FileSystemURL URLForPath(const base::FilePath& path) const {
return test_helper_.CreateURL(path);
}
- FilePath PlatformPath(const FilePath& virtual_path) {
+ base::FilePath PlatformPath(const base::FilePath& virtual_path) {
return test_helper_.GetLocalPath(virtual_path);
}
- bool FileExists(const FilePath& virtual_path) {
+ bool FileExists(const base::FilePath& virtual_path) {
FileSystemURL url = test_helper_.CreateURL(virtual_path);
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
scoped_ptr<FileSystemOperationContext> context(NewContext());
base::PlatformFileError error = file_util()->GetFileInfo(
context.get(), url, &file_info, &platform_path);
return error == base::PLATFORM_FILE_OK && !file_info.is_directory;
}
- bool DirectoryExists(const FilePath& virtual_path) {
+ bool DirectoryExists(const base::FilePath& virtual_path) {
FileSystemURL url = test_helper_.CreateURL(virtual_path);
scoped_ptr<FileSystemOperationContext> context(NewContext());
return FileUtilHelper::DirectoryExists(context.get(), file_util(), url);
}
- FilePath CreateUniqueFileInDir(const FilePath& virtual_dir_path) {
- FilePath file_name = FilePath::FromUTF8Unsafe(
+ base::FilePath CreateUniqueFileInDir(const base::FilePath& virtual_dir_path) {
+ base::FilePath file_name = base::FilePath::FromUTF8Unsafe(
"tmpfile-" + base::IntToString(next_unique_path_suffix_++));
FileSystemURL url = test_helper_.CreateURL(
virtual_dir_path.Append(file_name));
@@ -139,8 +139,8 @@ class LocalFileSystemOperationTest
return url.path();
}
- FilePath CreateUniqueDirInDir(const FilePath& virtual_dir_path) {
- FilePath dir_name = FilePath::FromUTF8Unsafe(
+ base::FilePath CreateUniqueDirInDir(const base::FilePath& virtual_dir_path) {
+ base::FilePath dir_name = base::FilePath::FromUTF8Unsafe(
"tmpdir-" + base::IntToString(next_unique_path_suffix_++));
FileSystemURL url = test_helper_.CreateURL(
virtual_dir_path.Append(dir_name));
@@ -151,8 +151,8 @@ class LocalFileSystemOperationTest
return url.path();
}
- FilePath CreateUniqueDir() {
- return CreateUniqueDirInDir(FilePath());
+ base::FilePath CreateUniqueDir() {
+ return CreateUniqueDirInDir(base::FilePath());
}
LocalFileSystemTestOriginHelper test_helper_;
@@ -192,7 +192,7 @@ class LocalFileSystemOperationTest
void DidGetMetadata(base::PlatformFileError status,
const base::PlatformFileInfo& info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
info_ = info;
path_ = platform_path;
status_ = status;
@@ -201,7 +201,7 @@ class LocalFileSystemOperationTest
void DidCreateSnapshotFile(
base::PlatformFileError status,
const base::PlatformFileInfo& info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<ShareableFileReference>& shareable_file_ref) {
info_ = info;
path_ = platform_path;
@@ -236,8 +236,8 @@ class LocalFileSystemOperationTest
ASSERT_EQ(quota::kQuotaStatusOk, status);
}
- void GenerateUniquePathInDir(const FilePath& dir,
- FilePath* file_path,
+ void GenerateUniquePathInDir(const base::FilePath& dir,
+ base::FilePath* file_path,
int64* path_cost) {
int64 base_usage;
GetUsageAndQuota(&base_usage, NULL);
@@ -272,7 +272,7 @@ class LocalFileSystemOperationTest
// For post-operation status.
int status_;
base::PlatformFileInfo info_;
- FilePath path_;
+ base::FilePath path_;
std::vector<base::FileUtilProxy::Entry> entries_;
scoped_refptr<ShareableFileReference> shareable_file_ref_;
@@ -290,7 +290,7 @@ class LocalFileSystemOperationTest
};
void LocalFileSystemOperationTest::SetUp() {
- FilePath base_dir = base_.path().AppendASCII("filesystem");
+ base::FilePath base_dir = base_.path().AppendASCII("filesystem");
quota_manager_ = new quota::MockQuotaManager(
false /* is_incognito */, base_dir,
base::MessageLoopProxy::current(),
@@ -319,8 +319,8 @@ LocalFileSystemOperation* LocalFileSystemOperationTest::operation() {
}
TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDoesntExist) {
- FileSystemURL src(URLForPath(FilePath(FILE_PATH_LITERAL("a"))));
- FileSystemURL dest(URLForPath(FilePath(FILE_PATH_LITERAL("b"))));
+ FileSystemURL src(URLForPath(base::FilePath(FILE_PATH_LITERAL("a"))));
+ FileSystemURL dest(URLForPath(base::FilePath(FILE_PATH_LITERAL("b"))));
change_observer()->ResetCount();
operation()->Move(src, dest, RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -329,8 +329,8 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDoesntExist) {
}
TEST_F(LocalFileSystemOperationTest, TestMoveFailureContainsPath) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDirInDir(src_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDirInDir(src_dir_path));
operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -340,9 +340,9 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureContainsPath) {
TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) {
// Src exists and is dir. Dest is a file.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
operation()->Move(URLForPath(src_dir_path), URLForPath(dest_file_path),
RecordStatusCallback());
@@ -354,9 +354,9 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) {
TEST_F(LocalFileSystemOperationTest,
TestMoveFailureSrcFileExistsDestNonEmptyDir) {
// Src exists and is a directory. Dest is a non-empty directory.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath child_file_path(CreateUniqueFileInDir(dest_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath child_file_path(CreateUniqueFileInDir(dest_dir_path));
operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -367,9 +367,9 @@ TEST_F(LocalFileSystemOperationTest,
TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) {
// Src exists and is a file. Dest is a directory.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
operation()->Move(URLForPath(src_file_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -380,8 +380,8 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) {
TEST_F(LocalFileSystemOperationTest, TestMoveFailureDestParentDoesntExist) {
// Dest. parent path does not exist.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath nonexisting_file = FilePath(FILE_PATH_LITERAL("NonexistingDir")).
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath nonexisting_file = base::FilePath(FILE_PATH_LITERAL("NonexistingDir")).
Append(FILE_PATH_LITERAL("NonexistingFile"));
operation()->Move(URLForPath(src_dir_path), URLForPath(nonexisting_file),
@@ -392,10 +392,10 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureDestParentDoesntExist) {
}
TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndOverwrite) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
operation()->Move(URLForPath(src_file_path), URLForPath(dest_file_path),
RecordStatusCallback());
@@ -413,10 +413,10 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndOverwrite) {
}
TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndNew) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(dest_dir_path.Append(FILE_PATH_LITERAL("NewFile")));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(dest_dir_path.Append(FILE_PATH_LITERAL("NewFile")));
operation()->Move(URLForPath(src_file_path), URLForPath(dest_file_path),
RecordStatusCallback());
@@ -430,8 +430,8 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndNew) {
}
TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -450,9 +450,9 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) {
}
TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndNew) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_parent_dir_path(CreateUniqueDir());
- FilePath dest_child_dir_path(dest_parent_dir_path.
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_parent_dir_path(CreateUniqueDir());
+ base::FilePath dest_child_dir_path(dest_parent_dir_path.
Append(FILE_PATH_LITERAL("NewDirectory")));
operation()->Move(URLForPath(src_dir_path), URLForPath(dest_child_dir_path),
@@ -468,12 +468,12 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndNew) {
}
TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath child_dir_path(CreateUniqueDirInDir(src_dir_path));
- FilePath grandchild_file_path(
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath child_dir_path(CreateUniqueDirInDir(src_dir_path));
+ base::FilePath grandchild_file_path(
CreateUniqueFileInDir(child_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -493,8 +493,8 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
}
TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDoesntExist) {
- operation()->Copy(URLForPath(FilePath(FILE_PATH_LITERAL("a"))),
- URLForPath(FilePath(FILE_PATH_LITERAL("b"))),
+ operation()->Copy(URLForPath(base::FilePath(FILE_PATH_LITERAL("a"))),
+ URLForPath(base::FilePath(FILE_PATH_LITERAL("b"))),
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status());
@@ -502,8 +502,8 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDoesntExist) {
}
TEST_F(LocalFileSystemOperationTest, TestCopyFailureContainsPath) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDirInDir(src_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDirInDir(src_dir_path));
operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -513,9 +513,9 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureContainsPath) {
TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) {
// Src exists and is dir. Dest is a file.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_file_path),
RecordStatusCallback());
@@ -527,9 +527,9 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) {
TEST_F(LocalFileSystemOperationTest,
TestCopyFailureSrcFileExistsDestNonEmptyDir) {
// Src exists and is a directory. Dest is a non-empty directory.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath child_file_path(CreateUniqueFileInDir(dest_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath child_file_path(CreateUniqueFileInDir(dest_dir_path));
operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -540,9 +540,9 @@ TEST_F(LocalFileSystemOperationTest,
TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) {
// Src exists and is a file. Dest is a directory.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
operation()->Copy(URLForPath(src_file_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -553,10 +553,10 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) {
TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) {
// Dest. parent path does not exist.
- FilePath src_dir_path(CreateUniqueDir());
- FilePath nonexisting_path = FilePath(FILE_PATH_LITERAL("DontExistDir"));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath nonexisting_path = base::FilePath(FILE_PATH_LITERAL("DontExistDir"));
file_util::EnsureEndsWithSeparator(&nonexisting_path);
- FilePath nonexisting_file_path(nonexisting_path.Append(
+ base::FilePath nonexisting_file_path(nonexisting_path.Append(
FILE_PATH_LITERAL("DontExistFile")));
operation()->Copy(URLForPath(src_dir_path),
@@ -570,11 +570,11 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) {
TEST_F(LocalFileSystemOperationTest, TestCopyFailureByQuota) {
base::PlatformFileInfo info;
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path;
+ base::FilePath dest_file_path;
int64 dest_path_cost;
GenerateUniquePathInDir(dest_dir_path, &dest_file_path, &dest_path_cost);
@@ -599,10 +599,10 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureByQuota) {
}
TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndOverwrite) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(CreateUniqueFileInDir(dest_dir_path));
operation()->Copy(URLForPath(src_file_path), URLForPath(dest_file_path),
RecordStatusCallback());
@@ -616,10 +616,10 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndOverwrite) {
}
TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndNew) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(dest_dir_path.Append(FILE_PATH_LITERAL("NewFile")));
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_file_path(CreateUniqueFileInDir(src_dir_path));
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(dest_dir_path.Append(FILE_PATH_LITERAL("NewFile")));
operation()->Copy(URLForPath(src_file_path), URLForPath(dest_file_path),
RecordStatusCallback());
@@ -633,8 +633,8 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndNew) {
}
TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
@@ -653,9 +653,9 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) {
}
TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndNew) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath dest_parent_dir_path(CreateUniqueDir());
- FilePath dest_child_dir_path(dest_parent_dir_path.
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath dest_parent_dir_path(CreateUniqueDir());
+ base::FilePath dest_child_dir_path(dest_parent_dir_path.
Append(FILE_PATH_LITERAL("NewDirectory")));
operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_child_dir_path),
@@ -670,12 +670,12 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndNew) {
}
TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirRecursive) {
- FilePath src_dir_path(CreateUniqueDir());
- FilePath child_dir_path(CreateUniqueDirInDir(src_dir_path));
- FilePath grandchild_file_path(
+ base::FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath child_dir_path(CreateUniqueDirInDir(src_dir_path));
+ base::FilePath grandchild_file_path(
CreateUniqueFileInDir(child_dir_path));
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path),
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -696,13 +696,13 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirRecursive) {
}
TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) {
- FilePath src_local_disk_file_path;
+ base::FilePath src_local_disk_file_path;
file_util::CreateTemporaryFile(&src_local_disk_file_path);
const char test_data[] = "foo";
int data_size = ARRAYSIZE_UNSAFE(test_data);
file_util::WriteFile(src_local_disk_file_path, test_data, data_size);
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(dest_dir_path.Append(
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(dest_dir_path.Append(
src_local_disk_file_path.BaseName()));
FileSystemURL dest_file_url = URLForPath(dest_file_path);
int64 before_usage;
@@ -729,14 +729,14 @@ TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) {
}
TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileFailureByQuota) {
- FilePath src_local_disk_file_path;
+ base::FilePath src_local_disk_file_path;
file_util::CreateTemporaryFile(&src_local_disk_file_path);
const char test_data[] = "foo";
file_util::WriteFile(src_local_disk_file_path, test_data,
ARRAYSIZE_UNSAFE(test_data));
- FilePath dest_dir_path(CreateUniqueDir());
- FilePath dest_file_path(dest_dir_path.Append(
+ base::FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_file_path(dest_dir_path.Append(
src_local_disk_file_path.BaseName()));
FileSystemURL dest_file_url = URLForPath(dest_file_path);
@@ -756,8 +756,8 @@ TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileFailureByQuota) {
TEST_F(LocalFileSystemOperationTest, TestCreateFileFailure) {
// Already existing file and exclusive true.
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
operation()->CreateFile(URLForPath(file_path), true,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -767,8 +767,8 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileFailure) {
TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileExists) {
// Already existing file and exclusive false.
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
operation()->CreateFile(URLForPath(file_path), false,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -781,8 +781,8 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileExists) {
TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessExclusive) {
// File doesn't exist but exclusive is true.
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(dir_path.Append(FILE_PATH_LITERAL("FileDoesntExist")));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(dir_path.Append(FILE_PATH_LITERAL("FileDoesntExist")));
operation()->CreateFile(URLForPath(file_path), true,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -793,8 +793,8 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessExclusive) {
TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileDoesntExist) {
// Non existing file.
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(dir_path.Append(FILE_PATH_LITERAL("FileDoesntExist")));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(dir_path.Append(FILE_PATH_LITERAL("FileDoesntExist")));
operation()->CreateFile(URLForPath(file_path), false,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -805,9 +805,9 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileDoesntExist) {
TEST_F(LocalFileSystemOperationTest,
TestCreateDirFailureDestParentDoesntExist) {
// Dest. parent path does not exist.
- FilePath nonexisting_path(FilePath(
+ base::FilePath nonexisting_path(base::FilePath(
FILE_PATH_LITERAL("DirDoesntExist")));
- FilePath nonexisting_file_path(nonexisting_path.Append(
+ base::FilePath nonexisting_file_path(nonexisting_path.Append(
FILE_PATH_LITERAL("FileDoesntExist")));
operation()->CreateDirectory(URLForPath(nonexisting_file_path), false, false,
RecordStatusCallback());
@@ -818,7 +818,7 @@ TEST_F(LocalFileSystemOperationTest,
TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureDirExists) {
// Exclusive and dir existing at path.
- FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
operation()->CreateDirectory(URLForPath(src_dir_path), true, false,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -828,8 +828,8 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureDirExists) {
TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureFileExists) {
// Exclusive true and file existing at path.
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
operation()->CreateDirectory(URLForPath(file_path), true, false,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -839,7 +839,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureFileExists) {
TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) {
// Dir exists and exclusive is false.
- FilePath dir_path(CreateUniqueDir());
+ base::FilePath dir_path(CreateUniqueDir());
operation()->CreateDirectory(URLForPath(dir_path), false, false,
RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -847,7 +847,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) {
EXPECT_TRUE(change_observer()->HasNoChange());
// Dir doesn't exist.
- FilePath nonexisting_dir_path(FilePath(
+ base::FilePath nonexisting_dir_path(base::FilePath(
FILE_PATH_LITERAL("nonexistingdir")));
operation()->CreateDirectory(URLForPath(nonexisting_dir_path), false, false,
RecordStatusCallback());
@@ -859,7 +859,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) {
TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccessExclusive) {
// Dir doesn't exist.
- FilePath nonexisting_dir_path(FilePath(
+ base::FilePath nonexisting_dir_path(base::FilePath(
FILE_PATH_LITERAL("nonexistingdir")));
operation()->CreateDirectory(URLForPath(nonexisting_dir_path), true, false,
@@ -872,7 +872,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccessExclusive) {
}
TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataFailure) {
- FilePath nonexisting_dir_path(FilePath(
+ base::FilePath nonexisting_dir_path(base::FilePath(
FILE_PATH_LITERAL("nonexistingdir")));
operation()->GetMetadata(URLForPath(nonexisting_dir_path),
RecordMetadataCallback());
@@ -893,7 +893,7 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataFailure) {
}
TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) {
- FilePath dir_path(CreateUniqueDir());
+ base::FilePath dir_path(CreateUniqueDir());
int read_access = 0;
operation()->DirectoryExists(URLForPath(dir_path),
@@ -906,10 +906,10 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) {
MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(base::PLATFORM_FILE_OK, status());
EXPECT_TRUE(info().is_directory);
- EXPECT_EQ(FilePath(), path());
+ EXPECT_EQ(base::FilePath(), path());
++read_access;
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
operation()->FileExists(URLForPath(file_path), RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(base::PLATFORM_FILE_OK, status());
@@ -928,12 +928,12 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) {
}
TEST_F(LocalFileSystemOperationTest, TestTypeMismatchErrors) {
- FilePath dir_path(CreateUniqueDir());
+ base::FilePath dir_path(CreateUniqueDir());
operation()->FileExists(URLForPath(dir_path), RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
ASSERT_FALSE(file_path.empty());
operation()->DirectoryExists(URLForPath(file_path), RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
@@ -942,7 +942,7 @@ TEST_F(LocalFileSystemOperationTest, TestTypeMismatchErrors) {
TEST_F(LocalFileSystemOperationTest, TestReadDirFailure) {
// Path doesn't exist
- FilePath nonexisting_dir_path(FilePath(
+ base::FilePath nonexisting_dir_path(base::FilePath(
FILE_PATH_LITERAL("NonExistingDir")));
file_util::EnsureEndsWithSeparator(&nonexisting_dir_path);
operation()->ReadDirectory(URLForPath(nonexisting_dir_path),
@@ -951,8 +951,8 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirFailure) {
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status());
// File exists.
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
operation()->ReadDirectory(URLForPath(file_path),
RecordReadDirectoryCallback());
MessageLoop::current()->RunUntilIdle();
@@ -965,9 +965,9 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirSuccess) {
// | |
// child_dir child_file
// Verify reading parent_dir.
- FilePath parent_dir_path(CreateUniqueDir());
- FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path));
- FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path));
+ base::FilePath parent_dir_path(CreateUniqueDir());
+ base::FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path));
+ base::FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path));
ASSERT_FALSE(child_dir_path.empty());
operation()->ReadDirectory(URLForPath(parent_dir_path),
@@ -991,7 +991,7 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirSuccess) {
TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) {
// Path doesn't exist.
- FilePath nonexisting_path(FilePath(
+ base::FilePath nonexisting_path(base::FilePath(
FILE_PATH_LITERAL("NonExistingDir")));
file_util::EnsureEndsWithSeparator(&nonexisting_path);
@@ -1006,9 +1006,9 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) {
// | |
// child_dir child_file
// Verify deleting parent_dir.
- FilePath parent_dir_path(CreateUniqueDir());
- FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path));
- FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path));
+ base::FilePath parent_dir_path(CreateUniqueDir());
+ base::FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path));
+ base::FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path));
ASSERT_FALSE(child_dir_path.empty());
operation()->Remove(URLForPath(parent_dir_path), false /* recursive */,
@@ -1020,7 +1020,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) {
}
TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) {
- FilePath empty_dir_path(CreateUniqueDir());
+ base::FilePath empty_dir_path(CreateUniqueDir());
EXPECT_TRUE(DirectoryExists(empty_dir_path));
operation()->Remove(URLForPath(empty_dir_path), false /* recursive */,
@@ -1037,9 +1037,9 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) {
// | |
// child_dir child_file
// Verify deleting parent_dir.
- FilePath parent_dir_path(CreateUniqueDir());
- FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path));
- FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path));
+ base::FilePath parent_dir_path(CreateUniqueDir());
+ base::FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path));
+ base::FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path));
ASSERT_FALSE(child_dir_path.empty());
operation()->Remove(URLForPath(parent_dir_path), true /* recursive */,
@@ -1054,8 +1054,8 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) {
}
TEST_F(LocalFileSystemOperationTest, TestTruncate) {
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
char test_data[] = "test data";
int data_size = static_cast<int>(sizeof(test_data));
@@ -1118,8 +1118,8 @@ TEST_F(LocalFileSystemOperationTest, TestTruncate) {
TEST_F(LocalFileSystemOperationTest, TestTruncateFailureByQuota) {
base::PlatformFileInfo info;
- FilePath dir_path(CreateUniqueDir());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath dir_path(CreateUniqueDir());
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
GrantQuotaForCurrentUsage();
AddQuota(10);
@@ -1143,8 +1143,8 @@ TEST_F(LocalFileSystemOperationTest, TestTruncateFailureByQuota) {
}
TEST_F(LocalFileSystemOperationTest, TestTouchFile) {
- FilePath file_path(CreateUniqueFileInDir(FilePath()));
- FilePath platform_path = PlatformPath(file_path);
+ base::FilePath file_path(CreateUniqueFileInDir(base::FilePath()));
+ base::FilePath platform_path = PlatformPath(file_path);
base::PlatformFileInfo info;
@@ -1176,12 +1176,12 @@ TEST_F(LocalFileSystemOperationTest, TestTouchFile) {
}
TEST_F(LocalFileSystemOperationTest, TestCreateSnapshotFile) {
- FilePath dir_path(CreateUniqueDir());
+ base::FilePath dir_path(CreateUniqueDir());
// Create a file for the testing.
operation()->DirectoryExists(URLForPath(dir_path),
RecordStatusCallback());
- FilePath file_path(CreateUniqueFileInDir(dir_path));
+ base::FilePath file_path(CreateUniqueFileInDir(dir_path));
operation()->FileExists(URLForPath(file_path), RecordStatusCallback());
MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(base::PLATFORM_FILE_OK, status());
diff --git a/webkit/fileapi/local_file_system_operation_write_unittest.cc b/webkit/fileapi/local_file_system_operation_write_unittest.cc
index 4a8cd47..5841222 100644
--- a/webkit/fileapi/local_file_system_operation_write_unittest.cc
+++ b/webkit/fileapi/local_file_system_operation_write_unittest.cc
@@ -43,7 +43,7 @@ void AssertStatusEq(base::PlatformFileError expected,
class MockQuotaManager : public QuotaManager {
public:
- MockQuotaManager(const FilePath& base_dir, int64 quota)
+ MockQuotaManager(const base::FilePath& base_dir, int64 quota)
: QuotaManager(false /* is_incognito */, base_dir,
base::MessageLoopProxy::current(),
base::MessageLoopProxy::current(),
@@ -109,7 +109,7 @@ class LocalFileSystemOperationWriteTest
return &change_observer_;
}
- FileSystemURL URLForPath(const FilePath& path) const {
+ FileSystemURL URLForPath(const base::FilePath& path) const {
return test_helper_.CreateURL(path);
}
@@ -153,7 +153,7 @@ class LocalFileSystemOperationWriteTest
MessageLoop loop_;
base::ScopedTempDir dir_;
- FilePath virtual_path_;
+ base::FilePath virtual_path_;
// For post-operation status.
base::PlatformFileError status_;
@@ -172,13 +172,13 @@ class LocalFileSystemOperationWriteTest
void LocalFileSystemOperationWriteTest::SetUp() {
ASSERT_TRUE(dir_.CreateUniqueTempDir());
- FilePath base_dir = dir_.path().AppendASCII("filesystem");
+ base::FilePath base_dir = dir_.path().AppendASCII("filesystem");
quota_manager_ = new MockQuotaManager(base_dir, 1024);
test_helper_.SetUp(base_dir,
false /* unlimited quota */,
quota_manager_->proxy());
- virtual_path_ = FilePath(FILE_PATH_LITERAL("temporary file"));
+ virtual_path_ = base::FilePath(FILE_PATH_LITERAL("temporary file"));
operation()->CreateFile(
URLForPath(virtual_path_), true /* exclusive */,
@@ -248,7 +248,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteInvalidFile) {
ScopedTextBlob blob(url_request_context_, blob_url, "It\'ll not be written.");
operation()->Write(&url_request_context_,
- URLForPath(FilePath(FILE_PATH_LITERAL("nonexist"))),
+ URLForPath(base::FilePath(FILE_PATH_LITERAL("nonexist"))),
blob_url, 0, RecordWriteCallback());
MessageLoop::current()->Run();
@@ -260,7 +260,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestWriteInvalidFile) {
}
TEST_F(LocalFileSystemOperationWriteTest, TestWriteDir) {
- FilePath virtual_dir_path(FILE_PATH_LITERAL("d"));
+ base::FilePath virtual_dir_path(FILE_PATH_LITERAL("d"));
operation()->CreateDirectory(
URLForPath(virtual_dir_path),
true /* exclusive */, false /* recursive */,
@@ -330,7 +330,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestImmediateCancelFailingWrite) {
FileSystemOperation* write_operation = operation();
write_operation->Write(&url_request_context_,
- URLForPath(FilePath(FILE_PATH_LITERAL("nonexist"))),
+ URLForPath(base::FilePath(FILE_PATH_LITERAL("nonexist"))),
blob_url, 0, RecordWriteCallback());
write_operation->Cancel(RecordCancelCallback());
// We use RunAllPendings() instead of Run() here, because we won't dispatch
diff --git a/webkit/fileapi/local_file_system_quota_unittest.cc b/webkit/fileapi/local_file_system_quota_unittest.cc
index 1e7f6a7..0e39102 100644
--- a/webkit/fileapi/local_file_system_quota_unittest.cc
+++ b/webkit/fileapi/local_file_system_quota_unittest.cc
@@ -72,13 +72,13 @@ class LocalFileSystemQuotaTest
return context;
}
- void PrepareFileSet(const FilePath& virtual_path);
+ void PrepareFileSet(const base::FilePath& virtual_path);
- FileSystemURL URLForPath(const FilePath& path) const {
+ FileSystemURL URLForPath(const base::FilePath& path) const {
return test_helper_.CreateURL(path);
}
- FilePath PlatformPath(const FilePath& virtual_path) {
+ base::FilePath PlatformPath(const base::FilePath& virtual_path) {
return test_helper_.GetLocalPath(virtual_path);
}
@@ -100,24 +100,24 @@ class LocalFileSystemQuotaTest
MessageLoop::current()->RunUntilIdle();
}
- bool FileExists(const FilePath& virtual_path) {
+ bool FileExists(const base::FilePath& virtual_path) {
FileSystemURL url = test_helper_.CreateURL(virtual_path);
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
scoped_ptr<FileSystemOperationContext> context(NewContext());
base::PlatformFileError error = file_util()->GetFileInfo(
context.get(), url, &file_info, &platform_path);
return error == base::PLATFORM_FILE_OK;
}
- bool DirectoryExists(const FilePath& virtual_path) {
+ bool DirectoryExists(const base::FilePath& virtual_path) {
FileSystemURL path = test_helper_.CreateURL(virtual_path);
scoped_ptr<FileSystemOperationContext> context(NewContext());
return FileUtilHelper::DirectoryExists(context.get(), file_util(), path);
}
- FilePath CreateUniqueFileInDir(const FilePath& virtual_dir_path) {
- FilePath file_name = FilePath::FromUTF8Unsafe(
+ base::FilePath CreateUniqueFileInDir(const base::FilePath& virtual_dir_path) {
+ base::FilePath file_name = base::FilePath::FromUTF8Unsafe(
"tmpfile-" + base::IntToString(next_unique_path_suffix_++));
FileSystemURL url = test_helper_.CreateURL(
virtual_dir_path.Append(file_name));
@@ -130,8 +130,8 @@ class LocalFileSystemQuotaTest
return url.path();
}
- FilePath CreateUniqueDirInDir(const FilePath& virtual_dir_path) {
- FilePath dir_name = FilePath::FromUTF8Unsafe(
+ base::FilePath CreateUniqueDirInDir(const base::FilePath& virtual_dir_path) {
+ base::FilePath dir_name = base::FilePath::FromUTF8Unsafe(
"tmpdir-" + base::IntToString(next_unique_path_suffix_++));
FileSystemURL url = test_helper_.CreateURL(
virtual_dir_path.Append(dir_name));
@@ -142,15 +142,15 @@ class LocalFileSystemQuotaTest
return url.path();
}
- FilePath CreateUniqueDir() {
- return CreateUniqueDirInDir(FilePath());
+ base::FilePath CreateUniqueDir() {
+ return CreateUniqueDirInDir(base::FilePath());
}
- FilePath child_dir_path_;
- FilePath child_file1_path_;
- FilePath child_file2_path_;
- FilePath grandchild_file1_path_;
- FilePath grandchild_file2_path_;
+ base::FilePath child_dir_path_;
+ base::FilePath child_file1_path_;
+ base::FilePath child_file2_path_;
+ base::FilePath grandchild_file1_path_;
+ base::FilePath grandchild_file2_path_;
int64 child_path_cost_;
int64 grandchild_path_cost_;
@@ -186,7 +186,7 @@ class LocalFileSystemQuotaTest
void LocalFileSystemQuotaTest::SetUp() {
ASSERT_TRUE(work_dir_.CreateUniqueTempDir());
- FilePath filesystem_dir_path = work_dir_.path().AppendASCII("filesystem");
+ base::FilePath filesystem_dir_path = work_dir_.path().AppendASCII("filesystem");
ASSERT_TRUE(file_util::CreateDirectory(filesystem_dir_path));
quota_manager_ = new quota::QuotaManager(
@@ -217,7 +217,7 @@ void LocalFileSystemQuotaTest::OnGetUsageAndQuota(
quota_ = quota;
}
-void LocalFileSystemQuotaTest::PrepareFileSet(const FilePath& virtual_path) {
+void LocalFileSystemQuotaTest::PrepareFileSet(const base::FilePath& virtual_path) {
int64 usage = SizeByQuotaUtil();
child_dir_path_ = CreateUniqueDirInDir(virtual_path);
child_file1_path_ = CreateUniqueFileInDir(virtual_path);
@@ -231,10 +231,10 @@ void LocalFileSystemQuotaTest::PrepareFileSet(const FilePath& virtual_path) {
}
TEST_F(LocalFileSystemQuotaTest, TestMoveSuccessSrcDirRecursive) {
- FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
int src_path_cost = SizeByQuotaUtil();
PrepareFileSet(src_dir_path);
- FilePath dest_dir_path(CreateUniqueDir());
+ base::FilePath dest_dir_path(CreateUniqueDir());
EXPECT_EQ(0, ActualFileSize());
int total_path_cost = SizeByQuotaUtil();
@@ -279,10 +279,10 @@ TEST_F(LocalFileSystemQuotaTest, TestMoveSuccessSrcDirRecursive) {
}
TEST_F(LocalFileSystemQuotaTest, TestCopySuccessSrcDirRecursive) {
- FilePath src_dir_path(CreateUniqueDir());
+ base::FilePath src_dir_path(CreateUniqueDir());
PrepareFileSet(src_dir_path);
- FilePath dest_dir1_path(CreateUniqueDir());
- FilePath dest_dir2_path(CreateUniqueDir());
+ base::FilePath dest_dir1_path(CreateUniqueDir());
+ base::FilePath dest_dir2_path(CreateUniqueDir());
EXPECT_EQ(0, ActualFileSize());
int total_path_cost = SizeByQuotaUtil();
diff --git a/webkit/fileapi/local_file_system_test_helper.cc b/webkit/fileapi/local_file_system_test_helper.cc
index e3dbe61..fe206f1 100644
--- a/webkit/fileapi/local_file_system_test_helper.cc
+++ b/webkit/fileapi/local_file_system_test_helper.cc
@@ -38,7 +38,7 @@ LocalFileSystemTestOriginHelper::LocalFileSystemTestOriginHelper()
LocalFileSystemTestOriginHelper::~LocalFileSystemTestOriginHelper() {
}
-void LocalFileSystemTestOriginHelper::SetUp(const FilePath& base_dir) {
+void LocalFileSystemTestOriginHelper::SetUp(const base::FilePath& base_dir) {
SetUp(base_dir, false, NULL);
}
@@ -50,17 +50,17 @@ void LocalFileSystemTestOriginHelper::SetUp(
// Prepare the origin's root directory.
file_system_context_->GetMountPointProvider(type_)->
- GetFileSystemRootPathOnFileThread(CreateURL(FilePath()),
+ GetFileSystemRootPathOnFileThread(CreateURL(base::FilePath()),
true /* create */);
// Initialize the usage cache file.
- FilePath usage_cache_path = GetUsageCachePath();
+ base::FilePath usage_cache_path = GetUsageCachePath();
if (!usage_cache_path.empty())
FileSystemUsageCache::UpdateUsage(usage_cache_path, 0);
}
void LocalFileSystemTestOriginHelper::SetUp(
- const FilePath& base_dir,
+ const base::FilePath& base_dir,
bool unlimited_quota,
quota::QuotaManagerProxy* quota_manager_proxy) {
scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy =
@@ -79,11 +79,11 @@ void LocalFileSystemTestOriginHelper::SetUp(
// Prepare the origin's root directory.
FileSystemMountPointProvider* mount_point_provider =
file_system_context_->GetMountPointProvider(type_);
- mount_point_provider->GetFileSystemRootPathOnFileThread(CreateURL(FilePath()),
+ mount_point_provider->GetFileSystemRootPathOnFileThread(CreateURL(base::FilePath()),
true /* create */);
// Initialize the usage cache file.
- FilePath usage_cache_path = GetUsageCachePath();
+ base::FilePath usage_cache_path = GetUsageCachePath();
if (!usage_cache_path.empty())
FileSystemUsageCache::UpdateUsage(usage_cache_path, 0);
}
@@ -93,33 +93,33 @@ void LocalFileSystemTestOriginHelper::TearDown() {
MessageLoop::current()->RunUntilIdle();
}
-FilePath LocalFileSystemTestOriginHelper::GetOriginRootPath() const {
+base::FilePath LocalFileSystemTestOriginHelper::GetOriginRootPath() const {
return file_system_context_->GetMountPointProvider(type_)->
- GetFileSystemRootPathOnFileThread(CreateURL(FilePath()), false);
+ GetFileSystemRootPathOnFileThread(CreateURL(base::FilePath()), false);
}
-FilePath LocalFileSystemTestOriginHelper::GetLocalPath(const FilePath& path) {
+base::FilePath LocalFileSystemTestOriginHelper::GetLocalPath(const base::FilePath& path) {
DCHECK(file_util_);
- FilePath local_path;
+ base::FilePath local_path;
scoped_ptr<FileSystemOperationContext> context(NewOperationContext());
file_util_->GetLocalFilePath(context.get(), CreateURL(path), &local_path);
return local_path;
}
-FilePath LocalFileSystemTestOriginHelper::GetLocalPathFromASCII(
+base::FilePath LocalFileSystemTestOriginHelper::GetLocalPathFromASCII(
const std::string& path) {
- return GetLocalPath(FilePath().AppendASCII(path));
+ return GetLocalPath(base::FilePath().AppendASCII(path));
}
-FilePath LocalFileSystemTestOriginHelper::GetUsageCachePath() const {
+base::FilePath LocalFileSystemTestOriginHelper::GetUsageCachePath() const {
if (type_ != kFileSystemTypeTemporary &&
type_ != kFileSystemTypePersistent)
- return FilePath();
+ return base::FilePath();
return file_system_context_->
sandbox_provider()->GetUsageCachePathForOriginAndType(origin_, type_);
}
-FileSystemURL LocalFileSystemTestOriginHelper::CreateURL(const FilePath& path)
+FileSystemURL LocalFileSystemTestOriginHelper::CreateURL(const base::FilePath& path)
const {
return file_system_context_->CreateCrackedFileSystemURL(origin_, type_, path);
}
@@ -163,7 +163,7 @@ LocalFileSystemOperation* LocalFileSystemTestOriginHelper::NewOperation() {
NewOperationContext());
LocalFileSystemOperation* operation = static_cast<LocalFileSystemOperation*>(
file_system_context_->CreateFileSystemOperation(
- CreateURL(FilePath()), NULL));
+ CreateURL(base::FilePath()), NULL));
return operation;
}
diff --git a/webkit/fileapi/local_file_system_test_helper.h b/webkit/fileapi/local_file_system_test_helper.h
index c6cf8c7..6dbebc6 100644
--- a/webkit/fileapi/local_file_system_test_helper.h
+++ b/webkit/fileapi/local_file_system_test_helper.h
@@ -15,12 +15,14 @@
#include "webkit/fileapi/file_system_util.h"
#include "webkit/quota/quota_types.h"
+namespace base {
+class FilePath;
+}
+
namespace quota {
class QuotaManagerProxy;
}
-class FilePath;
-
namespace fileapi {
class FileSystemContext;
@@ -37,27 +39,27 @@ class LocalFileSystemTestOriginHelper {
LocalFileSystemTestOriginHelper();
~LocalFileSystemTestOriginHelper();
- void SetUp(const FilePath& base_dir);
+ void SetUp(const base::FilePath& base_dir);
// If you want to use more than one LocalFileSystemTestOriginHelper in
// a single base directory, they have to share a context, so that they don't
// have multiple databases fighting over the lock to the origin directory
// [deep down inside ObfuscatedFileUtil].
void SetUp(FileSystemContext* file_system_context);
- void SetUp(const FilePath& base_dir,
+ void SetUp(const base::FilePath& base_dir,
bool unlimited_quota,
quota::QuotaManagerProxy* quota_manager_proxy);
void TearDown();
- FilePath GetOriginRootPath() const;
- FilePath GetLocalPath(const FilePath& path);
- FilePath GetLocalPathFromASCII(const std::string& path);
+ base::FilePath GetOriginRootPath() const;
+ base::FilePath GetLocalPath(const base::FilePath& path);
+ base::FilePath GetLocalPathFromASCII(const std::string& path);
// Returns empty path if filesystem type is neither temporary nor persistent.
- FilePath GetUsageCachePath() const;
+ base::FilePath GetUsageCachePath() const;
- FileSystemURL CreateURL(const FilePath& path) const;
+ FileSystemURL CreateURL(const base::FilePath& path) const;
FileSystemURL CreateURLFromUTF8(const std::string& utf8) const {
- return CreateURL(FilePath::FromUTF8Unsafe(utf8));
+ return CreateURL(base::FilePath::FromUTF8Unsafe(utf8));
}
// Helper methods for same-FileUtil copy/move.
diff --git a/webkit/fileapi/local_file_util.cc b/webkit/fileapi/local_file_util.cc
index 0cecdca..4b533c9 100644
--- a/webkit/fileapi/local_file_util.cc
+++ b/webkit/fileapi/local_file_util.cc
@@ -20,8 +20,8 @@ using base::PlatformFileError;
class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
public:
- LocalFileEnumerator(const FilePath& platform_root_path,
- const FilePath& virtual_root_path,
+ LocalFileEnumerator(const base::FilePath& platform_root_path,
+ const base::FilePath& virtual_root_path,
bool recursive,
int file_type)
: file_enum_(platform_root_path, recursive, file_type),
@@ -34,7 +34,7 @@ class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
~LocalFileEnumerator() {}
- virtual FilePath Next() OVERRIDE;
+ virtual base::FilePath Next() OVERRIDE;
virtual int64 Size() OVERRIDE;
virtual base::Time LastModifiedTime() OVERRIDE;
virtual bool IsDirectory() OVERRIDE;
@@ -42,12 +42,12 @@ class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
private:
file_util::FileEnumerator file_enum_;
file_util::FileEnumerator::FindInfo file_util_info_;
- FilePath platform_root_path_;
- FilePath virtual_root_path_;
+ base::FilePath platform_root_path_;
+ base::FilePath virtual_root_path_;
};
-FilePath LocalFileEnumerator::Next() {
- FilePath next = file_enum_.Next();
+base::FilePath LocalFileEnumerator::Next() {
+ base::FilePath next = file_enum_.Next();
// Don't return symlinks.
while (!next.empty() && file_util::IsLink(next))
next = file_enum_.Next();
@@ -55,7 +55,7 @@ FilePath LocalFileEnumerator::Next() {
return next;
file_enum_.GetFindInfo(&file_util_info_);
- FilePath path;
+ base::FilePath path;
platform_root_path_.AppendRelativePath(next, &path);
return virtual_root_path_.Append(path);
}
@@ -82,7 +82,7 @@ PlatformFileError LocalFileUtil::CreateOrOpen(
FileSystemOperationContext* context,
const FileSystemURL& url, int file_flags,
base::PlatformFile* file_handle, bool* created) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -99,7 +99,7 @@ PlatformFileError LocalFileUtil::EnsureFileExists(
FileSystemOperationContext* context,
const FileSystemURL& url,
bool* created) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -111,7 +111,7 @@ PlatformFileError LocalFileUtil::CreateDirectory(
const FileSystemURL& url,
bool exclusive,
bool recursive) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -122,8 +122,8 @@ PlatformFileError LocalFileUtil::GetFileInfo(
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_file_path) {
- FilePath file_path;
+ base::FilePath* platform_file_path) {
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -141,7 +141,7 @@ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> LocalFileUtil::
FileSystemOperationContext* context,
const FileSystemURL& root_url,
bool recursive) {
- FilePath file_path;
+ base::FilePath file_path;
if (GetLocalFilePath(context, root_url, &file_path) !=
base::PLATFORM_FILE_OK) {
return make_scoped_ptr(new EmptyFileEnumerator)
@@ -157,11 +157,11 @@ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> LocalFileUtil::
PlatformFileError LocalFileUtil::GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& url,
- FilePath* local_file_path) {
+ base::FilePath* local_file_path) {
FileSystemMountPointProvider* provider =
context->file_system_context()->GetMountPointProvider(url.type());
DCHECK(provider);
- FilePath root = provider->GetFileSystemRootPathOnFileThread(url, false);
+ base::FilePath root = provider->GetFileSystemRootPathOnFileThread(url, false);
if (root.empty())
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
*local_file_path = root.Append(url.path());
@@ -173,7 +173,7 @@ PlatformFileError LocalFileUtil::Touch(
const FileSystemURL& url,
const base::Time& last_access_time,
const base::Time& last_modified_time) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -184,7 +184,7 @@ PlatformFileError LocalFileUtil::Truncate(
FileSystemOperationContext* context,
const FileSystemURL& url,
int64 length) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -196,12 +196,12 @@ PlatformFileError LocalFileUtil::CopyOrMoveFile(
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
bool copy) {
- FilePath src_file_path;
+ base::FilePath src_file_path;
PlatformFileError error = GetLocalFilePath(context, src_url, &src_file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
- FilePath dest_file_path;
+ base::FilePath dest_file_path;
error = GetLocalFilePath(context, dest_url, &dest_file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -211,12 +211,12 @@ PlatformFileError LocalFileUtil::CopyOrMoveFile(
PlatformFileError LocalFileUtil::CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) {
if (src_file_path.empty())
return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
- FilePath dest_file_path;
+ base::FilePath dest_file_path;
PlatformFileError error =
GetLocalFilePath(context, dest_url, &dest_file_path);
if (error != base::PLATFORM_FILE_OK)
@@ -227,7 +227,7 @@ PlatformFileError LocalFileUtil::CopyInForeignFile(
PlatformFileError LocalFileUtil::DeleteFile(
FileSystemOperationContext* context,
const FileSystemURL& url) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -237,7 +237,7 @@ PlatformFileError LocalFileUtil::DeleteFile(
PlatformFileError LocalFileUtil::DeleteDirectory(
FileSystemOperationContext* context,
const FileSystemURL& url) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -248,7 +248,7 @@ base::PlatformFileError LocalFileUtil::CreateSnapshotFile(
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
SnapshotFilePolicy* policy) {
DCHECK(policy);
DCHECK(file_info);
diff --git a/webkit/fileapi/local_file_util.h b/webkit/fileapi/local_file_util.h
index bbe51f1..7f19a68 100644
--- a/webkit/fileapi/local_file_util.h
+++ b/webkit/fileapi/local_file_util.h
@@ -12,10 +12,10 @@
#include "webkit/storage/webkit_storage_export.h"
namespace base {
+class FilePath;
class Time;
}
-class FilePath;
class GURL;
namespace fileapi {
@@ -50,7 +50,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil {
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_file) OVERRIDE;
+ base::FilePath* platform_file) OVERRIDE;
virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator(
FileSystemOperationContext* context,
const FileSystemURL& root_url,
@@ -58,7 +58,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil {
virtual base::PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path) OVERRIDE;
+ base::FilePath* local_file_path) OVERRIDE;
virtual base::PlatformFileError Touch(
FileSystemOperationContext* context,
const FileSystemURL& url,
@@ -75,7 +75,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil {
bool copy) OVERRIDE;
virtual base::PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) OVERRIDE;
virtual base::PlatformFileError DeleteFile(
FileSystemOperationContext* context,
@@ -87,7 +87,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil {
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
SnapshotFilePolicy* snapshot_policy) OVERRIDE;
private:
diff --git a/webkit/fileapi/local_file_util_unittest.cc b/webkit/fileapi/local_file_util_unittest.cc
index 72c9ecb..fc3175a 100644
--- a/webkit/fileapi/local_file_util_unittest.cc
+++ b/webkit/fileapi/local_file_util_unittest.cc
@@ -51,7 +51,7 @@ class LocalFileUtilTest : public testing::Test {
return test_helper_.CreateURLFromUTF8(file_name);
}
- FilePath LocalPath(const char *file_name) {
+ base::FilePath LocalPath(const char *file_name) {
return test_helper_.GetLocalPathFromASCII(file_name);
}
diff --git a/webkit/fileapi/media/device_media_file_util.cc b/webkit/fileapi/media/device_media_file_util.cc
index a5db4a8..b1f037c 100644
--- a/webkit/fileapi/media/device_media_file_util.cc
+++ b/webkit/fileapi/media/device_media_file_util.cc
@@ -22,7 +22,7 @@ namespace fileapi {
namespace {
-const FilePath::CharType kDeviceMediaFileUtilTempDir[] =
+const base::FilePath::CharType kDeviceMediaFileUtilTempDir[] =
FILE_PATH_LITERAL("DeviceMediaFileSystem");
MTPDeviceDelegate* GetMTPDeviceDelegate(FileSystemOperationContext* context) {
@@ -33,7 +33,7 @@ MTPDeviceDelegate* GetMTPDeviceDelegate(FileSystemOperationContext* context) {
} // namespace
-DeviceMediaFileUtil::DeviceMediaFileUtil(const FilePath& profile_path)
+DeviceMediaFileUtil::DeviceMediaFileUtil(const base::FilePath& profile_path)
: profile_path_(profile_path) {
}
@@ -70,7 +70,7 @@ PlatformFileError DeviceMediaFileUtil::GetFileInfo(
FileSystemOperationContext* context,
const FileSystemURL& url,
PlatformFileInfo* file_info,
- FilePath* platform_path) {
+ base::FilePath* platform_path) {
MTPDeviceDelegate* delegate = GetMTPDeviceDelegate(context);
if (!delegate)
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
@@ -104,7 +104,7 @@ DeviceMediaFileUtil::CreateFileEnumerator(
PlatformFileError DeviceMediaFileUtil::GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path) {
+ base::FilePath* local_file_path) {
return base::PLATFORM_FILE_ERROR_SECURITY;
}
@@ -133,7 +133,7 @@ PlatformFileError DeviceMediaFileUtil::CopyOrMoveFile(
PlatformFileError DeviceMediaFileUtil::CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) {
return base::PLATFORM_FILE_ERROR_SECURITY;
}
@@ -154,7 +154,7 @@ base::PlatformFileError DeviceMediaFileUtil::CreateSnapshotFile(
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* local_path,
+ base::FilePath* local_path,
SnapshotFilePolicy* snapshot_policy) {
DCHECK(file_info);
DCHECK(local_path);
@@ -167,7 +167,7 @@ base::PlatformFileError DeviceMediaFileUtil::CreateSnapshotFile(
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
// Create a temp file in "profile_path_/kDeviceMediaFileUtilTempDir".
- FilePath isolated_media_file_system_dir_path =
+ base::FilePath isolated_media_file_system_dir_path =
profile_path_.Append(kDeviceMediaFileUtilTempDir);
bool dir_exists = file_util::DirectoryExists(
isolated_media_file_system_dir_path);
diff --git a/webkit/fileapi/media/device_media_file_util.h b/webkit/fileapi/media/device_media_file_util.h
index bd6bb80..efe85c7 100644
--- a/webkit/fileapi/media/device_media_file_util.h
+++ b/webkit/fileapi/media/device_media_file_util.h
@@ -22,7 +22,7 @@ class FileSystemOperationContext;
class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil
: public FileSystemFileUtil {
public:
- explicit DeviceMediaFileUtil(const FilePath& profile_path);
+ explicit DeviceMediaFileUtil(const base::FilePath& profile_path);
virtual ~DeviceMediaFileUtil() {}
// FileSystemFileUtil overrides.
@@ -47,7 +47,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path) OVERRIDE;
+ base::FilePath* platform_path) OVERRIDE;
virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator(
FileSystemOperationContext* context,
const FileSystemURL& root_url,
@@ -55,7 +55,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil
virtual base::PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path) OVERRIDE;
+ base::FilePath* local_file_path) OVERRIDE;
virtual base::PlatformFileError Touch(
FileSystemOperationContext* context,
const FileSystemURL& url,
@@ -72,7 +72,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil
bool copy) OVERRIDE;
virtual base::PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) OVERRIDE;
virtual base::PlatformFileError DeleteFile(
FileSystemOperationContext* context,
@@ -84,12 +84,12 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
SnapshotFilePolicy* policy) OVERRIDE;
private:
// Profile path
- const FilePath profile_path_;
+ const base::FilePath profile_path_;
DISALLOW_COPY_AND_ASSIGN(DeviceMediaFileUtil);
};
diff --git a/webkit/fileapi/media/filtering_file_enumerator.cc b/webkit/fileapi/media/filtering_file_enumerator.cc
index e291697..393cfa2 100644
--- a/webkit/fileapi/media/filtering_file_enumerator.cc
+++ b/webkit/fileapi/media/filtering_file_enumerator.cc
@@ -21,8 +21,8 @@ namespace {
// Used to skip the hidden folders and files. Returns true if the file specified
// by |path| should be skipped.
-bool ShouldSkip(const FilePath& path) {
- const FilePath& base_name = path.BaseName();
+bool ShouldSkip(const base::FilePath& path) {
+ const base::FilePath& base_name = path.BaseName();
if (base_name.empty())
return false;
@@ -77,9 +77,9 @@ FilteringFileEnumerator::FilteringFileEnumerator(
FilteringFileEnumerator::~FilteringFileEnumerator() {
}
-FilePath FilteringFileEnumerator::Next() {
+base::FilePath FilteringFileEnumerator::Next() {
while (true) {
- FilePath next = base_enumerator_->Next();
+ base::FilePath next = base_enumerator_->Next();
if (ShouldSkip(next))
continue;
diff --git a/webkit/fileapi/media/filtering_file_enumerator.h b/webkit/fileapi/media/filtering_file_enumerator.h
index 9e70880..accb2b0 100644
--- a/webkit/fileapi/media/filtering_file_enumerator.h
+++ b/webkit/fileapi/media/filtering_file_enumerator.h
@@ -22,7 +22,7 @@ class WEBKIT_STORAGE_EXPORT FilteringFileEnumerator
MediaPathFilter* filter);
virtual ~FilteringFileEnumerator();
- virtual FilePath Next() OVERRIDE;
+ virtual base::FilePath Next() OVERRIDE;
virtual int64 Size() OVERRIDE;
virtual base::Time LastModifiedTime() OVERRIDE;
virtual bool IsDirectory() OVERRIDE;
diff --git a/webkit/fileapi/media/media_path_filter.cc b/webkit/fileapi/media/media_path_filter.cc
index ae92c19..c9a0a81 100644
--- a/webkit/fileapi/media/media_path_filter.cc
+++ b/webkit/fileapi/media/media_path_filter.cc
@@ -14,7 +14,7 @@ namespace fileapi {
namespace {
-const FilePath::CharType* const kExtraSupportedExtensions[] = {
+const base::FilePath::CharType* const kExtraSupportedExtensions[] = {
FILE_PATH_LITERAL("3gp"),
FILE_PATH_LITERAL("3gpp"),
FILE_PATH_LITERAL("avi"),
@@ -27,7 +27,7 @@ const FilePath::CharType* const kExtraSupportedExtensions[] = {
FILE_PATH_LITERAL("wmv"),
};
-bool IsUnsupportedExtension(const FilePath::StringType& extension) {
+bool IsUnsupportedExtension(const base::FilePath::StringType& extension) {
std::string mime_type;
return !net::GetMimeTypeFromExtension(extension, &mime_type) ||
!net::IsSupportedMimeType(mime_type);
@@ -42,7 +42,7 @@ MediaPathFilter::MediaPathFilter()
MediaPathFilter::~MediaPathFilter() {
}
-bool MediaPathFilter::Match(const FilePath& path) {
+bool MediaPathFilter::Match(const base::FilePath& path) {
EnsureInitialized();
return std::binary_search(media_file_extensions_.begin(),
media_file_extensions_.end(),
@@ -73,7 +73,7 @@ void MediaPathFilter::EnsureInitialized() {
for (MediaFileExtensionList::iterator itr = media_file_extensions_.begin();
itr != media_file_extensions_.end(); ++itr)
- *itr = FilePath::kExtensionSeparator + *itr;
+ *itr = base::FilePath::kExtensionSeparator + *itr;
std::sort(media_file_extensions_.begin(), media_file_extensions_.end());
initialized_ = true;
diff --git a/webkit/fileapi/media/media_path_filter.h b/webkit/fileapi/media/media_path_filter.h
index 9079b8d..694be4e 100644
--- a/webkit/fileapi/media/media_path_filter.h
+++ b/webkit/fileapi/media/media_path_filter.h
@@ -11,7 +11,9 @@
#include "base/synchronization/lock.h"
#include "webkit/storage/webkit_storage_export.h"
+namespace base {
class FilePath;
+}
namespace fileapi {
@@ -21,10 +23,10 @@ class WEBKIT_STORAGE_EXPORT MediaPathFilter {
public:
MediaPathFilter();
~MediaPathFilter();
- bool Match(const FilePath& path);
+ bool Match(const base::FilePath& path);
private:
- typedef std::vector<FilePath::StringType> MediaFileExtensionList;
+ typedef std::vector<base::FilePath::StringType> MediaFileExtensionList;
void EnsureInitialized();
diff --git a/webkit/fileapi/media/mtp_device_delegate.h b/webkit/fileapi/media/mtp_device_delegate.h
index 793f46c..a5e89ac 100644
--- a/webkit/fileapi/media/mtp_device_delegate.h
+++ b/webkit/fileapi/media/mtp_device_delegate.h
@@ -9,9 +9,8 @@
#include "base/platform_file.h"
#include "webkit/fileapi/file_system_file_util.h"
-class FilePath;
-
namespace base {
+class FilePath;
class SequencedTaskRunner;
class Time;
}
@@ -26,7 +25,7 @@ class MTPDeviceDelegate {
public:
// Returns information about the given file path.
virtual base::PlatformFileError GetFileInfo(
- const FilePath& file_path,
+ const base::FilePath& file_path,
base::PlatformFileInfo* file_info) = 0;
// Returns a pointer to a new instance of AbstractFileEnumerator to enumerate
@@ -34,15 +33,15 @@ class MTPDeviceDelegate {
// caller, and its lifetime should not extend past when the current call
// returns to the main media task runner thread.
virtual scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator>
- CreateFileEnumerator(const FilePath& root,
+ CreateFileEnumerator(const base::FilePath& root,
bool recursive) = 0;
// Updates the temporary snapshot file contents given by |local_path| with
// media file contents given by |device_file_path| and also returns the
// metadata of the temporary file.
virtual base::PlatformFileError CreateSnapshotFile(
- const FilePath& device_file_path,
- const FilePath& local_path,
+ const base::FilePath& device_file_path,
+ const base::FilePath& local_path,
base::PlatformFileInfo* file_info) = 0;
// Called when the
diff --git a/webkit/fileapi/media/mtp_device_map_service.cc b/webkit/fileapi/media/mtp_device_map_service.cc
index 7316068..758a913 100644
--- a/webkit/fileapi/media/mtp_device_map_service.cc
+++ b/webkit/fileapi/media/mtp_device_map_service.cc
@@ -26,7 +26,7 @@ MTPDeviceMapService* MTPDeviceMapService::GetInstance() {
}
void MTPDeviceMapService::AddDelegate(
- const FilePath::StringType& device_location,
+ const base::FilePath::StringType& device_location,
MTPDeviceDelegate* delegate) {
DCHECK(delegate);
DCHECK(!device_location.empty());
@@ -38,7 +38,7 @@ void MTPDeviceMapService::AddDelegate(
}
void MTPDeviceMapService::RemoveDelegate(
- const FilePath::StringType& device_location) {
+ const base::FilePath::StringType& device_location) {
base::AutoLock lock(lock_);
DelegateMap::iterator it = delegate_map_.find(device_location);
DCHECK(it != delegate_map_.end());
@@ -48,13 +48,13 @@ void MTPDeviceMapService::RemoveDelegate(
MTPDeviceDelegate* MTPDeviceMapService::GetMTPDeviceDelegate(
const std::string& filesystem_id) {
- FilePath device_path;
+ base::FilePath device_path;
if (!IsolatedContext::GetInstance()->GetRegisteredPath(filesystem_id,
&device_path)) {
return NULL;
}
- const FilePath::StringType& device_location = device_path.value();
+ const base::FilePath::StringType& device_location = device_path.value();
DCHECK(!device_location.empty());
base::AutoLock lock(lock_);
diff --git a/webkit/fileapi/media/mtp_device_map_service.h b/webkit/fileapi/media/mtp_device_map_service.h
index 686d1cb..69da393 100644
--- a/webkit/fileapi/media/mtp_device_map_service.h
+++ b/webkit/fileapi/media/mtp_device_map_service.h
@@ -26,13 +26,13 @@ class WEBKIT_STORAGE_EXPORT MTPDeviceMapService {
// Adds the MTP device delegate to the map service. |device_location|
// specifies the mount location of the MTP device.
// Called on a media task runner thread.
- void AddDelegate(const FilePath::StringType& device_location,
+ void AddDelegate(const base::FilePath::StringType& device_location,
MTPDeviceDelegate* delegate);
// Removes the MTP device delegate from the map service. |device_location|
// specifies the mount location of the MTP device.
// Called on the UI thread.
- void RemoveDelegate(const FilePath::StringType& device_location);
+ void RemoveDelegate(const base::FilePath::StringType& device_location);
// Gets the media device delegate associated with |filesystem_id|.
// Return NULL if the |filesystem_id| is no longer valid (e.g. because the
@@ -47,7 +47,7 @@ class WEBKIT_STORAGE_EXPORT MTPDeviceMapService {
// Mapping of device_location and MTPDeviceDelegate* object. It is safe to
// store and access the raw pointer. This class operates on the IO thread.
- typedef std::map<FilePath::StringType, MTPDeviceDelegate*> DelegateMap;
+ typedef std::map<base::FilePath::StringType, MTPDeviceDelegate*> DelegateMap;
// Get access to this class using GetInstance() method.
MTPDeviceMapService();
diff --git a/webkit/fileapi/media/native_media_file_util.cc b/webkit/fileapi/media/native_media_file_util.cc
index 6f7c53c..115278c 100644
--- a/webkit/fileapi/media/native_media_file_util.cc
+++ b/webkit/fileapi/media/native_media_file_util.cc
@@ -31,7 +31,7 @@ PlatformFileError NativeMediaFileUtil::CreateOrOpen(
PlatformFileError NativeMediaFileUtil::EnsureFileExists(
FileSystemOperationContext* context,
const FileSystemURL& url, bool* created) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetFilteredLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -55,7 +55,7 @@ PlatformFileError NativeMediaFileUtil::Touch(
const FileSystemURL& url,
const base::Time& last_access_time,
const base::Time& last_modified_time) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetFilteredLocalFilePathForExistingFileOrDirectory(
context,
url,
@@ -71,7 +71,7 @@ PlatformFileError NativeMediaFileUtil::Truncate(
FileSystemOperationContext* context,
const FileSystemURL& url,
int64 length) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetFilteredLocalFilePathForExistingFileOrDirectory(
context,
url,
@@ -88,7 +88,7 @@ PlatformFileError NativeMediaFileUtil::CopyOrMoveFile(
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
bool copy) {
- FilePath src_file_path;
+ base::FilePath src_file_path;
PlatformFileError error =
GetFilteredLocalFilePathForExistingFileOrDirectory(
context, src_url,
@@ -99,7 +99,7 @@ PlatformFileError NativeMediaFileUtil::CopyOrMoveFile(
if (NativeFileUtil::DirectoryExists(src_file_path))
return base::PLATFORM_FILE_ERROR_NOT_A_FILE;
- FilePath dest_file_path;
+ base::FilePath dest_file_path;
error = GetLocalFilePath(context, dest_url, &dest_file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -118,12 +118,12 @@ PlatformFileError NativeMediaFileUtil::CopyOrMoveFile(
PlatformFileError NativeMediaFileUtil::CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) {
if (src_file_path.empty())
return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
- FilePath dest_file_path;
+ base::FilePath dest_file_path;
PlatformFileError error =
GetFilteredLocalFilePath(context, dest_url, &dest_file_path);
if (error != base::PLATFORM_FILE_OK)
@@ -134,7 +134,7 @@ PlatformFileError NativeMediaFileUtil::CopyInForeignFile(
PlatformFileError NativeMediaFileUtil::DeleteFile(
FileSystemOperationContext* context,
const FileSystemURL& url) {
- FilePath file_path;
+ base::FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
@@ -153,7 +153,7 @@ PlatformFileError NativeMediaFileUtil::GetFileInfo(
FileSystemOperationContext* context,
const FileSystemURL& url,
PlatformFileInfo* file_info,
- FilePath* platform_path) {
+ base::FilePath* platform_path) {
DCHECK(context);
DCHECK(context->media_path_filter());
DCHECK(file_info);
@@ -174,8 +174,8 @@ PlatformFileError NativeMediaFileUtil::GetFileInfo(
PlatformFileError NativeMediaFileUtil::GetFilteredLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path) {
- FilePath file_path;
+ base::FilePath* local_file_path) {
+ base::FilePath file_path;
PlatformFileError error =
IsolatedFileUtil::GetLocalFilePath(context, file_system_url, &file_path);
if (error != base::PLATFORM_FILE_OK)
@@ -192,8 +192,8 @@ NativeMediaFileUtil::GetFilteredLocalFilePathForExistingFileOrDirectory(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
PlatformFileError failure_error,
- FilePath* local_file_path) {
- FilePath file_path;
+ base::FilePath* local_file_path) {
+ base::FilePath file_path;
PlatformFileError error =
GetLocalFilePath(context, file_system_url, &file_path);
if (error != base::PLATFORM_FILE_OK)
diff --git a/webkit/fileapi/media/native_media_file_util.h b/webkit/fileapi/media/native_media_file_util.h
index 97b0999..b1e3573 100644
--- a/webkit/fileapi/media/native_media_file_util.h
+++ b/webkit/fileapi/media/native_media_file_util.h
@@ -48,7 +48,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil
bool copy) OVERRIDE;
virtual base::PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) OVERRIDE;
virtual base::PlatformFileError DeleteFile(
FileSystemOperationContext* context,
@@ -57,7 +57,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path) OVERRIDE;
+ base::FilePath* platform_path) OVERRIDE;
private:
// Like GetLocalFilePath(), but always take media_path_filter() into
@@ -66,7 +66,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil
base::PlatformFileError GetFilteredLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_file_path);
+ base::FilePath* local_file_path);
// Like GetLocalFilePath(), but if the file does not exist, then return
// |failure_error|.
@@ -78,7 +78,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
base::PlatformFileError failure_error,
- FilePath* local_file_path);
+ base::FilePath* local_file_path);
DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil);
};
diff --git a/webkit/fileapi/media/native_media_file_util_unittest.cc b/webkit/fileapi/media/native_media_file_util_unittest.cc
index 8fab4d3..f98379b 100644
--- a/webkit/fileapi/media/native_media_file_util_unittest.cc
+++ b/webkit/fileapi/media/native_media_file_util_unittest.cc
@@ -32,7 +32,7 @@ namespace {
typedef FileSystemOperation::FileEntryList FileEntryList;
struct FilteringTestCase {
- const FilePath::CharType* path;
+ const base::FilePath::CharType* path;
bool is_directory;
bool visible;
};
@@ -62,13 +62,13 @@ void ExpectMetadataEqHelper(const std::string& test_name,
bool expected_is_directory,
base::PlatformFileError actual,
const base::PlatformFileInfo& file_info,
- const FilePath& /*platform_path*/) {
+ const base::FilePath& /*platform_path*/) {
EXPECT_EQ(expected, actual) << test_name;
if (actual == base::PLATFORM_FILE_OK)
EXPECT_EQ(expected_is_directory, file_info.is_directory) << test_name;
}
-void DidReadDirectory(std::set<FilePath::StringType>* content,
+void DidReadDirectory(std::set<base::FilePath::StringType>* content,
bool* completed,
base::PlatformFileError error,
const FileEntryList& file_list,
@@ -80,11 +80,11 @@ void DidReadDirectory(std::set<FilePath::StringType>* content,
EXPECT_TRUE(content->insert(itr->name).second);
}
-void PopulateDirectoryWithTestCases(const FilePath& dir,
+void PopulateDirectoryWithTestCases(const base::FilePath& dir,
const FilteringTestCase* test_cases,
size_t n) {
for (size_t i = 0; i < n; ++i) {
- FilePath path = dir.Append(test_cases[i].path);
+ base::FilePath path = dir.Append(test_cases[i].path);
if (test_cases[i].is_directory) {
ASSERT_TRUE(file_util::CreateDirectory(path));
} else {
@@ -138,7 +138,7 @@ class NativeMediaFileUtilTest : public testing::Test {
return file_system_context_.get();
}
- FileSystemURL CreateURL(const FilePath::CharType* test_case_path) {
+ FileSystemURL CreateURL(const base::FilePath::CharType* test_case_path) {
return file_system_context_->CreateCrackedFileSystemURL(
origin(),
fileapi::kFileSystemTypeIsolated,
@@ -149,14 +149,14 @@ class NativeMediaFileUtilTest : public testing::Test {
return IsolatedContext::GetInstance();
}
- FilePath root_path() {
+ base::FilePath root_path() {
return data_dir_.path().Append(FPL("Media Directory"));
}
- FilePath GetVirtualPath(const FilePath::CharType* test_case_path) {
- return FilePath::FromUTF8Unsafe(filesystem_id_).
+ base::FilePath GetVirtualPath(const base::FilePath::CharType* test_case_path) {
+ return base::FilePath::FromUTF8Unsafe(filesystem_id_).
Append(FPL("Media Directory")).
- Append(FilePath(test_case_path));
+ Append(base::FilePath(test_case_path));
}
FileSystemFileUtil* file_util() {
@@ -219,7 +219,7 @@ TEST_F(NativeMediaFileUtilTest, ReadDirectoryFiltering) {
kFilteringTestCases,
arraysize(kFilteringTestCases));
- std::set<FilePath::StringType> content;
+ std::set<base::FilePath::StringType> content;
FileSystemURL url = CreateURL(FPL(""));
bool completed = false;
NewOperation(url)->ReadDirectory(
@@ -229,9 +229,9 @@ TEST_F(NativeMediaFileUtilTest, ReadDirectoryFiltering) {
EXPECT_EQ(5u, content.size());
for (size_t i = 0; i < arraysize(kFilteringTestCases); ++i) {
- FilePath::StringType name =
- FilePath(kFilteringTestCases[i].path).BaseName().value();
- std::set<FilePath::StringType>::const_iterator found = content.find(name);
+ base::FilePath::StringType name =
+ base::FilePath(kFilteringTestCases[i].path).BaseName().value();
+ std::set<base::FilePath::StringType>::const_iterator found = content.find(name);
EXPECT_EQ(kFilteringTestCases[i].visible, found != content.end());
}
}
@@ -267,7 +267,7 @@ TEST_F(NativeMediaFileUtilTest, CreateFileAndCreateDirectoryFiltering) {
}
TEST_F(NativeMediaFileUtilTest, CopySourceFiltering) {
- FilePath dest_path = root_path().AppendASCII("dest");
+ base::FilePath dest_path = root_path().AppendASCII("dest");
FileSystemURL dest_url = CreateURL(FPL("dest"));
// Run the loop twice. The first run has no source files. The second run does.
@@ -320,7 +320,7 @@ TEST_F(NativeMediaFileUtilTest, CopyDestFiltering) {
}
// Always create a dummy source data file.
- FilePath src_path = root_path().AppendASCII("foo.jpg");
+ base::FilePath src_path = root_path().AppendASCII("foo.jpg");
FileSystemURL src_url = CreateURL(FPL("foo.jpg"));
static const char kDummyData[] = "dummy";
ASSERT_TRUE(file_util::WriteFile(src_path, kDummyData, strlen(kDummyData)));
@@ -372,7 +372,7 @@ TEST_F(NativeMediaFileUtilTest, CopyDestFiltering) {
}
TEST_F(NativeMediaFileUtilTest, MoveSourceFiltering) {
- FilePath dest_path = root_path().AppendASCII("dest");
+ base::FilePath dest_path = root_path().AppendASCII("dest");
FileSystemURL dest_url = CreateURL(FPL("dest"));
// Run the loop twice. The first run has no source files. The second run does.
@@ -434,7 +434,7 @@ TEST_F(NativeMediaFileUtilTest, MoveDestFiltering) {
}
// Create the source file for every test case because it might get moved.
- FilePath src_path = root_path().AppendASCII("foo.jpg");
+ base::FilePath src_path = root_path().AppendASCII("foo.jpg");
FileSystemURL src_url = CreateURL(FPL("foo.jpg"));
static const char kDummyData[] = "dummy";
ASSERT_TRUE(
diff --git a/webkit/fileapi/mount_points.cc b/webkit/fileapi/mount_points.cc
index d754b25..fbd881d 100644
--- a/webkit/fileapi/mount_points.cc
+++ b/webkit/fileapi/mount_points.cc
@@ -8,7 +8,7 @@ namespace fileapi {
MountPoints::MountPointInfo::MountPointInfo() {}
MountPoints::MountPointInfo::MountPointInfo(
- const std::string& name, const FilePath& path)
+ const std::string& name, const base::FilePath& path)
: name(name), path(path) {}
} // namespace fileapi
diff --git a/webkit/fileapi/mount_points.h b/webkit/fileapi/mount_points.h
index 27df0f2..30779bb 100644
--- a/webkit/fileapi/mount_points.h
+++ b/webkit/fileapi/mount_points.h
@@ -26,7 +26,7 @@ class WEBKIT_STORAGE_EXPORT MountPoints {
public:
struct WEBKIT_STORAGE_EXPORT MountPointInfo {
MountPointInfo();
- MountPointInfo(const std::string& name, const FilePath& path);
+ MountPointInfo(const std::string& name, const base::FilePath& path);
// The name to be used to register the path. The registered file can
// be referred by a virtual path /<filesystem_id>/<name>.
@@ -34,7 +34,7 @@ class WEBKIT_STORAGE_EXPORT MountPoints {
std::string name;
// The path of the file.
- FilePath path;
+ base::FilePath path;
// For STL operation.
bool operator<(const MountPointInfo& that) const {
@@ -65,12 +65,12 @@ class WEBKIT_STORAGE_EXPORT MountPoints {
virtual FileSystemURL CreateCrackedFileSystemURL(
const GURL& origin,
fileapi::FileSystemType type,
- const FilePath& path) const = 0;
+ const base::FilePath& path) const = 0;
// Returns the mount point root path registered for a given |mount_name|.
// Returns false if the given |mount_name| is not valid.
virtual bool GetRegisteredPath(const std::string& mount_name,
- FilePath* path) const = 0;
+ base::FilePath* path) const = 0;
// Cracks the given |virtual_path| (which is the path part of a filesystem URL
// without '/external' or '/isolated' prefix part) and populates the
@@ -83,10 +83,10 @@ class WEBKIT_STORAGE_EXPORT MountPoints {
// Note that |path| is set to empty paths if the filesystem type is isolated
// and |virtual_path| has no <relative_path> part (i.e. pointing to the
// virtual root).
- virtual bool CrackVirtualPath(const FilePath& virtual_path,
+ virtual bool CrackVirtualPath(const base::FilePath& virtual_path,
std::string* mount_name,
FileSystemType* type,
- FilePath* path) const = 0;
+ base::FilePath* path) const = 0;
private:
DISALLOW_COPY_AND_ASSIGN(MountPoints);
diff --git a/webkit/fileapi/native_file_util.cc b/webkit/fileapi/native_file_util.cc
index 7ee3b04..a794250 100644
--- a/webkit/fileapi/native_file_util.cc
+++ b/webkit/fileapi/native_file_util.cc
@@ -16,7 +16,7 @@ namespace {
// Returns true on success, or false otherwise.
//
// TODO(benchan): Find a better place outside webkit to host this function.
-bool SetPlatformSpecificDirectoryPermissions(const FilePath& dir_path) {
+bool SetPlatformSpecificDirectoryPermissions(const base::FilePath& dir_path) {
#if defined(OS_CHROMEOS)
// System daemons on Chrome OS may run as a user different than the Chrome
// process but need to access files under the directories created here.
@@ -38,7 +38,7 @@ using base::PlatformFileError;
class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
public:
- NativeFileEnumerator(const FilePath& root_path,
+ NativeFileEnumerator(const base::FilePath& root_path,
bool recursive,
int file_type)
: file_enum_(root_path, recursive, file_type) {
@@ -49,7 +49,7 @@ class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
~NativeFileEnumerator() {}
- virtual FilePath Next() OVERRIDE;
+ virtual base::FilePath Next() OVERRIDE;
virtual int64 Size() OVERRIDE;
virtual base::Time LastModifiedTime() OVERRIDE;
virtual bool IsDirectory() OVERRIDE;
@@ -59,8 +59,8 @@ class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator {
file_util::FileEnumerator::FindInfo file_util_info_;
};
-FilePath NativeFileEnumerator::Next() {
- FilePath rv = file_enum_.Next();
+base::FilePath NativeFileEnumerator::Next() {
+ base::FilePath rv = file_enum_.Next();
if (!rv.empty())
file_enum_.GetFindInfo(&file_util_info_);
return rv;
@@ -79,7 +79,7 @@ bool NativeFileEnumerator::IsDirectory() {
}
PlatformFileError NativeFileUtil::CreateOrOpen(
- const FilePath& path, int file_flags,
+ const base::FilePath& path, int file_flags,
PlatformFile* file_handle, bool* created) {
if (!file_util::DirectoryExists(path.DirName())) {
// If its parent does not exist, should return NOT_FOUND error.
@@ -98,7 +98,7 @@ PlatformFileError NativeFileUtil::Close(PlatformFile file_handle) {
}
PlatformFileError NativeFileUtil::EnsureFileExists(
- const FilePath& path,
+ const base::FilePath& path,
bool* created) {
if (!file_util::DirectoryExists(path.DirName()))
// If its parent does not exist, should return NOT_FOUND error.
@@ -122,7 +122,7 @@ PlatformFileError NativeFileUtil::EnsureFileExists(
}
PlatformFileError NativeFileUtil::CreateDirectory(
- const FilePath& path,
+ const base::FilePath& path,
bool exclusive,
bool recursive) {
// If parent dir of file doesn't exist.
@@ -147,7 +147,7 @@ PlatformFileError NativeFileUtil::CreateDirectory(
}
PlatformFileError NativeFileUtil::GetFileInfo(
- const FilePath& path,
+ const base::FilePath& path,
base::PlatformFileInfo* file_info) {
if (!file_util::PathExists(path))
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
@@ -157,7 +157,7 @@ PlatformFileError NativeFileUtil::GetFileInfo(
}
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator>
- NativeFileUtil::CreateFileEnumerator(const FilePath& root_path,
+ NativeFileUtil::CreateFileEnumerator(const base::FilePath& root_path,
bool recursive) {
return make_scoped_ptr(new NativeFileEnumerator(
root_path, recursive,
@@ -167,7 +167,7 @@ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator>
}
PlatformFileError NativeFileUtil::Touch(
- const FilePath& path,
+ const base::FilePath& path,
const base::Time& last_access_time,
const base::Time& last_modified_time) {
if (!file_util::TouchFile(
@@ -176,7 +176,7 @@ PlatformFileError NativeFileUtil::Touch(
return base::PLATFORM_FILE_OK;
}
-PlatformFileError NativeFileUtil::Truncate(const FilePath& path, int64 length) {
+PlatformFileError NativeFileUtil::Truncate(const base::FilePath& path, int64 length) {
PlatformFileError error_code(base::PLATFORM_FILE_ERROR_FAILED);
PlatformFile file =
base::CreatePlatformFile(
@@ -194,17 +194,17 @@ PlatformFileError NativeFileUtil::Truncate(const FilePath& path, int64 length) {
return error_code;
}
-bool NativeFileUtil::PathExists(const FilePath& path) {
+bool NativeFileUtil::PathExists(const base::FilePath& path) {
return file_util::PathExists(path);
}
-bool NativeFileUtil::DirectoryExists(const FilePath& path) {
+bool NativeFileUtil::DirectoryExists(const base::FilePath& path) {
return file_util::DirectoryExists(path);
}
PlatformFileError NativeFileUtil::CopyOrMoveFile(
- const FilePath& src_path,
- const FilePath& dest_path,
+ const base::FilePath& src_path,
+ const base::FilePath& dest_path,
bool copy) {
base::PlatformFileInfo info;
base::PlatformFileError error = NativeFileUtil::GetFileInfo(src_path, &info);
@@ -237,7 +237,7 @@ PlatformFileError NativeFileUtil::CopyOrMoveFile(
return base::PLATFORM_FILE_ERROR_FAILED;
}
-PlatformFileError NativeFileUtil::DeleteFile(const FilePath& path) {
+PlatformFileError NativeFileUtil::DeleteFile(const base::FilePath& path) {
if (!file_util::PathExists(path))
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
if (file_util::DirectoryExists(path))
@@ -247,7 +247,7 @@ PlatformFileError NativeFileUtil::DeleteFile(const FilePath& path) {
return base::PLATFORM_FILE_OK;
}
-PlatformFileError NativeFileUtil::DeleteDirectory(const FilePath& path) {
+PlatformFileError NativeFileUtil::DeleteDirectory(const base::FilePath& path) {
if (!file_util::PathExists(path))
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
if (!file_util::DirectoryExists(path))
diff --git a/webkit/fileapi/native_file_util.h b/webkit/fileapi/native_file_util.h
index 075d27b..55f3297 100644
--- a/webkit/fileapi/native_file_util.h
+++ b/webkit/fileapi/native_file_util.h
@@ -33,32 +33,32 @@ namespace fileapi {
class WEBKIT_STORAGE_EXPORT_PRIVATE NativeFileUtil {
public:
static base::PlatformFileError CreateOrOpen(
- const FilePath& path,
+ const base::FilePath& path,
int file_flags,
base::PlatformFile* file_handle,
bool* created);
static base::PlatformFileError Close(base::PlatformFile file);
- static base::PlatformFileError EnsureFileExists(const FilePath& path,
+ static base::PlatformFileError EnsureFileExists(const base::FilePath& path,
bool* created);
- static base::PlatformFileError CreateDirectory(const FilePath& path,
+ static base::PlatformFileError CreateDirectory(const base::FilePath& path,
bool exclusive,
bool recursive);
- static base::PlatformFileError GetFileInfo(const FilePath& path,
+ static base::PlatformFileError GetFileInfo(const base::FilePath& path,
base::PlatformFileInfo* file_info);
static scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator>
- CreateFileEnumerator(const FilePath& root_path,
+ CreateFileEnumerator(const base::FilePath& root_path,
bool recursive);
- static base::PlatformFileError Touch(const FilePath& path,
+ static base::PlatformFileError Touch(const base::FilePath& path,
const base::Time& last_access_time,
const base::Time& last_modified_time);
- static base::PlatformFileError Truncate(const FilePath& path, int64 length);
- static bool PathExists(const FilePath& path);
- static bool DirectoryExists(const FilePath& path);
- static base::PlatformFileError CopyOrMoveFile(const FilePath& src_path,
- const FilePath& dest_path,
+ static base::PlatformFileError Truncate(const base::FilePath& path, int64 length);
+ static bool PathExists(const base::FilePath& path);
+ static bool DirectoryExists(const base::FilePath& path);
+ static base::PlatformFileError CopyOrMoveFile(const base::FilePath& src_path,
+ const base::FilePath& dest_path,
bool copy);
- static base::PlatformFileError DeleteFile(const FilePath& path);
- static base::PlatformFileError DeleteDirectory(const FilePath& path);
+ static base::PlatformFileError DeleteFile(const base::FilePath& path);
+ static base::PlatformFileError DeleteDirectory(const base::FilePath& path);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(NativeFileUtil);
diff --git a/webkit/fileapi/obfuscated_file_util.cc b/webkit/fileapi/obfuscated_file_util.cc
index dd75118..657eef1 100644
--- a/webkit/fileapi/obfuscated_file_util.cc
+++ b/webkit/fileapi/obfuscated_file_util.cc
@@ -28,8 +28,8 @@
// Example of various paths:
// void ObfuscatedFileUtil::DoSomething(const FileSystemURL& url) {
-// FilePath virtual_path = url.path();
-// FilePath local_path = GetLocalFilePath(url);
+// base::FilePath virtual_path = url.path();
+// base::FilePath local_path = GetLocalFilePath(url);
//
// NativeFileUtil::DoSomething(local_path);
// file_util::DoAnother(local_path);
@@ -47,7 +47,7 @@ const int64 kFlushDelaySeconds = 10 * 60; // 10 minutes
void InitFileInfo(
FileSystemDirectoryDatabase::FileInfo* file_info,
FileSystemDirectoryDatabase::FileId parent_id,
- const FilePath::StringType& file_name) {
+ const base::FilePath::StringType& file_name) {
DCHECK(file_info);
file_info->parent_id = parent_id;
file_info->name = file_name;
@@ -55,7 +55,7 @@ void InitFileInfo(
// Costs computed as per crbug.com/86114, based on the LevelDB implementation of
// path storage under Linux. It's not clear if that will differ on Windows, on
-// which FilePath uses wide chars [since they're converted to UTF-8 for storage
+// which base::FilePath uses wide chars [since they're converted to UTF-8 for storage
// anyway], but as long as the cost is high enough that one can't cheat on quota
// by storing data in paths, it doesn't need to be all that accurate.
const int64 kPathCreationQuotaCost = 146; // Bytes per inode, basically.
@@ -91,9 +91,9 @@ void TouchDirectory(FileSystemDirectoryDatabase* db, FileId dir_id) {
NOTREACHED();
}
-const FilePath::CharType kTemporaryDirectoryName[] = FILE_PATH_LITERAL("t");
-const FilePath::CharType kPersistentDirectoryName[] = FILE_PATH_LITERAL("p");
-const FilePath::CharType kSyncableDirectoryName[] = FILE_PATH_LITERAL("s");
+const base::FilePath::CharType kTemporaryDirectoryName[] = FILE_PATH_LITERAL("t");
+const base::FilePath::CharType kPersistentDirectoryName[] = FILE_PATH_LITERAL("p");
+const base::FilePath::CharType kSyncableDirectoryName[] = FILE_PATH_LITERAL("s");
} // namespace
@@ -116,7 +116,7 @@ class ObfuscatedFileEnumerator
type_(root_url.type()),
recursive_(recursive),
current_file_id_(0) {
- FilePath root_virtual_path = root_url.path();
+ base::FilePath root_virtual_path = root_url.path();
FileId file_id;
if (!db_->GetFileWithPath(root_virtual_path, &file_id))
@@ -128,16 +128,16 @@ class ObfuscatedFileEnumerator
virtual ~ObfuscatedFileEnumerator() {}
- virtual FilePath Next() OVERRIDE {
+ virtual base::FilePath Next() OVERRIDE {
ProcessRecurseQueue();
if (display_stack_.empty())
- return FilePath();
+ return base::FilePath();
current_file_id_ = display_stack_.back();
display_stack_.pop_back();
FileInfo file_info;
- FilePath platform_file_path;
+ base::FilePath platform_file_path;
base::PlatformFileError error =
obfuscated_file_util_->GetFileInfoInternal(
db_, context_, origin_, type_, current_file_id_,
@@ -145,7 +145,7 @@ class ObfuscatedFileEnumerator
if (error != base::PLATFORM_FILE_OK)
return Next();
- FilePath virtual_path =
+ base::FilePath virtual_path =
current_parent_virtual_path_.Append(file_info.name);
if (recursive_ && file_info.is_directory()) {
FileRecord record = { current_file_id_, virtual_path };
@@ -172,7 +172,7 @@ class ObfuscatedFileEnumerator
struct FileRecord {
FileId file_id;
- FilePath virtual_path;
+ base::FilePath virtual_path;
};
void ProcessRecurseQueue() {
@@ -196,7 +196,7 @@ class ObfuscatedFileEnumerator
std::queue<FileRecord> recurse_queue_;
std::vector<FileId> display_stack_;
- FilePath current_parent_virtual_path_;
+ base::FilePath current_parent_virtual_path_;
FileId current_file_id_;
base::PlatformFileInfo current_platform_file_info_;
@@ -208,7 +208,7 @@ class ObfuscatedOriginEnumerator
typedef FileSystemOriginDatabase::OriginRecord OriginRecord;
ObfuscatedOriginEnumerator(
FileSystemOriginDatabase* origin_database,
- const FilePath& base_file_path)
+ const base::FilePath& base_file_path)
: base_file_path_(base_file_path) {
if (origin_database)
origin_database->ListAllOrigins(&origins_);
@@ -231,24 +231,24 @@ class ObfuscatedOriginEnumerator
virtual bool HasFileSystemType(FileSystemType type) const OVERRIDE {
if (current_.path.empty())
return false;
- FilePath::StringType type_string =
+ base::FilePath::StringType type_string =
ObfuscatedFileUtil::GetDirectoryNameForType(type);
if (type_string.empty()) {
NOTREACHED();
return false;
}
- FilePath path = base_file_path_.Append(current_.path).Append(type_string);
+ base::FilePath path = base_file_path_.Append(current_.path).Append(type_string);
return file_util::DirectoryExists(path);
}
private:
std::vector<OriginRecord> origins_;
OriginRecord current_;
- FilePath base_file_path_;
+ base::FilePath base_file_path_;
};
ObfuscatedFileUtil::ObfuscatedFileUtil(
- const FilePath& file_system_directory)
+ const base::FilePath& file_system_directory)
: file_system_directory_(file_system_directory) {
}
@@ -285,7 +285,7 @@ PlatformFileError ObfuscatedFileUtil::CreateOrOpen(
if (!AllocateQuota(context, growth))
return base::PLATFORM_FILE_ERROR_NO_SPACE;
PlatformFileError error = CreateFile(
- context, FilePath(),
+ context, base::FilePath(),
url.origin(), url.type(), &file_info,
file_flags, file_handle);
if (created && base::PLATFORM_FILE_OK == error) {
@@ -301,7 +301,7 @@ PlatformFileError ObfuscatedFileUtil::CreateOrOpen(
return base::PLATFORM_FILE_ERROR_EXISTS;
base::PlatformFileInfo platform_file_info;
- FilePath local_path;
+ base::FilePath local_path;
FileInfo file_info;
base::PlatformFileError error = GetFileInfoInternal(
db, context, url.origin(), url.type(), file_id,
@@ -378,7 +378,7 @@ PlatformFileError ObfuscatedFileUtil::EnsureFileExists(
if (!AllocateQuota(context, growth))
return base::PLATFORM_FILE_ERROR_NO_SPACE;
PlatformFileError error = CreateFile(
- context, FilePath(), url.origin(), url.type(), &file_info, 0, NULL);
+ context, base::FilePath(), url.origin(), url.type(), &file_info, 0, NULL);
if (created && base::PLATFORM_FILE_OK == error) {
*created = true;
UpdateUsage(context, url, growth);
@@ -421,12 +421,12 @@ PlatformFileError ObfuscatedFileUtil::CreateDirectory(
return base::PLATFORM_FILE_OK;
}
- std::vector<FilePath::StringType> components;
+ std::vector<base::FilePath::StringType> components;
VirtualPath::GetComponents(url.path(), &components);
FileId parent_id = 0;
size_t index;
for (index = 0; index < components.size(); ++index) {
- FilePath::StringType name = components[index];
+ base::FilePath::StringType name = components[index];
if (name == FILE_PATH_LITERAL("/"))
continue;
if (!db->GetChildWithName(parent_id, name, &parent_id))
@@ -464,7 +464,7 @@ PlatformFileError ObfuscatedFileUtil::GetFileInfo(
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_file_path) {
+ base::FilePath* platform_file_path) {
FileSystemDirectoryDatabase* db = GetDirectoryDatabase(
url.origin(), url.type(), false);
if (!db)
@@ -498,7 +498,7 @@ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator>
PlatformFileError ObfuscatedFileUtil::GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& url,
- FilePath* local_path) {
+ base::FilePath* local_path) {
FileSystemDirectoryDatabase* db = GetDirectoryDatabase(
url.origin(), url.type(), false);
if (!db)
@@ -543,7 +543,7 @@ PlatformFileError ObfuscatedFileUtil::Touch(
return base::PLATFORM_FILE_ERROR_FAILED;
return base::PLATFORM_FILE_OK;
}
- FilePath local_path = DataPathToLocalPath(
+ base::FilePath local_path = DataPathToLocalPath(
url.origin(), url.type(), file_info.data_path);
return NativeFileUtil::Touch(
local_path, last_access_time, last_modified_time);
@@ -554,7 +554,7 @@ PlatformFileError ObfuscatedFileUtil::Truncate(
const FileSystemURL& url,
int64 length) {
base::PlatformFileInfo file_info;
- FilePath local_path;
+ base::FilePath local_path;
base::PlatformFileError error =
GetFileInfo(context, url, &file_info, &local_path);
if (error != base::PLATFORM_FILE_OK)
@@ -596,7 +596,7 @@ PlatformFileError ObfuscatedFileUtil::CopyOrMoveFile(
FileInfo src_file_info;
base::PlatformFileInfo src_platform_file_info;
- FilePath src_local_path;
+ base::FilePath src_local_path;
base::PlatformFileError error = GetFileInfoInternal(
db, context, src_url.origin(), src_url.type(), src_file_id,
&src_file_info, &src_platform_file_info, &src_local_path);
@@ -607,7 +607,7 @@ PlatformFileError ObfuscatedFileUtil::CopyOrMoveFile(
FileInfo dest_file_info;
base::PlatformFileInfo dest_platform_file_info; // overwrite case only
- FilePath dest_local_path; // overwrite case only
+ base::FilePath dest_local_path; // overwrite case only
if (overwrite) {
base::PlatformFileError error = GetFileInfoInternal(
db, context, dest_url.origin(), dest_url.type(), dest_file_id,
@@ -715,7 +715,7 @@ PlatformFileError ObfuscatedFileUtil::CopyOrMoveFile(
PlatformFileError ObfuscatedFileUtil::CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) {
FileSystemDirectoryDatabase* db = GetDirectoryDatabase(
dest_url.origin(), dest_url.type(), true);
@@ -733,7 +733,7 @@ PlatformFileError ObfuscatedFileUtil::CopyInForeignFile(
FileInfo dest_file_info;
base::PlatformFileInfo dest_platform_file_info; // overwrite case only
if (overwrite) {
- FilePath dest_local_path;
+ base::FilePath dest_local_path;
base::PlatformFileError error = GetFileInfoInternal(
db, context, dest_url.origin(), dest_url.type(), dest_file_id,
&dest_file_info, &dest_platform_file_info, &dest_local_path);
@@ -766,7 +766,7 @@ PlatformFileError ObfuscatedFileUtil::CopyInForeignFile(
base::PlatformFileError error;
if (overwrite) {
- FilePath dest_local_path = DataPathToLocalPath(
+ base::FilePath dest_local_path = DataPathToLocalPath(
dest_url.origin(), dest_url.type(), dest_file_info.data_path);
error = NativeFileUtil::CopyOrMoveFile(
src_file_path, dest_local_path, true);
@@ -805,7 +805,7 @@ PlatformFileError ObfuscatedFileUtil::DeleteFile(
FileInfo file_info;
base::PlatformFileInfo platform_file_info;
- FilePath local_path;
+ base::FilePath local_path;
base::PlatformFileError error = GetFileInfoInternal(
db, context, url.origin(), url.type(), file_id,
&file_info, &platform_file_info, &local_path);
@@ -870,7 +870,7 @@ base::PlatformFileError ObfuscatedFileUtil::CreateSnapshotFile(
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
SnapshotFilePolicy* policy) {
DCHECK(policy);
// We're just returning the local file information.
@@ -909,23 +909,23 @@ bool ObfuscatedFileUtil::IsDirectoryEmpty(
return children.empty();
}
-FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType(
+base::FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType(
const GURL& origin,
FileSystemType type,
bool create,
base::PlatformFileError* error_code) {
- FilePath origin_dir = GetDirectoryForOrigin(origin, create, error_code);
+ base::FilePath origin_dir = GetDirectoryForOrigin(origin, create, error_code);
if (origin_dir.empty())
- return FilePath();
- FilePath::StringType type_string = GetDirectoryNameForType(type);
+ return base::FilePath();
+ base::FilePath::StringType type_string = GetDirectoryNameForType(type);
if (type_string.empty()) {
LOG(WARNING) << "Unknown filesystem type requested:" << type;
if (error_code)
*error_code = base::PLATFORM_FILE_ERROR_INVALID_URL;
- return FilePath();
+ return base::FilePath();
}
- FilePath path = origin_dir.Append(type_string);
+ base::FilePath path = origin_dir.Append(type_string);
base::PlatformFileError error = base::PLATFORM_FILE_OK;
if (!file_util::DirectoryExists(path) &&
(!create || !file_util::CreateDirectory(path))) {
@@ -942,7 +942,7 @@ FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType(
bool ObfuscatedFileUtil::DeleteDirectoryForOriginAndType(
const GURL& origin, FileSystemType type) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath origin_type_path = GetDirectoryForOriginAndType(origin, type, false,
+ base::FilePath origin_type_path = GetDirectoryForOriginAndType(origin, type, false,
&error);
if (origin_type_path.empty())
return true;
@@ -958,7 +958,7 @@ bool ObfuscatedFileUtil::DeleteDirectoryForOriginAndType(
return false;
}
- FilePath origin_path = origin_type_path.DirName();
+ base::FilePath origin_path = origin_type_path.DirName();
DCHECK_EQ(origin_path.value(),
GetDirectoryForOrigin(origin, false, NULL).value());
@@ -992,7 +992,7 @@ bool ObfuscatedFileUtil::DeleteDirectoryForOriginAndType(
}
// static
-FilePath::StringType ObfuscatedFileUtil::GetDirectoryNameForType(
+base::FilePath::StringType ObfuscatedFileUtil::GetDirectoryNameForType(
FileSystemType type) {
switch (type) {
case kFileSystemTypeTemporary:
@@ -1003,7 +1003,7 @@ FilePath::StringType ObfuscatedFileUtil::GetDirectoryNameForType(
return kSyncableDirectoryName;
case kFileSystemTypeUnknown:
default:
- return FilePath::StringType();
+ return base::FilePath::StringType();
}
}
@@ -1032,14 +1032,14 @@ bool ObfuscatedFileUtil::DestroyDirectoryDatabase(
}
PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath path = GetDirectoryForOriginAndType(origin, type, false, &error);
+ base::FilePath path = GetDirectoryForOriginAndType(origin, type, false, &error);
if (path.empty() || error == base::PLATFORM_FILE_ERROR_NOT_FOUND)
return true;
return FileSystemDirectoryDatabase::DestroyDatabase(path);
}
// static
-int64 ObfuscatedFileUtil::ComputeFilePathCost(const FilePath& path) {
+int64 ObfuscatedFileUtil::ComputeFilePathCost(const base::FilePath& path) {
return UsageForPath(VirtualPath::BaseName(path).value().size());
}
@@ -1051,7 +1051,7 @@ PlatformFileError ObfuscatedFileUtil::GetFileInfoInternal(
FileId file_id,
FileInfo* local_info,
base::PlatformFileInfo* file_info,
- FilePath* platform_file_path) {
+ base::FilePath* platform_file_path) {
DCHECK(db);
DCHECK(context);
DCHECK(file_info);
@@ -1067,13 +1067,13 @@ PlatformFileError ObfuscatedFileUtil::GetFileInfoInternal(
file_info->is_directory = true;
file_info->is_symbolic_link = false;
file_info->last_modified = local_info->modification_time;
- *platform_file_path = FilePath();
+ *platform_file_path = base::FilePath();
// We don't fill in ctime or atime.
return base::PLATFORM_FILE_OK;
}
if (local_info->data_path.empty())
return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
- FilePath local_path = DataPathToLocalPath(
+ base::FilePath local_path = DataPathToLocalPath(
origin, type, local_info->data_path);
base::PlatformFileError error = NativeFileUtil::GetFileInfo(
local_path, file_info);
@@ -1095,7 +1095,7 @@ PlatformFileError ObfuscatedFileUtil::GetFileInfoInternal(
PlatformFileError ObfuscatedFileUtil::CreateFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const GURL& dest_origin,
FileSystemType dest_type,
FileInfo* dest_file_info, int file_flags, PlatformFile* handle) {
@@ -1105,12 +1105,12 @@ PlatformFileError ObfuscatedFileUtil::CreateFile(
dest_origin, dest_type, true);
PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath root = GetDirectoryForOriginAndType(dest_origin, dest_type, false,
+ base::FilePath root = GetDirectoryForOriginAndType(dest_origin, dest_type, false,
&error);
if (error != base::PLATFORM_FILE_OK)
return error;
- FilePath dest_local_path;
+ base::FilePath dest_local_path;
error = GenerateNewLocalPath(db, context, dest_origin, dest_type,
&dest_local_path);
if (error != base::PLATFORM_FILE_OK)
@@ -1157,7 +1157,7 @@ PlatformFileError ObfuscatedFileUtil::CreateFile(
// This removes the root, including the trailing slash, leaving a relative
// path.
- dest_file_info->data_path = FilePath(
+ dest_file_info->data_path = base::FilePath(
dest_local_path.value().substr(root.value().length() + 1));
FileId file_id;
@@ -1174,12 +1174,12 @@ PlatformFileError ObfuscatedFileUtil::CreateFile(
return base::PLATFORM_FILE_OK;
}
-FilePath ObfuscatedFileUtil::DataPathToLocalPath(
- const GURL& origin, FileSystemType type, const FilePath& data_path) {
+base::FilePath ObfuscatedFileUtil::DataPathToLocalPath(
+ const GURL& origin, FileSystemType type, const base::FilePath& data_path) {
PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath root = GetDirectoryForOriginAndType(origin, type, false, &error);
+ base::FilePath root = GetDirectoryForOriginAndType(origin, type, false, &error);
if (error != base::PLATFORM_FILE_OK)
- return FilePath();
+ return base::FilePath();
return root.Append(data_path);
}
@@ -1202,7 +1202,7 @@ FileSystemDirectoryDatabase* ObfuscatedFileUtil::GetDirectoryDatabase(
}
PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath path = GetDirectoryForOriginAndType(origin, type, create, &error);
+ base::FilePath path = GetDirectoryForOriginAndType(origin, type, create, &error);
if (error != base::PLATFORM_FILE_OK) {
LOG(WARNING) << "Failed to get origin+type directory: " << path.value();
return NULL;
@@ -1213,7 +1213,7 @@ FileSystemDirectoryDatabase* ObfuscatedFileUtil::GetDirectoryDatabase(
return database;
}
-FilePath ObfuscatedFileUtil::GetDirectoryForOrigin(
+base::FilePath ObfuscatedFileUtil::GetDirectoryForOrigin(
const GURL& origin, bool create, base::PlatformFileError* error_code) {
if (!InitOriginDatabase(create)) {
if (error_code) {
@@ -1221,30 +1221,30 @@ FilePath ObfuscatedFileUtil::GetDirectoryForOrigin(
base::PLATFORM_FILE_ERROR_FAILED :
base::PLATFORM_FILE_ERROR_NOT_FOUND;
}
- return FilePath();
+ return base::FilePath();
}
- FilePath directory_name;
+ base::FilePath directory_name;
std::string id = GetOriginIdentifierFromURL(origin);
bool exists_in_db = origin_database_->HasOriginPath(id);
if (!exists_in_db && !create) {
if (error_code)
*error_code = base::PLATFORM_FILE_ERROR_NOT_FOUND;
- return FilePath();
+ return base::FilePath();
}
if (!origin_database_->GetPathForOrigin(id, &directory_name)) {
if (error_code)
*error_code = base::PLATFORM_FILE_ERROR_FAILED;
- return FilePath();
+ return base::FilePath();
}
- FilePath path = file_system_directory_.Append(directory_name);
+ base::FilePath path = file_system_directory_.Append(directory_name);
bool exists_in_fs = file_util::DirectoryExists(path);
if (!exists_in_db && exists_in_fs) {
if (!file_util::Delete(path, true)) {
if (error_code)
*error_code = base::PLATFORM_FILE_ERROR_FAILED;
- return FilePath();
+ return base::FilePath();
}
exists_in_fs = false;
}
@@ -1255,7 +1255,7 @@ FilePath ObfuscatedFileUtil::GetDirectoryForOrigin(
*error_code = create ?
base::PLATFORM_FILE_ERROR_FAILED :
base::PLATFORM_FILE_ERROR_NOT_FOUND;
- return FilePath();
+ return base::FilePath();
}
}
@@ -1308,15 +1308,15 @@ PlatformFileError ObfuscatedFileUtil::GenerateNewLocalPath(
FileSystemOperationContext* context,
const GURL& origin,
FileSystemType type,
- FilePath* local_path) {
+ base::FilePath* local_path) {
DCHECK(local_path);
int64 number;
if (!db || !db->GetNextInteger(&number))
return base::PLATFORM_FILE_ERROR_FAILED;
PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath new_local_path = GetDirectoryForOriginAndType(origin, type, false,
- &error);
+ base::FilePath new_local_path = GetDirectoryForOriginAndType(origin, type,
+ false, &error);
if (error != base::PLATFORM_FILE_OK)
return base::PLATFORM_FILE_ERROR_FAILED;
diff --git a/webkit/fileapi/obfuscated_file_util.h b/webkit/fileapi/obfuscated_file_util.h
index 88fc441..f9d770b 100644
--- a/webkit/fileapi/obfuscated_file_util.h
+++ b/webkit/fileapi/obfuscated_file_util.h
@@ -55,7 +55,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
virtual bool HasFileSystemType(FileSystemType type) const = 0;
};
- explicit ObfuscatedFileUtil(const FilePath& file_system_directory);
+ explicit ObfuscatedFileUtil(const base::FilePath& file_system_directory);
virtual ~ObfuscatedFileUtil();
// FileSystemFileUtil overrides.
@@ -80,7 +80,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_file) OVERRIDE;
+ base::FilePath* platform_file) OVERRIDE;
virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator(
FileSystemOperationContext* context,
const FileSystemURL& root_url,
@@ -88,7 +88,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
virtual base::PlatformFileError GetLocalFilePath(
FileSystemOperationContext* context,
const FileSystemURL& file_system_url,
- FilePath* local_path) OVERRIDE;
+ base::FilePath* local_path) OVERRIDE;
virtual base::PlatformFileError Touch(
FileSystemOperationContext* context,
const FileSystemURL& url,
@@ -105,7 +105,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
bool copy) OVERRIDE;
virtual base::PlatformFileError CopyInForeignFile(
FileSystemOperationContext* context,
- const FilePath& src_file_path,
+ const base::FilePath& src_file_path,
const FileSystemURL& dest_url) OVERRIDE;
virtual base::PlatformFileError DeleteFile(
FileSystemOperationContext* context,
@@ -117,7 +117,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
FileSystemOperationContext* context,
const FileSystemURL& url,
base::PlatformFileInfo* file_info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
SnapshotFilePolicy* policy) OVERRIDE;
// Returns true if the directory |url| is empty.
@@ -133,7 +133,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
// there is a file system error (e.g. the directory doesn't exist on disk and
// |create| is false). Callers should always check |error_code| to make sure
// the returned path is usable.
- FilePath GetDirectoryForOriginAndType(
+ base::FilePath GetDirectoryForOriginAndType(
const GURL& origin,
FileSystemType type,
bool create,
@@ -146,7 +146,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
// TODO(ericu): This doesn't really feel like it belongs in this class.
// The previous version lives in FileSystemPathManager, but perhaps
// SandboxMountPointProvider would be better?
- static FilePath::StringType GetDirectoryNameForType(FileSystemType type);
+ static base::FilePath::StringType GetDirectoryNameForType(FileSystemType type);
// This method and all methods of its returned class must be called only on
// the FILE thread. The caller is responsible for deleting the returned
@@ -162,7 +162,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
// this ignores all but the BaseName of the supplied path. In order to
// compute the cost of adding a multi-segment directory recursively, call this
// on each path segment and add the results.
- static int64 ComputeFilePathCost(const FilePath& path);
+ static int64 ComputeFilePathCost(const base::FilePath& path);
private:
typedef FileSystemDirectoryDatabase::FileId FileId;
@@ -178,7 +178,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
FileId file_id,
FileInfo* local_info,
base::PlatformFileInfo* file_info,
- FilePath* platform_file_path);
+ base::FilePath* platform_file_path);
// Creates a new file, both the underlying backing file and the entry in the
// database. |dest_file_info| is an in-out parameter. Supply the name and
@@ -193,7 +193,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
// DCHECK and handle will hold base::kInvalidPlatformFileValue.
base::PlatformFileError CreateFile(
FileSystemOperationContext* context,
- const FilePath& source_file_path,
+ const base::FilePath& source_file_path,
const GURL& dest_origin,
FileSystemType dest_type,
FileInfo* dest_file_info,
@@ -203,10 +203,10 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
// This converts from a relative path [as is stored in the FileInfo.data_path
// field] to an absolute platform path that can be given to the native
// filesystem.
- FilePath DataPathToLocalPath(
+ base::FilePath DataPathToLocalPath(
const GURL& origin,
FileSystemType type,
- const FilePath& data_file_path);
+ const base::FilePath& data_file_path);
// This returns NULL if |create| flag is false and a filesystem does not
// exist for the given |origin_url| and |type|.
@@ -216,7 +216,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
// Gets the topmost directory specific to this origin. This will
// contain both the filesystem type subdirectories.
- FilePath GetDirectoryForOrigin(const GURL& origin,
+ base::FilePath GetDirectoryForOrigin(const GURL& origin,
bool create,
base::PlatformFileError* error_code);
@@ -233,12 +233,12 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil
FileSystemOperationContext* context,
const GURL& origin,
FileSystemType type,
- FilePath* local_path);
+ base::FilePath* local_path);
typedef std::map<std::string, FileSystemDirectoryDatabase*> DirectoryMap;
DirectoryMap directories_;
scoped_ptr<FileSystemOriginDatabase> origin_database_;
- FilePath file_system_directory_;
+ base::FilePath file_system_directory_;
base::OneShotTimer<ObfuscatedFileUtil> timer_;
DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil);
diff --git a/webkit/fileapi/obfuscated_file_util_unittest.cc b/webkit/fileapi/obfuscated_file_util_unittest.cc
index f33bc6b..a481c0c 100644
--- a/webkit/fileapi/obfuscated_file_util_unittest.cc
+++ b/webkit/fileapi/obfuscated_file_util_unittest.cc
@@ -33,11 +33,11 @@ namespace fileapi {
namespace {
-bool FileExists(const FilePath& path) {
+bool FileExists(const base::FilePath& path) {
return file_util::PathExists(path) && !file_util::DirectoryExists(path);
}
-int64 GetSize(const FilePath& path) {
+int64 GetSize(const base::FilePath& path) {
int64 size;
EXPECT_TRUE(file_util::GetFileSize(path, &size));
return size;
@@ -191,7 +191,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
return static_cast<ObfuscatedFileUtil*>(test_helper_.file_util());
}
- const FilePath& test_directory() const {
+ const base::FilePath& test_directory() const {
return data_dir_.path();
}
@@ -234,7 +234,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
bool PathExists(const FileSystemURL& url) {
scoped_ptr<FileSystemOperationContext> context(NewContext(NULL));
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
base::PlatformFileError error = ofu()->GetFileInfo(
context.get(), url, &file_info, &platform_path);
return error == base::PLATFORM_FILE_OK;
@@ -255,7 +255,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
return ObfuscatedFileUtil::ComputeFilePathCost(url.path());
}
- FileSystemURL CreateURL(const FilePath& path) {
+ FileSystemURL CreateURL(const base::FilePath& path) {
return test_helper_.CreateURL(path);
}
@@ -268,12 +268,12 @@ class ObfuscatedFileUtilTest : public testing::Test {
void CheckFileAndCloseHandle(
const FileSystemURL& url, base::PlatformFile file_handle) {
scoped_ptr<FileSystemOperationContext> context(NewContext(NULL));
- FilePath local_path;
+ base::FilePath local_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetLocalFilePath(
context.get(), url, &local_path));
base::PlatformFileInfo file_info0;
- FilePath data_path;
+ base::FilePath data_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetFileInfo(
context.get(), url, &file_info0, &data_path));
EXPECT_EQ(data_path, local_path);
@@ -326,10 +326,10 @@ class ObfuscatedFileUtilTest : public testing::Test {
void ValidateTestDirectory(
const FileSystemURL& root_url,
- const std::set<FilePath::StringType>& files,
- const std::set<FilePath::StringType>& directories) {
+ const std::set<base::FilePath::StringType>& files,
+ const std::set<base::FilePath::StringType>& directories) {
scoped_ptr<FileSystemOperationContext> context;
- std::set<FilePath::StringType>::const_iterator iter;
+ std::set<base::FilePath::StringType>::const_iterator iter;
for (iter = files.begin(); iter != files.end(); ++iter) {
bool created = true;
context.reset(NewContext(NULL));
@@ -390,8 +390,8 @@ class ObfuscatedFileUtilTest : public testing::Test {
void FillTestDirectory(
const FileSystemURL& root_url,
- std::set<FilePath::StringType>* files,
- std::set<FilePath::StringType>* directories) {
+ std::set<base::FilePath::StringType>* files,
+ std::set<base::FilePath::StringType>* directories) {
scoped_ptr<FileSystemOperationContext> context;
context.reset(NewContext(NULL));
std::vector<base::FileUtilProxy::Entry> entries;
@@ -408,7 +408,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
directories->insert(FILE_PATH_LITERAL("fourth"));
directories->insert(FILE_PATH_LITERAL("fifth"));
directories->insert(FILE_PATH_LITERAL("sixth"));
- std::set<FilePath::StringType>::iterator iter;
+ std::set<base::FilePath::StringType>::iterator iter;
for (iter = files->begin(); iter != files->end(); ++iter) {
bool created = false;
context.reset(NewContext(NULL));
@@ -432,8 +432,8 @@ class ObfuscatedFileUtilTest : public testing::Test {
}
void TestReadDirectoryHelper(const FileSystemURL& root_url) {
- std::set<FilePath::StringType> files;
- std::set<FilePath::StringType> directories;
+ std::set<base::FilePath::StringType> files;
+ std::set<base::FilePath::StringType> directories;
FillTestDirectory(root_url, &files, &directories);
scoped_ptr<FileSystemOperationContext> context;
@@ -448,7 +448,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
for (entry_iter = entries.begin(); entry_iter != entries.end();
++entry_iter) {
const base::FileUtilProxy::Entry& entry = *entry_iter;
- std::set<FilePath::StringType>::iterator iter = files.find(entry.name);
+ std::set<base::FilePath::StringType>::iterator iter = files.find(entry.name);
if (iter != files.end()) {
EXPECT_FALSE(entry.is_directory);
files.erase(iter);
@@ -471,7 +471,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
context.get(), url, last_access_time, last_modified_time));
// Currently we fire no change notifications for Touch.
EXPECT_TRUE(change_observer()->HasNoChange());
- FilePath local_path;
+ base::FilePath local_path;
base::PlatformFileInfo file_info;
context.reset(NewContext(NULL));
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetFileInfo(
@@ -499,8 +499,8 @@ class ObfuscatedFileUtilTest : public testing::Test {
void TestCopyInForeignFileHelper(bool overwrite) {
base::ScopedTempDir source_dir;
ASSERT_TRUE(source_dir.CreateUniqueTempDir());
- FilePath root_file_path = source_dir.path();
- FilePath src_file_path = root_file_path.AppendASCII("file_name");
+ base::FilePath root_file_path = source_dir.path();
+ base::FilePath src_file_path = root_file_path.AppendASCII("file_name");
FileSystemURL dest_url = CreateURLFromUTF8("new file");
int64 src_file_length = 87;
@@ -551,7 +551,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
context.reset(NewContext(NULL));
base::PlatformFileInfo file_info;
- FilePath data_path;
+ base::FilePath data_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetFileInfo(
context.get(), dest_url, &file_info, &data_path));
EXPECT_NE(data_path, src_file_path);
@@ -571,7 +571,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
base::Time GetModifiedTime(const FileSystemURL& url) {
scoped_ptr<FileSystemOperationContext> context(NewContext(NULL));
- FilePath data_path;
+ base::FilePath data_path;
base::PlatformFileInfo file_info;
context.reset(NewContext(NULL));
EXPECT_EQ(base::PLATFORM_FILE_OK,
@@ -693,7 +693,7 @@ TEST_F(ObfuscatedFileUtilTest, TestCreateAndDeleteFile) {
CheckFileAndCloseHandle(url, file_handle);
context.reset(NewContext(NULL));
- FilePath local_path;
+ base::FilePath local_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetLocalFilePath(
context.get(), url, &local_path));
EXPECT_TRUE(file_util::PathExists(local_path));
@@ -761,7 +761,7 @@ TEST_F(ObfuscatedFileUtilTest, TestTruncate) {
EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count());
context.reset(NewContext(NULL));
- FilePath local_path;
+ base::FilePath local_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetLocalFilePath(
context.get(), url, &local_path));
EXPECT_EQ(0, GetSize(local_path));
@@ -837,7 +837,7 @@ TEST_F(ObfuscatedFileUtilTest, TestQuotaOnTruncation) {
}
// Delete backing file to make following truncation fail.
- FilePath local_path;
+ base::FilePath local_path;
ASSERT_EQ(base::PLATFORM_FILE_OK,
ofu()->GetLocalFilePath(
UnlimitedContext().get(),
@@ -954,7 +954,7 @@ TEST_F(ObfuscatedFileUtilTest, TestDirectoryOps) {
EXPECT_TRUE(change_observer()->HasNoChange());
base::PlatformFileInfo file_info;
- FilePath local_path;
+ base::FilePath local_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetFileInfo(
context.get(), url, &file_info, &local_path));
EXPECT_TRUE(local_path.empty());
@@ -1138,13 +1138,13 @@ TEST_F(ObfuscatedFileUtilTest, TestPathQuotas) {
bool exclusive = true;
bool recursive = true;
url = CreateURLFromUTF8("directory/to/use");
- std::vector<FilePath::StringType> components;
+ std::vector<base::FilePath::StringType> components;
url.path().GetComponents(&components);
path_cost = 0;
- for (std::vector<FilePath::StringType>::iterator iter = components.begin();
+ for (std::vector<base::FilePath::StringType>::iterator iter = components.begin();
iter != components.end(); ++iter) {
path_cost += ObfuscatedFileUtil::ComputeFilePathCost(
- FilePath(*iter));
+ base::FilePath(*iter));
}
context.reset(NewContext(NULL));
context->set_allowed_bytes_growth(1024);
@@ -1250,7 +1250,7 @@ TEST_F(ObfuscatedFileUtilTest, TestCopyOrMoveFileSuccess) {
if (test_case.is_copy_not_move) {
base::PlatformFileInfo file_info;
- FilePath local_path;
+ base::FilePath local_path;
context.reset(NewContext(NULL));
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetFileInfo(
context.get(), source_url, &file_info, &local_path));
@@ -1259,13 +1259,13 @@ TEST_F(ObfuscatedFileUtilTest, TestCopyOrMoveFileSuccess) {
ofu()->DeleteFile(context.get(), source_url));
} else {
base::PlatformFileInfo file_info;
- FilePath local_path;
+ base::FilePath local_path;
context.reset(NewContext(NULL));
EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, ofu()->GetFileInfo(
context.get(), source_url, &file_info, &local_path));
}
base::PlatformFileInfo file_info;
- FilePath local_path;
+ base::FilePath local_path;
EXPECT_EQ(base::PLATFORM_FILE_OK, ofu()->GetFileInfo(
context.get(), dest_url, &file_info, &local_path));
EXPECT_EQ(kSourceLength, file_info.size);
@@ -1389,8 +1389,8 @@ TEST_F(ObfuscatedFileUtilTest, TestEnumerator) {
ASSERT_EQ(base::PLATFORM_FILE_OK, ofu()->CreateDirectory(
context.get(), src_url, exclusive, recursive));
- std::set<FilePath::StringType> files;
- std::set<FilePath::StringType> directories;
+ std::set<base::FilePath::StringType> files;
+ std::set<base::FilePath::StringType> directories;
FillTestDirectory(src_url, &files, &directories);
FileSystemURL dest_url = CreateURLFromUTF8("destination dir");
@@ -1505,7 +1505,7 @@ TEST_F(ObfuscatedFileUtilTest, TestRevokeUsageCache) {
for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) {
SCOPED_TRACE(testing::Message() << "Creating kRegularTestCase " << i);
const test::TestCaseRecord& test_case = test::kRegularTestCases[i];
- FilePath file_path(test_case.path);
+ base::FilePath file_path(test_case.path);
expected_quota += ObfuscatedFileUtil::ComputeFilePathCost(file_path);
if (test_case.is_directory) {
bool exclusive = true;
@@ -1550,7 +1550,7 @@ TEST_F(ObfuscatedFileUtilTest, TestInconsistency) {
scoped_ptr<FileSystemOperationContext> context;
base::PlatformFile file;
base::PlatformFileInfo file_info;
- FilePath data_path;
+ base::FilePath data_path;
bool created = false;
// Create a non-empty file.
@@ -1625,7 +1625,7 @@ TEST_F(ObfuscatedFileUtilTest, TestIncompleteDirectoryReading) {
CreateURLFromUTF8("bar"),
CreateURLFromUTF8("baz")
};
- const FileSystemURL empty_path = CreateURL(FilePath());
+ const FileSystemURL empty_path = CreateURL(base::FilePath());
scoped_ptr<FileSystemOperationContext> context;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kPath); ++i) {
@@ -1644,7 +1644,7 @@ TEST_F(ObfuscatedFileUtilTest, TestIncompleteDirectoryReading) {
EXPECT_EQ(3u, entries.size());
context.reset(NewContext(NULL));
- FilePath local_path;
+ base::FilePath local_path;
EXPECT_EQ(base::PLATFORM_FILE_OK,
ofu()->GetLocalFilePath(context.get(), kPath[0], &local_path));
EXPECT_TRUE(file_util::Delete(local_path, false));
@@ -1780,7 +1780,7 @@ TEST_F(ObfuscatedFileUtilTest, TestDirectoryTimestampForCreation) {
EXPECT_EQ(base::PLATFORM_FILE_OK,
ofu()->EnsureFileExists(context.get(), src_path, &created));
EXPECT_TRUE(created);
- FilePath src_local_path;
+ base::FilePath src_local_path;
context.reset(NewContext(NULL));
EXPECT_EQ(base::PLATFORM_FILE_OK,
ofu()->GetLocalFilePath(context.get(), src_path, &src_local_path));
@@ -1883,7 +1883,7 @@ TEST_F(ObfuscatedFileUtilTest, TestFileEnumeratorTimestamp) {
EXPECT_EQ(base::PLATFORM_FILE_OK,
ofu()->CreateDirectory(context.get(), url2, false, false));
- FilePath file_path;
+ base::FilePath file_path;
context.reset(NewContext(NULL));
EXPECT_EQ(base::PLATFORM_FILE_OK,
ofu()->GetLocalFilePath(context.get(), url1, &file_path));
@@ -1900,11 +1900,11 @@ TEST_F(ObfuscatedFileUtilTest, TestFileEnumeratorTimestamp) {
ofu()->CreateFileEnumerator(context.get(), dir, false));
int count = 0;
- FilePath file_path_each;
+ base::FilePath file_path_each;
while (!(file_path_each = file_enum->Next()).empty()) {
context.reset(NewContext(NULL));
base::PlatformFileInfo file_info;
- FilePath file_path;
+ base::FilePath file_path;
EXPECT_EQ(base::PLATFORM_FILE_OK,
ofu()->GetFileInfo(context.get(),
dir.WithPath(file_path_each),
diff --git a/webkit/fileapi/remote_file_system_proxy.h b/webkit/fileapi/remote_file_system_proxy.h
index e54a266..2d3ba77 100644
--- a/webkit/fileapi/remote_file_system_proxy.h
+++ b/webkit/fileapi/remote_file_system_proxy.h
@@ -13,7 +13,7 @@ namespace fileapi {
typedef base::Callback<
void(base::PlatformFileError result,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)>
WritableSnapshotFile;
diff --git a/webkit/fileapi/sandbox_file_stream_writer.cc b/webkit/fileapi/sandbox_file_stream_writer.cc
index 036c4dd..7906f17 100644
--- a/webkit/fileapi/sandbox_file_stream_writer.cc
+++ b/webkit/fileapi/sandbox_file_stream_writer.cc
@@ -121,7 +121,7 @@ void SandboxFileStreamWriter::DidGetFileInfo(
const net::CompletionCallback& callback,
base::PlatformFileError file_error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
if (CancelIfRequested())
return;
if (file_error != base::PLATFORM_FILE_OK) {
diff --git a/webkit/fileapi/sandbox_file_stream_writer.h b/webkit/fileapi/sandbox_file_stream_writer.h
index a1f0e19..c1dfe18 100644
--- a/webkit/fileapi/sandbox_file_stream_writer.h
+++ b/webkit/fileapi/sandbox_file_stream_writer.h
@@ -52,7 +52,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE SandboxFileStreamWriter
void DidGetFileInfo(const net::CompletionCallback& callback,
base::PlatformFileError file_error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
void DidGetUsageAndQuota(const net::CompletionCallback& callback,
quota::QuotaStatusCode status,
int64 usage, int64 quota);
@@ -74,7 +74,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE SandboxFileStreamWriter
UpdateObserverList observers_;
- FilePath file_path_;
+ base::FilePath file_path_;
int64 file_size_;
int64 total_bytes_written_;
int64 allowed_bytes_to_write_;
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index baf7cac..a7121ac 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -63,12 +63,12 @@ const char kPersistentOriginsCountLabel[] = "FileSystem.PersistentOriginsCount";
// Restricted names.
// http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#naming-restrictions
-const FilePath::CharType* const kRestrictedNames[] = {
+const base::FilePath::CharType* const kRestrictedNames[] = {
FILE_PATH_LITERAL("."), FILE_PATH_LITERAL(".."),
};
// Restricted chars.
-const FilePath::CharType kRestrictedChars[] = {
+const base::FilePath::CharType kRestrictedChars[] = {
FILE_PATH_LITERAL('/'), FILE_PATH_LITERAL('\\'),
};
@@ -109,7 +109,7 @@ void ValidateRootOnFileThread(
base::PlatformFileError* error_ptr) {
DCHECK(error_ptr);
- FilePath root_path =
+ base::FilePath root_path =
file_util->GetDirectoryForOriginAndType(
origin_url, type, create, error_ptr);
if (*error_ptr != base::PLATFORM_FILE_OK) {
@@ -126,7 +126,7 @@ void ValidateRootOnFileThread(
} // anonymous namespace
-const FilePath::CharType SandboxMountPointProvider::kFileSystemDirectory[] =
+const base::FilePath::CharType SandboxMountPointProvider::kFileSystemDirectory[] =
FILE_PATH_LITERAL("File System");
// static
@@ -139,7 +139,7 @@ bool SandboxMountPointProvider::CanHandleType(FileSystemType type) {
SandboxMountPointProvider::SandboxMountPointProvider(
quota::QuotaManagerProxy* quota_manager_proxy,
base::SequencedTaskRunner* file_task_runner,
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
const FileSystemOptions& file_system_options)
: file_task_runner_(file_task_runner),
profile_path_(profile_path),
@@ -211,16 +211,16 @@ void SandboxMountPointProvider::ValidateFileSystemRoot(
callback, base::Owned(error_ptr)));
};
-FilePath
+base::FilePath
SandboxMountPointProvider::GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) {
if (file_system_options_.is_incognito())
// TODO(kinuko): return an isolated temporary directory.
- return FilePath();
+ return base::FilePath();
if (!IsAllowedScheme(url.origin()))
- return FilePath();
+ return base::FilePath();
return GetBaseDirectoryForOriginAndType(url.origin(), url.type(), create);
}
@@ -233,7 +233,7 @@ bool SandboxMountPointProvider::IsAccessAllowed(const FileSystemURL& url) {
return IsAllowedScheme(url.origin());
}
-bool SandboxMountPointProvider::IsRestrictedFileName(const FilePath& filename)
+bool SandboxMountPointProvider::IsRestrictedFileName(const base::FilePath& filename)
const {
if (filename.value().empty())
return false;
@@ -246,7 +246,7 @@ bool SandboxMountPointProvider::IsRestrictedFileName(const FilePath& filename)
for (size_t i = 0; i < arraysize(kRestrictedChars); ++i) {
if (filename.value().find(kRestrictedChars[i]) !=
- FilePath::StringType::npos)
+ base::FilePath::StringType::npos)
return true;
}
@@ -341,14 +341,14 @@ SandboxMountPointProvider::CreateOriginEnumerator() {
return new ObfuscatedOriginEnumerator(sandbox_sync_file_util());
}
-FilePath SandboxMountPointProvider::GetBaseDirectoryForOriginAndType(
+base::FilePath SandboxMountPointProvider::GetBaseDirectoryForOriginAndType(
const GURL& origin_url, fileapi::FileSystemType type, bool create) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath path = sandbox_sync_file_util()->GetDirectoryForOriginAndType(
+ base::FilePath path = sandbox_sync_file_util()->GetDirectoryForOriginAndType(
origin_url, type, create, &error);
if (error != base::PLATFORM_FILE_OK)
- return FilePath();
+ return base::FilePath();
return path;
}
@@ -418,10 +418,10 @@ int64 SandboxMountPointProvider::GetOriginUsageOnFileThread(
const GURL& origin_url,
fileapi::FileSystemType type) {
DCHECK(CanHandleType(type));
- FilePath base_path =
+ base::FilePath base_path =
GetBaseDirectoryForOriginAndType(origin_url, type, false);
if (base_path.empty() || !file_util::DirectoryExists(base_path)) return 0;
- FilePath usage_file_path =
+ base::FilePath usage_file_path =
base_path.Append(FileSystemUsageCache::kUsageFileName);
bool is_valid = FileSystemUsageCache::IsValid(usage_file_path);
@@ -439,11 +439,11 @@ int64 SandboxMountPointProvider::GetOriginUsageOnFileThread(
FileSystemOperationContext context(file_system_context);
FileSystemURL url = file_system_context->CreateCrackedFileSystemURL(
- origin_url, type, FilePath());
+ origin_url, type, base::FilePath());
scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> enumerator(
sandbox_sync_file_util()->CreateFileEnumerator(&context, url, true));
- FilePath file_path_each;
+ base::FilePath file_path_each;
int64 usage = 0;
while (!(file_path_each = enumerator->Next()).empty()) {
@@ -459,7 +459,7 @@ void SandboxMountPointProvider::InvalidateUsageCache(
const GURL& origin_url, fileapi::FileSystemType type) {
DCHECK(CanHandleType(type));
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath usage_file_path = GetUsageCachePathForOriginAndType(
+ base::FilePath usage_file_path = GetUsageCachePathForOriginAndType(
sandbox_sync_file_util(), origin_url, type, &error);
if (error != base::PLATFORM_FILE_OK)
return;
@@ -540,29 +540,29 @@ SandboxMountPointProvider::CreateFileSystemOperationForSync(
operation_context.Pass());
}
-FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType(
+base::FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType(
const GURL& origin_url,
FileSystemType type) {
base::PlatformFileError error;
- FilePath path = GetUsageCachePathForOriginAndType(
+ base::FilePath path = GetUsageCachePathForOriginAndType(
sandbox_sync_file_util(), origin_url, type, &error);
if (error != base::PLATFORM_FILE_OK)
- return FilePath();
+ return base::FilePath();
return path;
}
// static
-FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType(
+base::FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType(
ObfuscatedFileUtil* sandbox_file_util,
const GURL& origin_url,
fileapi::FileSystemType type,
base::PlatformFileError* error_out) {
DCHECK(error_out);
*error_out = base::PLATFORM_FILE_OK;
- FilePath base_path = sandbox_file_util->GetDirectoryForOriginAndType(
+ base::FilePath base_path = sandbox_file_util->GetDirectoryForOriginAndType(
origin_url, type, false /* create */, error_out);
if (*error_out != base::PLATFORM_FILE_OK)
- return FilePath();
+ return base::FilePath();
return base_path.Append(FileSystemUsageCache::kUsageFileName);
}
diff --git a/webkit/fileapi/sandbox_mount_point_provider.h b/webkit/fileapi/sandbox_mount_point_provider.h
index 2a8a3ff..6176875 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.h
+++ b/webkit/fileapi/sandbox_mount_point_provider.h
@@ -59,7 +59,7 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
};
// The FileSystem directory name.
- static const FilePath::CharType kFileSystemDirectory[];
+ static const base::FilePath::CharType kFileSystemDirectory[];
static bool CanHandleType(FileSystemType type);
@@ -68,7 +68,7 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
SandboxMountPointProvider(
quota::QuotaManagerProxy* quota_manager_proxy,
base::SequencedTaskRunner* file_task_runner,
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
const FileSystemOptions& file_system_options);
virtual ~SandboxMountPointProvider();
@@ -78,11 +78,11 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
FileSystemType type,
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
- virtual FilePath GetFileSystemRootPathOnFileThread(
+ virtual base::FilePath GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE;
- virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
+ virtual bool IsRestrictedFileName(const base::FilePath& filename) const OVERRIDE;
virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE;
virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE;
virtual FilePermissionPolicy GetPermissionPolicy(
@@ -118,7 +118,7 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
// the 'unique' part.)
// Returns an empty path if the given type is invalid.
// This method can only be called on the file thread.
- FilePath GetBaseDirectoryForOriginAndType(
+ base::FilePath GetBaseDirectoryForOriginAndType(
const GURL& origin_url,
FileSystemType type,
bool create);
@@ -174,12 +174,12 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
friend class SyncableFileSystemOperation;
// Returns a path to the usage cache file.
- FilePath GetUsageCachePathForOriginAndType(
+ base::FilePath GetUsageCachePathForOriginAndType(
const GURL& origin_url,
FileSystemType type);
// Returns a path to the usage cache file (static version).
- static FilePath GetUsageCachePathForOriginAndType(
+ static base::FilePath GetUsageCachePathForOriginAndType(
ObfuscatedFileUtil* sandbox_file_util,
const GURL& origin_url,
FileSystemType type,
@@ -202,7 +202,7 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
- const FilePath profile_path_;
+ const base::FilePath profile_path_;
FileSystemOptions file_system_options_;
diff --git a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
index 875ab76..9d51114 100644
--- a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
@@ -39,7 +39,7 @@ class SandboxMountPointProviderOriginEnumeratorTest : public testing::Test {
protected:
void CreateOriginTypeDirectory(const GURL& origin,
fileapi::FileSystemType type) {
- FilePath target = sandbox_provider_->
+ base::FilePath target = sandbox_provider_->
GetBaseDirectoryForOriginAndType(origin, type, true);
ASSERT_TRUE(!target.empty());
ASSERT_TRUE(file_util::DirectoryExists(target));
diff --git a/webkit/fileapi/sandbox_quota_observer.cc b/webkit/fileapi/sandbox_quota_observer.cc
index ec24d37..c12ddb2 100644
--- a/webkit/fileapi/sandbox_quota_observer.cc
+++ b/webkit/fileapi/sandbox_quota_observer.cc
@@ -29,7 +29,7 @@ SandboxQuotaObserver::~SandboxQuotaObserver() {}
void SandboxQuotaObserver::OnStartUpdate(const FileSystemURL& url) {
DCHECK(SandboxMountPointProvider::CanHandleType(url.type()));
DCHECK(update_notify_runner_->RunsTasksOnCurrentThread());
- FilePath usage_file_path = GetUsageCachePath(url);
+ base::FilePath usage_file_path = GetUsageCachePath(url);
if (usage_file_path.empty())
return;
FileSystemUsageCache::IncrementDirty(usage_file_path);
@@ -48,7 +48,7 @@ void SandboxQuotaObserver::OnUpdate(const FileSystemURL& url,
delta);
}
- FilePath usage_file_path = GetUsageCachePath(url);
+ base::FilePath usage_file_path = GetUsageCachePath(url);
if (usage_file_path.empty())
return;
@@ -65,7 +65,7 @@ void SandboxQuotaObserver::OnEndUpdate(const FileSystemURL& url) {
DCHECK(SandboxMountPointProvider::CanHandleType(url.type()));
DCHECK(update_notify_runner_->RunsTasksOnCurrentThread());
- FilePath usage_file_path = GetUsageCachePath(url);
+ base::FilePath usage_file_path = GetUsageCachePath(url);
if (usage_file_path.empty())
return;
@@ -89,15 +89,15 @@ void SandboxQuotaObserver::OnAccess(const FileSystemURL& url) {
}
}
-FilePath SandboxQuotaObserver::GetUsageCachePath(const FileSystemURL& url) {
+base::FilePath SandboxQuotaObserver::GetUsageCachePath(const FileSystemURL& url) {
DCHECK(sandbox_file_util_);
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FilePath path = SandboxMountPointProvider::GetUsageCachePathForOriginAndType(
+ base::FilePath path = SandboxMountPointProvider::GetUsageCachePathForOriginAndType(
sandbox_file_util_, url.origin(), url.type(), &error);
if (error != base::PLATFORM_FILE_OK) {
LOG(WARNING) << "Could not get usage cache path for: "
<< url.DebugString();
- return FilePath();
+ return base::FilePath();
}
return path;
}
@@ -114,7 +114,7 @@ void SandboxQuotaObserver::ApplyPendingUsageUpdate() {
}
void SandboxQuotaObserver::UpdateUsageCacheFile(
- const FilePath& usage_file_path,
+ const base::FilePath& usage_file_path,
int64 delta) {
DCHECK(!usage_file_path.empty());
if (!usage_file_path.empty() && delta != 0)
diff --git a/webkit/fileapi/sandbox_quota_observer.h b/webkit/fileapi/sandbox_quota_observer.h
index 4711ec0..ea971a4 100644
--- a/webkit/fileapi/sandbox_quota_observer.h
+++ b/webkit/fileapi/sandbox_quota_observer.h
@@ -33,7 +33,7 @@ class SandboxQuotaObserver
: public FileUpdateObserver,
public FileAccessObserver {
public:
- typedef std::map<FilePath, int64> PendingUpdateNotificationMap;
+ typedef std::map<base::FilePath, int64> PendingUpdateNotificationMap;
SandboxQuotaObserver(
quota::QuotaManagerProxy* quota_manager_proxy,
@@ -51,9 +51,9 @@ class SandboxQuotaObserver
private:
void ApplyPendingUsageUpdate();
- void UpdateUsageCacheFile(const FilePath& usage_file_path, int64 delta);
+ void UpdateUsageCacheFile(const base::FilePath& usage_file_path, int64 delta);
- FilePath GetUsageCachePath(const FileSystemURL& url);
+ base::FilePath GetUsageCachePath(const FileSystemURL& url);
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
scoped_refptr<base::SequencedTaskRunner> update_notify_runner_;
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc
index e2746e5..d6c7c4d 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.cc
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc
@@ -89,7 +89,7 @@ void OnGetMetadataAndVerifyData(
const CannedSyncableFileSystem::StatusCallback& callback,
base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
if (result != base::PLATFORM_FILE_OK) {
callback.Run(result);
return;
@@ -104,11 +104,11 @@ void OnGetMetadataAndVerifyData(
void OnGetMetadata(
base::PlatformFileInfo* file_info_out,
- FilePath* platform_path_out,
+ base::FilePath* platform_path_out,
const CannedSyncableFileSystem::StatusCallback& callback,
base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
DCHECK(file_info_out);
DCHECK(platform_path_out);
*file_info_out = file_info;
@@ -375,7 +375,7 @@ PlatformFileError CannedSyncableFileSystem::VerifyFile(
PlatformFileError CannedSyncableFileSystem::GetMetadata(
const FileSystemURL& url,
base::PlatformFileInfo* info,
- FilePath* platform_path) {
+ base::FilePath* platform_path) {
return RunOnThread<PlatformFileError>(
io_task_runner_,
FROM_HERE,
@@ -540,7 +540,7 @@ void CannedSyncableFileSystem::DoVerifyFile(
void CannedSyncableFileSystem::DoGetMetadata(
const FileSystemURL& url,
base::PlatformFileInfo* info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
const StatusCallback& callback) {
EXPECT_TRUE(is_filesystem_opened_);
NewOperation()->GetMetadata(
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.h b/webkit/fileapi/syncable/canned_syncable_file_system.h
index f297068..d520387 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.h
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.h
@@ -110,7 +110,7 @@ class CannedSyncableFileSystem
const std::string& expected_data);
base::PlatformFileError GetMetadata(const FileSystemURL& url,
base::PlatformFileInfo* info,
- FilePath* platform_path);
+ base::FilePath* platform_path);
// Returns the # of bytes written (>=0) or an error code (<0).
int64 Write(net::URLRequestContext* url_request_context,
@@ -172,7 +172,7 @@ class CannedSyncableFileSystem
const StatusCallback& callback);
void DoGetMetadata(const FileSystemURL& url,
base::PlatformFileInfo* info,
- FilePath* platform_path,
+ base::FilePath* platform_path,
const StatusCallback& callback);
void DoWrite(net::URLRequestContext* url_request_context,
const FileSystemURL& url,
diff --git a/webkit/fileapi/syncable/local_file_change_tracker.cc b/webkit/fileapi/syncable/local_file_change_tracker.cc
index b5ee20d..4257350 100644
--- a/webkit/fileapi/syncable/local_file_change_tracker.cc
+++ b/webkit/fileapi/syncable/local_file_change_tracker.cc
@@ -21,7 +21,7 @@
namespace fileapi {
namespace {
-const FilePath::CharType kDatabaseName[] =
+const base::FilePath::CharType kDatabaseName[] =
FILE_PATH_LITERAL("LocalFileChangeTracker");
const char kMark[] = "d";
} // namespace
@@ -30,7 +30,7 @@ const char kMark[] = "d";
// object must be destructed on file_task_runner.
class LocalFileChangeTracker::TrackerDB {
public:
- explicit TrackerDB(const FilePath& base_path);
+ explicit TrackerDB(const base::FilePath& base_path);
SyncStatusCode MarkDirty(const std::string& url);
SyncStatusCode ClearDirty(const std::string& url);
@@ -47,7 +47,7 @@ class LocalFileChangeTracker::TrackerDB {
void HandleError(const tracked_objects::Location& from_here,
const leveldb::Status& status);
- const FilePath base_path_;
+ const base::FilePath base_path_;
scoped_ptr<leveldb::DB> db_;
SyncStatusCode db_status_;
@@ -60,7 +60,7 @@ LocalFileChangeTracker::ChangeInfo::~ChangeInfo() {}
// LocalFileChangeTracker ------------------------------------------------------
LocalFileChangeTracker::LocalFileChangeTracker(
- const FilePath& base_path,
+ const base::FilePath& base_path,
base::SequencedTaskRunner* file_task_runner)
: initialized_(false),
file_task_runner_(file_task_runner),
@@ -217,7 +217,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges(
new FileSystemOperationContext(file_system_context));
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
while (!dirty_files.empty()) {
const FileSystemURL url = dirty_files.front();
@@ -241,7 +241,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges(
file_util->CreateFileEnumerator(context.get(),
url,
false /* recursive */));
- FilePath path_each;
+ base::FilePath path_each;
while (!(path_each = enumerator->Next()).empty()) {
dirty_files.push(CreateSyncableFileSystemURL(
url.origin(), url.filesystem_id(), path_each));
@@ -288,7 +288,7 @@ void LocalFileChangeTracker::RecordChange(
// TrackerDB -------------------------------------------------------------------
-LocalFileChangeTracker::TrackerDB::TrackerDB(const FilePath& base_path)
+LocalFileChangeTracker::TrackerDB::TrackerDB(const base::FilePath& base_path)
: base_path_(base_path),
db_status_(SYNC_STATUS_OK) {}
diff --git a/webkit/fileapi/syncable/local_file_change_tracker.h b/webkit/fileapi/syncable/local_file_change_tracker.h
index 9636027..b92ddaa 100644
--- a/webkit/fileapi/syncable/local_file_change_tracker.h
+++ b/webkit/fileapi/syncable/local_file_change_tracker.h
@@ -39,7 +39,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileChangeTracker
// |file_task_runner| must be the one where the observee file operations run.
// (So that we can make sure DB operations are done before actual update
// happens)
- LocalFileChangeTracker(const FilePath& base_path,
+ LocalFileChangeTracker(const base::FilePath& base_path,
base::SequencedTaskRunner* file_task_runner);
virtual ~LocalFileChangeTracker();
diff --git a/webkit/fileapi/syncable/local_file_sync_context.cc b/webkit/fileapi/syncable/local_file_sync_context.cc
index 367e848..b237aaa 100644
--- a/webkit/fileapi/syncable/local_file_sync_context.cc
+++ b/webkit/fileapi/syncable/local_file_sync_context.cc
@@ -174,7 +174,7 @@ void LocalFileSyncContext::RegisterURLForWaitingSync(
void LocalFileSyncContext::ApplyRemoteChange(
FileSystemContext* file_system_context,
const FileChange& change,
- const FilePath& local_path,
+ const base::FilePath& local_path,
const FileSystemURL& url,
const SyncStatusCallback& callback) {
if (!io_task_runner_->RunsTasksOnCurrentThread()) {
@@ -564,7 +564,7 @@ void LocalFileSyncContext::DidGetWritingStatusForSync(
FileChangeList changes;
file_system_context->change_tracker()->GetChangesForURL(url, &changes);
- FilePath platform_path;
+ base::FilePath platform_path;
base::PlatformFileInfo file_info;
FileSystemFileUtil* file_util = file_system_context->GetFileUtil(url.type());
DCHECK(file_util);
@@ -624,7 +624,7 @@ void LocalFileSyncContext::DidGetFileMetadata(
const SyncFileMetadataCallback& callback,
base::PlatformFileError file_error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
SyncFileMetadata metadata;
if (file_error == base::PLATFORM_FILE_OK) {
diff --git a/webkit/fileapi/syncable/local_file_sync_context.h b/webkit/fileapi/syncable/local_file_sync_context.h
index 6ffc901..a2107f2a 100644
--- a/webkit/fileapi/syncable/local_file_sync_context.h
+++ b/webkit/fileapi/syncable/local_file_sync_context.h
@@ -115,7 +115,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSyncContext
void ApplyRemoteChange(
FileSystemContext* file_system_context,
const FileChange& change,
- const FilePath& local_path,
+ const base::FilePath& local_path,
const FileSystemURL& url,
const SyncStatusCallback& callback);
@@ -236,7 +236,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSyncContext
const SyncFileMetadataCallback& callback,
base::PlatformFileError file_error,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
base::TimeDelta NotifyChangesDuration();
diff --git a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc
index 0f2ad44..4cb59c7 100644
--- a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc
+++ b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc
@@ -119,7 +119,7 @@ class LocalFileSyncContextTest : public testing::Test {
SyncStatusCode ApplyRemoteChange(FileSystemContext* file_system_context,
const FileChange& change,
- const FilePath& local_path,
+ const base::FilePath& local_path,
const FileSystemURL& url,
SyncFileType expected_file_type) {
SCOPED_TRACE(testing::Message() << "ApplyChange for " <<
@@ -431,7 +431,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) {
SYNC_FILE_TYPE_FILE);
EXPECT_EQ(SYNC_STATUS_OK,
ApplyRemoteChange(file_system.file_system_context(),
- change, FilePath(), kFile,
+ change, base::FilePath(), kFile,
SYNC_FILE_TYPE_FILE));
// The implementation doesn't check file type for deletion, and it must be ok
@@ -439,7 +439,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) {
change = FileChange(FileChange::FILE_CHANGE_DELETE, SYNC_FILE_TYPE_UNKNOWN);
EXPECT_EQ(SYNC_STATUS_OK,
ApplyRemoteChange(file_system.file_system_context(),
- change, FilePath(), kDir,
+ change, base::FilePath(), kDir,
SYNC_FILE_TYPE_DIRECTORY));
// Check the directory/files are deleted successfully.
@@ -506,8 +506,8 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) {
file_system.ClearChangeForURLInTracker(*urls.begin());
// Prepare temporary files which represent the remote file data.
- const FilePath kFilePath1(temp_dir.path().Append(FPL("file1")));
- const FilePath kFilePath2(temp_dir.path().Append(FPL("file2")));
+ const base::FilePath kFilePath1(temp_dir.path().Append(FPL("file1")));
+ const base::FilePath kFilePath2(temp_dir.path().Append(FPL("file2")));
ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1),
file_util::WriteFile(kFilePath1, kTestFileData1,
@@ -565,7 +565,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) {
SYNC_FILE_TYPE_DIRECTORY);
EXPECT_EQ(SYNC_STATUS_OK,
ApplyRemoteChange(file_system.file_system_context(),
- change, FilePath(), kDir,
+ change, base::FilePath(), kDir,
SYNC_FILE_TYPE_UNKNOWN));
// This should not happen, but calling ApplyRemoteChange
diff --git a/webkit/fileapi/syncable/sync_file_metadata.h b/webkit/fileapi/syncable/sync_file_metadata.h
index 266241f..097c377 100644
--- a/webkit/fileapi/syncable/sync_file_metadata.h
+++ b/webkit/fileapi/syncable/sync_file_metadata.h
@@ -43,7 +43,7 @@ struct WEBKIT_STORAGE_EXPORT LocalFileSyncInfo {
~LocalFileSyncInfo();
FileSystemURL url;
- FilePath local_file_path;
+ base::FilePath local_file_path;
SyncFileMetadata metadata;
FileChangeList changes;
};
diff --git a/webkit/fileapi/syncable/syncable_file_system_operation.cc b/webkit/fileapi/syncable/syncable_file_system_operation.cc
index 0387535..e2145b5 100644
--- a/webkit/fileapi/syncable/syncable_file_system_operation.cc
+++ b/webkit/fileapi/syncable/syncable_file_system_operation.cc
@@ -183,7 +183,7 @@ void SyncableFileSystemOperation::GetMetadata(
DCHECK(CalledOnValidThread());
if (!operation_runner_) {
callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND,
- base::PlatformFileInfo(), FilePath());
+ base::PlatformFileInfo(), base::FilePath());
delete file_system_operation_;
delete this;
return;
@@ -330,7 +330,7 @@ void SyncableFileSystemOperation::CreateSnapshotFile(
DCHECK(CalledOnValidThread());
if (!operation_runner_) {
callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND,
- base::PlatformFileInfo(), FilePath(), NULL);
+ base::PlatformFileInfo(), base::FilePath(), NULL);
delete file_system_operation_;
delete this;
return;
diff --git a/webkit/fileapi/syncable/syncable_file_system_util.cc b/webkit/fileapi/syncable/syncable_file_system_util.cc
index e8d87d9..efb9122 100644
--- a/webkit/fileapi/syncable/syncable_file_system_util.cc
+++ b/webkit/fileapi/syncable/syncable_file_system_util.cc
@@ -14,7 +14,7 @@ namespace fileapi {
bool RegisterSyncableFileSystem(const std::string& service_name) {
return ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
- service_name, kFileSystemTypeSyncable, FilePath());
+ service_name, kFileSystemTypeSyncable, base::FilePath());
}
bool RevokeSyncableFileSystem(const std::string& service_name) {
@@ -33,11 +33,11 @@ GURL GetSyncableFileSystemRootURI(const GURL& origin,
FileSystemURL CreateSyncableFileSystemURL(const GURL& origin,
const std::string& service_name,
- const FilePath& path) {
+ const base::FilePath& path) {
return ExternalMountPoints::GetSystemInstance()->CreateCrackedFileSystemURL(
origin,
kFileSystemTypeExternal,
- FilePath::FromUTF8Unsafe(service_name).Append(path));
+ base::FilePath::FromUTF8Unsafe(service_name).Append(path));
}
bool SerializeSyncableFileSystemURL(const FileSystemURL& url,
diff --git a/webkit/fileapi/syncable/syncable_file_system_util.h b/webkit/fileapi/syncable/syncable_file_system_util.h
index 439a086..542856c 100644
--- a/webkit/fileapi/syncable/syncable_file_system_util.h
+++ b/webkit/fileapi/syncable/syncable_file_system_util.h
@@ -38,7 +38,8 @@ WEBKIT_STORAGE_EXPORT GURL GetSyncableFileSystemRootURI(
// path: '/foo/bar',
// returns 'filesystem:http://www.example.com/external/service_name/foo/bar'
WEBKIT_STORAGE_EXPORT FileSystemURL CreateSyncableFileSystemURL(
- const GURL& origin, const std::string& service_name, const FilePath& path);
+ const GURL& origin, const std::string& service_name,
+ const base::FilePath& path);
// Serializes a given FileSystemURL |url| and sets the serialized string to
// |serialized_url|. If the URL does not represent a syncable filesystem,
diff --git a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
index 91b0baa..6e8dcc0 100644
--- a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
+++ b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
@@ -25,14 +25,14 @@ const char kNonSyncableFileSystemRootURI[] =
const char kOrigin[] = "http://www.example.com/";
const char kServiceName[] = "service";
-const FilePath::CharType kPath[] = FILE_PATH_LITERAL("dir/file");
+const base::FilePath::CharType kPath[] = FILE_PATH_LITERAL("dir/file");
FileSystemURL CreateFileSystemURL(const std::string& url) {
return ExternalMountPoints::GetSystemInstance()->CrackURL(GURL(url));
}
-FilePath CreateNormalizedFilePath(const FilePath::CharType* path) {
- return FilePath(path).NormalizePathSeparators();
+base::FilePath CreateNormalizedFilePath(const base::FilePath::CharType* path) {
+ return base::FilePath(path).NormalizePathSeparators();
}
} // namespace
@@ -45,9 +45,9 @@ TEST(SyncableFileSystemUtilTest, GetSyncableFileSystemRootURI) {
TEST(SyncableFileSystemUtilTest, CreateSyncableFileSystemURL) {
ScopedExternalFileSystem scoped_fs(
- kServiceName, kFileSystemTypeSyncable, FilePath());
+ kServiceName, kFileSystemTypeSyncable, base::FilePath());
- const FilePath path(kPath);
+ const base::FilePath path(kPath);
const FileSystemURL expected_url =
CreateFileSystemURL(kSyncableFileSystemRootURI + path.AsUTF8Unsafe());
const FileSystemURL url =
@@ -60,13 +60,13 @@ TEST(SyncableFileSystemUtilTest, CreateSyncableFileSystemURL) {
TEST(SyncableFileSystemUtilTest,
SerializeAndDesirializeSyncableFileSystemURL) {
ScopedExternalFileSystem scoped_fs(
- kServiceName, kFileSystemTypeSyncable, FilePath());
+ kServiceName, kFileSystemTypeSyncable, base::FilePath());
const std::string expected_url_str = kSyncableFileSystemRootURI +
CreateNormalizedFilePath(kPath).AsUTF8Unsafe();
const FileSystemURL expected_url = CreateFileSystemURL(expected_url_str);
const FileSystemURL url =
- CreateSyncableFileSystemURL(GURL(kOrigin), kServiceName, FilePath(kPath));
+ CreateSyncableFileSystemURL(GURL(kOrigin), kServiceName, base::FilePath(kPath));
std::string serialized;
EXPECT_TRUE(SerializeSyncableFileSystemURL(url, &serialized));
@@ -81,9 +81,9 @@ TEST(SyncableFileSystemUtilTest,
TEST(SyncableFileSystemUtilTest,
FailInSerializingAndDeserializingSyncableFileSystemURL) {
ScopedExternalFileSystem scoped_fs(
- kServiceName, kFileSystemTypeSyncable, FilePath());
+ kServiceName, kFileSystemTypeSyncable, base::FilePath());
- const FilePath normalized_path = CreateNormalizedFilePath(kPath);
+ const base::FilePath normalized_path = CreateNormalizedFilePath(kPath);
const std::string non_registered_url =
kNonRegisteredFileSystemRootURI + normalized_path.AsUTF8Unsafe();
const std::string non_syncable_url =
diff --git a/webkit/fileapi/test_file_set.cc b/webkit/fileapi/test_file_set.cc
index 6d30f74..96213f1 100644
--- a/webkit/fileapi/test_file_set.cc
+++ b/webkit/fileapi/test_file_set.cc
@@ -39,9 +39,9 @@ const TestCaseRecord kRegularTestCases[] = {
const size_t kRegularTestCaseSize = arraysize(kRegularTestCases);
-void SetUpOneTestCase(const FilePath& root_path,
+void SetUpOneTestCase(const base::FilePath& root_path,
const TestCaseRecord& test_case) {
- FilePath path = root_path.Append(test_case.path);
+ base::FilePath path = root_path.Append(test_case.path);
if (test_case.is_directory) {
ASSERT_TRUE(file_util::CreateDirectory(path));
return;
@@ -64,7 +64,7 @@ void SetUpOneTestCase(const FilePath& root_path,
}
-void SetUpRegularTestCases(const FilePath& root_path) {
+void SetUpRegularTestCases(const base::FilePath& root_path) {
for (size_t i = 0; i < arraysize(kRegularTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "Creating kRegularTestCases " << i);
SetUpOneTestCase(root_path, kRegularTestCases[i]);
diff --git a/webkit/fileapi/test_file_set.h b/webkit/fileapi/test_file_set.h
index 75673c9..6823c6d 100644
--- a/webkit/fileapi/test_file_set.h
+++ b/webkit/fileapi/test_file_set.h
@@ -19,7 +19,7 @@ namespace test {
struct TestCaseRecord {
bool is_directory;
- const FilePath::CharType path[64];
+ const base::FilePath::CharType path[64];
int64 data_file_size;
};
@@ -29,10 +29,10 @@ extern const size_t kRegularTestCaseSize;
size_t GetRegularTestCaseSize();
// Creates one file or directory specified by |record|.
-void SetUpOneTestCase(const FilePath& root_path, const TestCaseRecord& record);
+void SetUpOneTestCase(const base::FilePath& root_path, const TestCaseRecord& record);
// Creates the files and directories specified in kRegularTestCases.
-void SetUpRegularTestCases(const FilePath& root_path);
+void SetUpRegularTestCases(const base::FilePath& root_path);
} // namespace test
diff --git a/webkit/fileapi/test_mount_point_provider.cc b/webkit/fileapi/test_mount_point_provider.cc
index d062763..25b1630 100644
--- a/webkit/fileapi/test_mount_point_provider.cc
+++ b/webkit/fileapi/test_mount_point_provider.cc
@@ -66,7 +66,7 @@ class TestMountPointProvider::QuotaUtil
TestMountPointProvider::TestMountPointProvider(
base::SequencedTaskRunner* task_runner,
- const FilePath& base_path)
+ const base::FilePath& base_path)
: base_path_(base_path),
task_runner_(task_runner),
local_file_util_(new AsyncFileUtilAdapter(new LocalFileUtil())),
@@ -89,7 +89,7 @@ void TestMountPointProvider::ValidateFileSystemRoot(
NOTREACHED();
}
-FilePath TestMountPointProvider::GetFileSystemRootPathOnFileThread(
+base::FilePath TestMountPointProvider::GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) {
DCHECK_EQ(kFileSystemTypeTest, url.type());
@@ -98,7 +98,7 @@ FilePath TestMountPointProvider::GetFileSystemRootPathOnFileThread(
success = file_util::CreateDirectory(base_path_);
else
success = file_util::DirectoryExists(base_path_);
- return success ? base_path_ : FilePath();
+ return success ? base_path_ : base::FilePath();
}
bool TestMountPointProvider::IsAccessAllowed(const FileSystemURL& url) {
@@ -106,7 +106,7 @@ bool TestMountPointProvider::IsAccessAllowed(const FileSystemURL& url) {
}
bool TestMountPointProvider::IsRestrictedFileName(
- const FilePath& filename) const {
+ const base::FilePath& filename) const {
return false;
}
diff --git a/webkit/fileapi/test_mount_point_provider.h b/webkit/fileapi/test_mount_point_provider.h
index 4bee102..29a4614 100644
--- a/webkit/fileapi/test_mount_point_provider.h
+++ b/webkit/fileapi/test_mount_point_provider.h
@@ -30,7 +30,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE TestMountPointProvider
public:
TestMountPointProvider(
base::SequencedTaskRunner* task_runner,
- const FilePath& base_path);
+ const base::FilePath& base_path);
virtual ~TestMountPointProvider();
// FileSystemMountPointProvider implementation.
@@ -39,11 +39,11 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE TestMountPointProvider
FileSystemType type,
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
- virtual FilePath GetFileSystemRootPathOnFileThread(
+ virtual base::FilePath GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE;
- virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
+ virtual bool IsRestrictedFileName(const base::FilePath& filename) const OVERRIDE;
virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE;
virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE;
virtual FilePermissionPolicy GetPermissionPolicy(
@@ -74,7 +74,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE TestMountPointProvider
private:
class QuotaUtil;
- FilePath base_path_;
+ base::FilePath base_path_;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
scoped_ptr<AsyncFileUtilAdapter> local_file_util_;
scoped_ptr<QuotaUtil> quota_util_;
diff --git a/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc b/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc
index 4d9c7bef..d9ea383 100644
--- a/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc
+++ b/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc
@@ -85,7 +85,7 @@ class UploadFileSystemFileElementReaderTest : public testing::Test {
file_system_context_->CreateCrackedFileSystemURL(
GURL(kFileSystemURLOrigin),
kFileSystemType,
- FilePath().AppendASCII(filename));
+ base::FilePath().AppendASCII(filename));
fileapi::FileSystemFileUtil* file_util =
file_system_context_->GetFileUtil(kFileSystemType);
@@ -108,7 +108,7 @@ class UploadFileSystemFileElementReaderTest : public testing::Test {
base::ClosePlatformFile(handle);
base::PlatformFileInfo file_info;
- FilePath platform_path;
+ base::FilePath platform_path;
ASSERT_EQ(base::PLATFORM_FILE_OK,
file_util->GetFileInfo(&context, url, &file_info,
&platform_path));
diff --git a/webkit/glue/dom_operations_unittest.cc b/webkit/glue/dom_operations_unittest.cc
index 05aeb76..141a819 100644
--- a/webkit/glue/dom_operations_unittest.cc
+++ b/webkit/glue/dom_operations_unittest.cc
@@ -20,7 +20,7 @@ class DomOperationsTests : public TestShellTest {
// Test function GetAllSavableResourceLinksForCurrentPage with a web page.
// We expect result of GetAllSavableResourceLinksForCurrentPage exactly
// matches expected_resources_set.
- void GetSavableResourceLinksForPage(const FilePath& page_file_path,
+ void GetSavableResourceLinksForPage(const base::FilePath& page_file_path,
const std::set<GURL>& expected_resources_set);
protected:
@@ -36,7 +36,7 @@ class DomOperationsTests : public TestShellTest {
void DomOperationsTests::GetSavableResourceLinksForPage(
- const FilePath& page_file_path,
+ const base::FilePath& page_file_path,
const std::set<GURL>& expected_resources_set) {
// Convert local file path to file URL.
GURL file_url = net::FilePathToFileURL(page_file_path);
@@ -82,7 +82,7 @@ void DomOperationsTests::GetSavableResourceLinksForPage(
TEST_F(DomOperationsTests, GetSavableResourceLinksWithPageHasValidLinks) {
std::set<GURL> expected_resources_set;
// Set directory of test data.
- FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
+ base::FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
const char* expected_sub_resource_links[] = {
"file:///c:/yt/css/base_all-vfl36460.css",
@@ -98,7 +98,7 @@ TEST_F(DomOperationsTests, GetSavableResourceLinksWithPageHasValidLinks) {
expected_resources_set.insert(GURL(expected_sub_resource_links[i]));
// Add all expected links of frame to expected set.
for (size_t i = 0; i < arraysize(expected_frame_links); ++i) {
- const FilePath expected_frame_url =
+ const base::FilePath expected_frame_url =
page_file_path.AppendASCII(expected_frame_links[i]);
expected_resources_set.insert(
net::FilePathToFileURL(expected_frame_url));
@@ -113,14 +113,14 @@ TEST_F(DomOperationsTests, GetSavableResourceLinksWithPageHasValidLinks) {
TEST_F(DomOperationsTests, GetSavableResourceLinksWithPageHasInvalidLinks) {
std::set<GURL> expected_resources_set;
// Set directory of test data.
- FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
+ base::FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
const char* expected_frame_links[] = {
"youtube_2.htm"
};
// Add all expected links of frame to expected set.
for (size_t i = 0; i < arraysize(expected_frame_links); ++i) {
- FilePath expected_frame_url =
+ base::FilePath expected_frame_url =
page_file_path.AppendASCII(expected_frame_links[i]);
expected_resources_set.insert(
net::FilePathToFileURL(expected_frame_url));
diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc
index 7097def..de4f8a4 100644
--- a/webkit/glue/dom_serializer_unittest.cc
+++ b/webkit/glue/dom_serializer_unittest.cc
@@ -205,7 +205,7 @@ class DomSerializerTests : public TestShellTest,
WebVector<WebString> local_paths_;
// The local_directory_name_ is dummy relative path of directory which
// contain all saved auxiliary files included all sub frames and resources.
- const FilePath local_directory_name_;
+ const base::FilePath local_directory_name_;
protected:
// testing::Test
@@ -283,7 +283,7 @@ bool IsMetaElement(const WebNode& node, std::string& charset_info) {
// If original contents have document type, the serialized contents also have
// document type.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithDocType) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("youtube_1.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
@@ -312,7 +312,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithDocType) {
// If original contents do not have document type, the serialized contents
// also do not have document type.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithoutDocType) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("youtube_2.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
@@ -342,7 +342,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithoutDocType) {
// finishing serialization, the serialized contents should be same
// with original XML document.
TEST_F(DomSerializerTests, SerializeXMLDocWithBuiltInEntities) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("note.xml");
// Read original contents for later comparison.
@@ -364,7 +364,7 @@ TEST_F(DomSerializerTests, SerializeXMLDocWithBuiltInEntities) {
// When serializing DOM, we add MOTW declaration before html tag.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithAddingMOTW) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("youtube_2.htm");
// Read original contents for later comparison .
@@ -398,7 +398,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithAddingMOTW) {
// http://bugs.webkit.org/show_bug.cgi?id=16621 even the original document
// does not have META charset declaration.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithNoMetaCharsetInOriginalDoc) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("youtube_1.htm");
// Get file URL.
@@ -462,7 +462,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithNoMetaCharsetInOriginalDoc) {
// declarations.
TEST_F(DomSerializerTests,
SerializeHTMLDOMWithMultipleMetaCharsetInOriginalDoc) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("youtube_2.htm");
// Get file URL.
@@ -527,7 +527,7 @@ TEST_F(DomSerializerTests,
// Test situation of html entities in text when serializing HTML DOM.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithEntitiesInText) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII(
"dom_serializer/htmlentities_in_text.htm");
// Get file URL. The URL is dummy URL to identify the following loading
@@ -587,7 +587,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithEntitiesInText) {
// HTML DOM.
// This test started to fail at WebKit r65388. See http://crbug.com/52279.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithEntitiesInAttributeValue) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII(
"dom_serializer/htmlentities_in_attribute_value.htm");
// Get file URL. The URL is dummy URL to identify the following loading
@@ -638,7 +638,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithEntitiesInAttributeValue) {
// This test started to fail at WebKit r65351. See http://crbug.com/52279.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithNonStandardEntities) {
// Make a test file URL and load it.
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("nonstandard_htmlentities.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
@@ -678,7 +678,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithBaseTag) {
// There are total 2 available base tags in this test file.
const int kTotalBaseTagCountInTestFile = 2;
- FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
+ base::FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
file_util::EnsureEndsWithSeparator(&page_file_path);
// Get page dir URL which is base URL of this file.
@@ -782,7 +782,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithBaseTag) {
// Serializing page which has an empty HEAD tag.
TEST_F(DomSerializerTests, SerializeHTMLDOMWithEmptyHead) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("empty_head.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
@@ -842,7 +842,7 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithEmptyHead) {
// Test that we don't crash when the page contains an iframe that
// was handled as a download (http://crbug.com/42212).
TEST_F(DomSerializerTests, SerializeDocumentWithDownloadedIFrame) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("iframe-src-is-exe.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
@@ -854,7 +854,7 @@ TEST_F(DomSerializerTests, SerializeDocumentWithDownloadedIFrame) {
}
TEST_F(DomSerializerTests, SubResourceForElementsInNonHTMLNamespace) {
- FilePath page_file_path = data_dir_;
+ base::FilePath page_file_path = data_dir_;
page_file_path = page_file_path.AppendASCII("dom_serializer");
page_file_path = page_file_path.AppendASCII("non_html_namespace.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc
index 3fad842..e9d3ae4 100644
--- a/webkit/glue/glue_serialize.cc
+++ b/webkit/glue/glue_serialize.cc
@@ -509,9 +509,9 @@ WebHistoryItem HistoryItemFromString(const std::string& serialized_item) {
return HistoryItemFromString(serialized_item, ALWAYS_INCLUDE_FORM_DATA, true);
}
-std::vector<FilePath> FilePathsFromHistoryState(
+std::vector<base::FilePath> FilePathsFromHistoryState(
const std::string& content_state) {
- std::vector<FilePath> to_return;
+ std::vector<base::FilePath> to_return;
// TODO(darin): We should avoid using the WebKit API here, so that we do not
// need to have WebKit initialized before calling this method.
const WebHistoryItem& item =
diff --git a/webkit/glue/glue_serialize.h b/webkit/glue/glue_serialize.h
index ac869a9..38df965 100644
--- a/webkit/glue/glue_serialize.h
+++ b/webkit/glue/glue_serialize.h
@@ -28,7 +28,7 @@ WEBKIT_GLUE_EXPORT WebKit::WebHistoryItem HistoryItemFromString(
// Reads file paths from the HTTP body and the file input elements of a
// serialized WebHistoryItem.
-WEBKIT_GLUE_EXPORT std::vector<FilePath> FilePathsFromHistoryState(
+WEBKIT_GLUE_EXPORT std::vector<base::FilePath> FilePathsFromHistoryState(
const std::string& content_state);
// For testing purposes only.
diff --git a/webkit/glue/glue_serialize_unittest.cc b/webkit/glue/glue_serialize_unittest.cc
index 91916ef..250dceac 100644
--- a/webkit/glue/glue_serialize_unittest.cc
+++ b/webkit/glue/glue_serialize_unittest.cc
@@ -265,8 +265,8 @@ TEST_F(GlueSerializeTest, FilePathsFromHistoryState) {
WebHistoryItem item = MakeHistoryItem(false, true);
// Append file paths to item.
- FilePath file_path1(FILE_PATH_LITERAL("file.txt"));
- FilePath file_path2(FILE_PATH_LITERAL("another_file"));
+ base::FilePath file_path1(FILE_PATH_LITERAL("file.txt"));
+ base::FilePath file_path2(FILE_PATH_LITERAL("another_file"));
WebHTTPBody http_body;
http_body.initialize();
http_body.appendFile(webkit_base::FilePathToWebString(file_path1));
@@ -274,7 +274,7 @@ TEST_F(GlueSerializeTest, FilePathsFromHistoryState) {
item.setHTTPBody(http_body);
std::string serialized_item = webkit_glue::HistoryItemToString(item);
- const std::vector<FilePath>& file_paths =
+ const std::vector<base::FilePath>& file_paths =
webkit_glue::FilePathsFromHistoryState(serialized_item);
ASSERT_EQ(2U, file_paths.size());
EXPECT_EQ(file_path1, file_paths[0]);
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h
index 52859b3..d20040f 100644
--- a/webkit/glue/resource_loader_bridge.h
+++ b/webkit/glue/resource_loader_bridge.h
@@ -181,7 +181,7 @@ struct ResourceResponseInfo {
// The path to a file that will contain the response body. It may only
// contain a portion of the response body at the time that the ResponseInfo
// becomes available.
- FilePath download_file_path;
+ base::FilePath download_file_path;
// True if the response was delivered using SPDY.
bool was_fetched_via_spdy;
diff --git a/webkit/glue/resource_request_body.cc b/webkit/glue/resource_request_body.cc
index eb820fc..763c7d0 100644
--- a/webkit/glue/resource_request_body.cc
+++ b/webkit/glue/resource_request_body.cc
@@ -73,7 +73,7 @@ void ResourceRequestBody::AppendBytes(const char* bytes, int bytes_len) {
}
void ResourceRequestBody::AppendFileRange(
- const FilePath& file_path,
+ const base::FilePath& file_path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
elements_.push_back(Element());
diff --git a/webkit/glue/resource_request_body.h b/webkit/glue/resource_request_body.h
index 8331bdf..71a0495 100644
--- a/webkit/glue/resource_request_body.h
+++ b/webkit/glue/resource_request_body.h
@@ -14,6 +14,7 @@
#include "webkit/glue/webkit_glue_export.h"
namespace base {
+class FilePath;
class TaskRunner;
}
@@ -42,7 +43,7 @@ class WEBKIT_GLUE_EXPORT ResourceRequestBody
ResourceRequestBody();
void AppendBytes(const char* bytes, int bytes_len);
- void AppendFileRange(const FilePath& file_path,
+ void AppendFileRange(const base::FilePath& file_path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time);
void AppendBlob(const GURL& blob_url);
diff --git a/webkit/glue/resource_request_body_unittest.cc b/webkit/glue/resource_request_body_unittest.cc
index 62c5d70..c596739 100644
--- a/webkit/glue/resource_request_body_unittest.cc
+++ b/webkit/glue/resource_request_body_unittest.cc
@@ -59,14 +59,14 @@ TEST(ResourceRequestBodyTest, CreateUploadDataStreamWithoutBlob) {
scoped_refptr<ResourceRequestBody> request_body = new ResourceRequestBody;
const char kData[] = "123";
- const FilePath::StringType kFilePath = FILE_PATH_LITERAL("abc");
+ const base::FilePath::StringType kFilePath = FILE_PATH_LITERAL("abc");
const uint64 kFileOffset = 10U;
const uint64 kFileLength = 100U;
const base::Time kFileTime = base::Time::FromDoubleT(999);
const int64 kIdentifier = 12345;
request_body->AppendBytes(kData, arraysize(kData) - 1);
- request_body->AppendFileRange(FilePath(kFilePath),
+ request_body->AppendFileRange(base::FilePath(kFilePath),
kFileOffset, kFileLength, kFileTime);
request_body->set_identifier(kIdentifier);
@@ -106,7 +106,7 @@ TEST(ResourceRequestBodyTest, ResolveBlobAndCreateUploadDataStream) {
blob_data->AppendData("BlobData");
blob_data->AppendFile(
- FilePath(FILE_PATH_LITERAL("BlobFile.txt")), 0, 20, time1);
+ base::FilePath(FILE_PATH_LITERAL("BlobFile.txt")), 0, 20, time1);
GURL blob_url1("blob://url_1");
blob_storage_controller.AddFinishedBlob(blob_url1, blob_data);
@@ -132,7 +132,7 @@ TEST(ResourceRequestBodyTest, ResolveBlobAndCreateUploadDataStream) {
ResourceRequestBody::Element upload_element1, upload_element2;
upload_element1.SetToBytes("Hello", 5);
upload_element2.SetToFilePathRange(
- FilePath(FILE_PATH_LITERAL("foo1.txt")), 0, 20, time2);
+ base::FilePath(FILE_PATH_LITERAL("foo1.txt")), 0, 20, time2);
// Test no blob reference.
scoped_refptr<ResourceRequestBody> request_body(new ResourceRequestBody());
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index 98473ee..b8e81a8 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -139,7 +139,7 @@ WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile(
WebString SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType(
const WebString& mime_type) {
- FilePath::StringType file_extension;
+ base::FilePath::StringType file_extension;
net::GetPreferredExtensionForMimeType(ToASCIIOrEmpty(mime_type),
&file_extension);
return webkit_base::FilePathStringToWebString(file_extension);
diff --git a/webkit/glue/unittest_test_server.h b/webkit/glue/unittest_test_server.h
index 2d5df48..815e62b 100644
--- a/webkit/glue/unittest_test_server.h
+++ b/webkit/glue/unittest_test_server.h
@@ -15,7 +15,7 @@ class UnittestTestServer : public net::TestServer {
UnittestTestServer()
: net::TestServer(net::TestServer::TYPE_HTTP,
net::TestServer::kLocalhost,
- FilePath(FILE_PATH_LITERAL("webkit/data"))) {
+ base::FilePath(FILE_PATH_LITERAL("webkit/data"))) {
}
};
diff --git a/webkit/glue/web_intent_data.cc b/webkit/glue/web_intent_data.cc
index 0ad55b5..9df1422 100644
--- a/webkit/glue/web_intent_data.cc
+++ b/webkit/glue/web_intent_data.cc
@@ -61,7 +61,7 @@ WebIntentData::WebIntentData(const string16& action_in,
WebIntentData::WebIntentData(const string16& action_in,
const string16& type_in,
- const FilePath& blob_file_in,
+ const base::FilePath& blob_file_in,
int64 blob_length_in)
: action(action_in),
type(type_in),
diff --git a/webkit/glue/web_intent_data.h b/webkit/glue/web_intent_data.h
index fe73328..1d18428 100644
--- a/webkit/glue/web_intent_data.h
+++ b/webkit/glue/web_intent_data.h
@@ -50,7 +50,7 @@ struct WEBKIT_GLUE_EXPORT WebIntentData {
// arguments to WebBlob::createFromFile. Note: when mime_data has
// length==1, this blob will be set as the 'blob' member of the first
// object in the delivered data payload.
- FilePath blob_file;
+ base::FilePath blob_file;
// Length of the blob.
int64 blob_length;
diff --git a/webkit/glue/web_intent_reply_data.cc b/webkit/glue/web_intent_reply_data.cc
index 8a19fef..1b30891 100644
--- a/webkit/glue/web_intent_reply_data.cc
+++ b/webkit/glue/web_intent_reply_data.cc
@@ -22,7 +22,7 @@ WebIntentReply::WebIntentReply(
WebIntentReply::WebIntentReply(
WebIntentReplyType response_type,
- FilePath response_data_file,
+ base::FilePath response_data_file,
int64 response_data_file_length)
: type(response_type),
data_file(response_data_file),
diff --git a/webkit/glue/web_intent_reply_data.h b/webkit/glue/web_intent_reply_data.h
index f3bd172..038c022 100644
--- a/webkit/glue/web_intent_reply_data.h
+++ b/webkit/glue/web_intent_reply_data.h
@@ -35,7 +35,7 @@ struct WEBKIT_GLUE_EXPORT WebIntentReply {
WebIntentReply(WebIntentReplyType type, string16 data);
WebIntentReply(
WebIntentReplyType type,
- FilePath data_file,
+ base::FilePath data_file,
int64 data_file_size);
bool operator==(const WebIntentReply& other) const;
@@ -47,7 +47,7 @@ struct WEBKIT_GLUE_EXPORT WebIntentReply {
string16 data;
// FilePath to the data to be delivered. Default value is empty.
- FilePath data_file;
+ base::FilePath data_file;
// Length of data_path.
int64 data_file_size;
diff --git a/webkit/glue/web_intent_reply_data_unittest.cc b/webkit/glue/web_intent_reply_data_unittest.cc
index a8aed51..bf7004c 100644
--- a/webkit/glue/web_intent_reply_data_unittest.cc
+++ b/webkit/glue/web_intent_reply_data_unittest.cc
@@ -17,7 +17,7 @@ TEST(WebIntentReplyDataTest, DefaultValues) {
WebIntentReply reply;
EXPECT_EQ(webkit_glue::WEB_INTENT_REPLY_INVALID, reply.type);
EXPECT_EQ(string16(), reply.data);
- EXPECT_EQ(FilePath(), reply.data_file);
+ EXPECT_EQ(base::FilePath(), reply.data_file);
EXPECT_EQ(-1, reply.data_file_size);
}
@@ -39,17 +39,17 @@ TEST(WebIntentReplyDataTest, Equality) {
WebIntentReply file_a(
webkit_glue::WEB_INTENT_REPLY_SUCCESS,
- FilePath(),
+ base::FilePath(),
22);
WebIntentReply file_b(
webkit_glue::WEB_INTENT_REPLY_SUCCESS,
- FilePath(),
+ base::FilePath(),
22);
WebIntentReply file_c(
webkit_glue::WEB_INTENT_REPLY_SUCCESS,
- FilePath(),
+ base::FilePath(),
17);
EXPECT_EQ(file_a, file_b);
diff --git a/webkit/glue/webfileutilities_impl.cc b/webkit/glue/webfileutilities_impl.cc
index 3241884..fdf63a1 100644
--- a/webkit/glue/webfileutilities_impl.cc
+++ b/webkit/glue/webfileutilities_impl.cc
@@ -27,7 +27,7 @@ WebFileUtilitiesImpl::~WebFileUtilitiesImpl() {
}
bool WebFileUtilitiesImpl::fileExists(const WebString& path) {
- FilePath file_path = webkit_base::WebStringToFilePath(path);
+ base::FilePath file_path = webkit_base::WebStringToFilePath(path);
return file_util::PathExists(file_path);
}
@@ -58,33 +58,33 @@ bool WebFileUtilitiesImpl::getFileInfo(const WebString& path,
}
WebString WebFileUtilitiesImpl::directoryName(const WebString& path) {
- FilePath file_path(webkit_base::WebStringToFilePath(path));
+ base::FilePath file_path(webkit_base::WebStringToFilePath(path));
return webkit_base::FilePathToWebString(file_path.DirName());
}
WebString WebFileUtilitiesImpl::pathByAppendingComponent(
const WebString& webkit_path,
const WebString& webkit_component) {
- FilePath path(webkit_base::WebStringToFilePath(webkit_path));
- FilePath component(webkit_base::WebStringToFilePath(webkit_component));
- FilePath combined_path = path.Append(component);
+ base::FilePath path(webkit_base::WebStringToFilePath(webkit_path));
+ base::FilePath component(webkit_base::WebStringToFilePath(webkit_component));
+ base::FilePath combined_path = path.Append(component);
return webkit_base::FilePathStringToWebString(combined_path.value());
}
bool WebFileUtilitiesImpl::makeAllDirectories(const WebString& path) {
DCHECK(!sandbox_enabled_);
- FilePath file_path = webkit_base::WebStringToFilePath(path);
+ base::FilePath file_path = webkit_base::WebStringToFilePath(path);
return file_util::CreateDirectory(file_path);
}
WebString WebFileUtilitiesImpl::getAbsolutePath(const WebString& path) {
- FilePath file_path(webkit_base::WebStringToFilePath(path));
+ base::FilePath file_path(webkit_base::WebStringToFilePath(path));
file_util::AbsolutePath(&file_path);
return webkit_base::FilePathStringToWebString(file_path.value());
}
bool WebFileUtilitiesImpl::isDirectory(const WebString& path) {
- FilePath file_path(webkit_base::WebStringToFilePath(path));
+ base::FilePath file_path(webkit_base::WebStringToFilePath(path));
return file_util::DirectoryExists(file_path);
}
diff --git a/webkit/media/crypto/ppapi/clear_key_cdm.cc b/webkit/media/crypto/ppapi/clear_key_cdm.cc
index 7c6eda5..2894a52 100644
--- a/webkit/media/crypto/ppapi/clear_key_cdm.cc
+++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc
@@ -50,7 +50,7 @@ static base::AtExitManager g_at_exit_manager;
// are required for running in the sandbox, and should no longer be required
// after http://crbug.com/91970 is fixed.
static bool InitializeFFmpegLibraries() {
- FilePath file_path;
+ base::FilePath file_path;
CHECK(PathService::Get(base::DIR_EXE, &file_path));
CHECK(media::InitializeMediaLibrary(file_path));
return true;
diff --git a/webkit/mocks/mock_resource_loader_bridge.h b/webkit/mocks/mock_resource_loader_bridge.h
index 5be7d89..3af75a7 100644
--- a/webkit/mocks/mock_resource_loader_bridge.h
+++ b/webkit/mocks/mock_resource_loader_bridge.h
@@ -8,7 +8,9 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "webkit/glue/resource_loader_bridge.h"
+namespace base {
class FilePath;
+}
namespace webkit_glue {
@@ -23,7 +25,7 @@ class MockResourceLoaderBridge : public webkit_glue::ResourceLoaderBridge {
MOCK_METHOD2(AppendDataToUpload, void(const char* data, int data_len));
MOCK_METHOD4(AppendFileRangeToUpload,
- void(const FilePath& file_path,
+ void(const base::FilePath& file_path,
uint64 offset,
uint64 length,
const base::Time& expected_modification_time));
diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc
index a54c0ba..5cea951 100644
--- a/webkit/plugins/npapi/plugin_host.cc
+++ b/webkit/plugins/npapi/plugin_host.cc
@@ -467,14 +467,14 @@ static NPError PostURLNotify(NPP id,
return NPERR_FILE_NOT_FOUND;
std::string file_path_ascii(buf);
- FilePath file_path;
+ base::FilePath file_path;
static const char kFileUrlPrefix[] = "file:";
if (StartsWithASCII(file_path_ascii, kFileUrlPrefix, false)) {
GURL file_url(file_path_ascii);
DCHECK(file_url.SchemeIsFile());
net::FileURLToFilePath(file_url, &file_path);
} else {
- file_path = FilePath::FromWStringHack(
+ file_path = base::FilePath::FromWStringHack(
base::SysNativeMBToWide(file_path_ascii));
}
diff --git a/webkit/plugins/npapi/plugin_instance.cc b/webkit/plugins/npapi/plugin_instance.cc
index f26cbec..4d49a05 100644
--- a/webkit/plugins/npapi/plugin_instance.cc
+++ b/webkit/plugins/npapi/plugin_instance.cc
@@ -315,7 +315,7 @@ void PluginInstance::NPP_StreamAsFile(NPStream *stream, const char *fname) {
// Creating a temporary FilePath instance on the stack as the explicit
// FilePath constructor with StringType as an argument causes a compiler
// error when invoked via vector push back.
- FilePath file_name = FilePath::FromWStringHack(UTF8ToWide(fname));
+ base::FilePath file_name = base::FilePath::FromWStringHack(UTF8ToWide(fname));
files_created_.push_back(file_name);
}
diff --git a/webkit/plugins/npapi/plugin_lib.cc b/webkit/plugins/npapi/plugin_lib.cc
index ed01426..7b927e0 100644
--- a/webkit/plugins/npapi/plugin_lib.cc
+++ b/webkit/plugins/npapi/plugin_lib.cc
@@ -23,7 +23,7 @@ const char kPluginInstancesActiveCounter[] = "PluginInstancesActive";
// A list of all the instantiated plugins.
static std::vector<scoped_refptr<PluginLib> >* g_loaded_libs;
-PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) {
+PluginLib* PluginLib::CreatePluginLib(const base::FilePath& filename) {
// We can only have one PluginLib object per plugin as it controls the per
// instance function calls (i.e. NP_Initialize and NP_Shutdown). So we keep
// a map of PluginLib objects.
@@ -271,7 +271,7 @@ bool PluginLib::Load() {
// This is a helper to help perform a delayed NP_Shutdown and FreeLibrary on the
// plugin dll.
-void FreePluginLibraryHelper(const FilePath& path,
+void FreePluginLibraryHelper(const base::FilePath& path,
base::NativeLibrary library,
NP_ShutdownFunc shutdown_func) {
if (shutdown_func) {
diff --git a/webkit/plugins/npapi/plugin_lib.h b/webkit/plugins/npapi/plugin_lib.h
index 9051e2d..36e9a41 100644
--- a/webkit/plugins/npapi/plugin_lib.h
+++ b/webkit/plugins/npapi/plugin_lib.h
@@ -16,7 +16,9 @@
#include "webkit/plugins/npapi/webplugin.h"
#include "webkit/plugins/webkit_plugins_export.h"
+namespace base {
class FilePath;
+}
namespace webkit {
namespace npapi {
@@ -27,12 +29,12 @@ class PluginInstance;
// manager for new PluginInstances.
class WEBKIT_PLUGINS_EXPORT PluginLib : public base::RefCounted<PluginLib> {
public:
- static PluginLib* CreatePluginLib(const FilePath& filename);
+ static PluginLib* CreatePluginLib(const base::FilePath& filename);
// Creates a WebPluginInfo structure given a plugin's path. On success
// returns true, with the information being put into "info".
// Returns false if the library couldn't be found, or if it's not a plugin.
- static bool ReadWebPluginInfo(const FilePath& filename,
+ static bool ReadWebPluginInfo(const base::FilePath& filename,
webkit::WebPluginInfo* info);
#if defined(OS_POSIX) && !defined(OS_MACOSX)
diff --git a/webkit/plugins/npapi/plugin_lib_mac.mm b/webkit/plugins/npapi/plugin_lib_mac.mm
index d283100..32e40df9 100644
--- a/webkit/plugins/npapi/plugin_lib_mac.mm
+++ b/webkit/plugins/npapi/plugin_lib_mac.mm
@@ -76,7 +76,7 @@ NSDictionary* GetMIMETypes(CFBundleRef bundle) {
}
}
-bool ReadPlistPluginInfo(const FilePath& filename, CFBundleRef bundle,
+bool ReadPlistPluginInfo(const base::FilePath& filename, CFBundleRef bundle,
WebPluginInfo* info) {
NSDictionary* mime_types = GetMIMETypes(bundle);
if (!mime_types)
@@ -137,7 +137,7 @@ bool ReadPlistPluginInfo(const FilePath& filename, CFBundleRef bundle,
} // anonymous namespace
-bool PluginLib::ReadWebPluginInfo(const FilePath &filename,
+bool PluginLib::ReadWebPluginInfo(const base::FilePath &filename,
WebPluginInfo* info) {
// There are three ways to get information about plugin capabilities:
// 1) a set of Info.plist keys, documented at
diff --git a/webkit/plugins/npapi/plugin_lib_posix.cc b/webkit/plugins/npapi/plugin_lib_posix.cc
index cc3ed52..144b133 100644
--- a/webkit/plugins/npapi/plugin_lib_posix.cc
+++ b/webkit/plugins/npapi/plugin_lib_posix.cc
@@ -42,7 +42,7 @@ enum nsPluginVariable {
// Read the ELF header and return true if it is usable on
// the current architecture (e.g. 32-bit ELF on 32-bit build).
// Returns false on other errors as well.
-bool ELFMatchesCurrentArchitecture(const FilePath& filename) {
+bool ELFMatchesCurrentArchitecture(const base::FilePath& filename) {
// First make sure we can open the file and it is in fact, a regular file.
struct stat stat_buf;
// Open with O_NONBLOCK so we don't block on pipes.
@@ -91,7 +91,7 @@ struct __attribute__((packed)) NSPluginWrapperInfo {
// if so attempt to unwrap it. Pass in an opened plugin handle; on
// success, |dl| and |unwrapped_path| will be filled in with the newly
// opened plugin. On failure, params are left unmodified.
-void UnwrapNSPluginWrapper(void **dl, FilePath* unwrapped_path) {
+void UnwrapNSPluginWrapper(void **dl, base::FilePath* unwrapped_path) {
NSPluginWrapperInfo* info =
reinterpret_cast<NSPluginWrapperInfo*>(dlsym(*dl, "NPW_Plugin"));
if (!info)
@@ -107,7 +107,8 @@ void UnwrapNSPluginWrapper(void **dl, FilePath* unwrapped_path) {
sizeof(info->path)));
if (!path_end)
path_end = info->path + sizeof(info->path);
- FilePath path = FilePath(std::string(info->path, path_end - info->path));
+ base::FilePath path = base::FilePath(
+ std::string(info->path, path_end - info->path));
if (!ELFMatchesCurrentArchitecture(path)) {
LOG(WARNING) << path.value() << " is nspluginwrapper wrapping a "
@@ -139,7 +140,7 @@ void UnwrapNSPluginWrapper(void **dl, FilePath* unwrapped_path) {
} // namespace
-bool PluginLib::ReadWebPluginInfo(const FilePath& filename,
+bool PluginLib::ReadWebPluginInfo(const base::FilePath& filename,
WebPluginInfo* info) {
// The file to reference is:
// http://mxr.mozilla.org/firefox/source/modules/plugin/base/src/nsPluginsDirUnix.cpp
diff --git a/webkit/plugins/npapi/plugin_lib_win.cc b/webkit/plugins/npapi/plugin_lib_win.cc
index 224e1c3..8a0f6cc 100644
--- a/webkit/plugins/npapi/plugin_lib_win.cc
+++ b/webkit/plugins/npapi/plugin_lib_win.cc
@@ -15,7 +15,7 @@
namespace webkit {
namespace npapi {
-bool PluginLib::ReadWebPluginInfo(const FilePath &filename,
+bool PluginLib::ReadWebPluginInfo(const base::FilePath &filename,
WebPluginInfo* info) {
// On windows, the way we get the mime types for the library is
// to check the version information in the DLL itself. This
diff --git a/webkit/plugins/npapi/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc
index 5bcc960..7047a7f 100644
--- a/webkit/plugins/npapi/plugin_list.cc
+++ b/webkit/plugins/npapi/plugin_list.cc
@@ -86,7 +86,7 @@ void PluginList::RefreshPlugins() {
loading_state_ = LOADING_STATE_NEEDS_REFRESH;
}
-void PluginList::AddExtraPluginPath(const FilePath& plugin_path) {
+void PluginList::AddExtraPluginPath(const base::FilePath& plugin_path) {
if (!NPAPIPluginsSupported()) {
// TODO(jam): remove and just have CHECK once we're sure this doesn't get
// triggered.
@@ -101,16 +101,16 @@ void PluginList::AddExtraPluginPath(const FilePath& plugin_path) {
#endif
}
-void PluginList::RemoveExtraPluginPath(const FilePath& plugin_path) {
+void PluginList::RemoveExtraPluginPath(const base::FilePath& plugin_path) {
base::AutoLock lock(lock_);
- std::vector<FilePath>::iterator it =
+ std::vector<base::FilePath>::iterator it =
std::find(extra_plugin_paths_.begin(), extra_plugin_paths_.end(),
plugin_path);
if (it != extra_plugin_paths_.end())
extra_plugin_paths_.erase(it);
}
-void PluginList::AddExtraPluginDir(const FilePath& plugin_dir) {
+void PluginList::AddExtraPluginDir(const base::FilePath& plugin_dir) {
// Chrome OS only loads plugins from /opt/google/chrome/plugins.
#if !defined(OS_CHROMEOS)
base::AutoLock lock(lock_);
@@ -148,7 +148,7 @@ void PluginList::RegisterInternalPluginWithEntryPoints(
}
}
-void PluginList::UnregisterInternalPlugin(const FilePath& path) {
+void PluginList::UnregisterInternalPlugin(const base::FilePath& path) {
base::AutoLock lock(lock_);
for (size_t i = 0; i < internal_plugins_.size(); i++) {
if (internal_plugins_[i].info.path == path) {
@@ -170,7 +170,7 @@ void PluginList::GetInternalPlugins(
}
}
-bool PluginList::ReadPluginInfo(const FilePath& filename,
+bool PluginList::ReadPluginInfo(const base::FilePath& filename,
webkit::WebPluginInfo* info,
const PluginEntryPoints** entry_points) {
{
@@ -252,10 +252,10 @@ void PluginList::LoadPluginsIntoPluginListInternal(
if (!will_load_callback.is_null())
will_load_callback.Run();
- std::vector<FilePath> plugin_paths;
+ std::vector<base::FilePath> plugin_paths;
GetPluginPathsToLoad(&plugin_paths);
- for (std::vector<FilePath>::const_iterator it = plugin_paths.begin();
+ for (std::vector<base::FilePath>::const_iterator it = plugin_paths.begin();
it != plugin_paths.end();
++it) {
WebPluginInfo plugin_info;
@@ -286,7 +286,7 @@ void PluginList::LoadPlugins() {
}
bool PluginList::LoadPluginIntoPluginList(
- const FilePath& path,
+ const base::FilePath& path,
std::vector<webkit::WebPluginInfo>* plugins,
WebPluginInfo* plugin_info) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
@@ -316,11 +316,11 @@ bool PluginList::LoadPluginIntoPluginList(
return true;
}
-void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) {
+void PluginList::GetPluginPathsToLoad(std::vector<base::FilePath>* plugin_paths) {
// Don't want to hold the lock while loading new plugins, so we don't block
// other methods if they're called on other threads.
- std::vector<FilePath> extra_plugin_paths;
- std::vector<FilePath> extra_plugin_dirs;
+ std::vector<base::FilePath> extra_plugin_paths;
+ std::vector<base::FilePath> extra_plugin_dirs;
{
base::AutoLock lock(lock_);
extra_plugin_paths = extra_plugin_paths_;
@@ -328,7 +328,7 @@ void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) {
}
for (size_t i = 0; i < extra_plugin_paths.size(); ++i) {
- const FilePath& path = extra_plugin_paths[i];
+ const base::FilePath& path = extra_plugin_paths[i];
if (std::find(plugin_paths->begin(), plugin_paths->end(), path) !=
plugin_paths->end()) {
continue;
@@ -342,7 +342,7 @@ void PluginList::GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths) {
for (size_t i = 0; i < extra_plugin_dirs.size(); ++i)
GetPluginsInDir(extra_plugin_dirs[i], plugin_paths);
- std::vector<FilePath> directories_to_scan;
+ std::vector<base::FilePath> directories_to_scan;
GetPluginDirectories(&directories_to_scan);
for (size_t i = 0; i < directories_to_scan.size(); ++i)
GetPluginsInDir(directories_to_scan[i], plugin_paths);
@@ -401,12 +401,12 @@ void PluginList::GetPluginInfoArray(
if (actual_mime_types)
actual_mime_types->clear();
- std::set<FilePath> visited_plugins;
+ std::set<base::FilePath> visited_plugins;
// Add in plugins by mime type.
for (size_t i = 0; i < plugins_list_.size(); ++i) {
if (SupportsType(plugins_list_[i], mime_type, allow_wildcard)) {
- FilePath path = plugins_list_[i].path;
+ base::FilePath path = plugins_list_[i].path;
if (visited_plugins.insert(path).second) {
info->push_back(plugins_list_[i]);
if (actual_mime_types)
@@ -423,7 +423,7 @@ void PluginList::GetPluginInfoArray(
std::string actual_mime_type;
for (size_t i = 0; i < plugins_list_.size(); ++i) {
if (SupportsExtension(plugins_list_[i], extension, &actual_mime_type)) {
- FilePath path = plugins_list_[i].path;
+ base::FilePath path = plugins_list_[i].path;
if (visited_plugins.insert(path).second &&
AllowMimeTypeMismatch(mime_type, actual_mime_type)) {
info->push_back(plugins_list_[i]);
diff --git a/webkit/plugins/npapi/plugin_list.h b/webkit/plugins/npapi/plugin_list.h
index f34a18a..1cd82ed 100644
--- a/webkit/plugins/npapi/plugin_list.h
+++ b/webkit/plugins/npapi/plugin_list.h
@@ -71,14 +71,14 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// Add/Remove an extra plugin to load when we actually do the loading. Must
// be called before the plugins have been loaded.
- void AddExtraPluginPath(const FilePath& plugin_path);
- void RemoveExtraPluginPath(const FilePath& plugin_path);
+ void AddExtraPluginPath(const base::FilePath& plugin_path);
+ void RemoveExtraPluginPath(const base::FilePath& plugin_path);
// Same as above, but specifies a directory in which to search for plugins.
- void AddExtraPluginDir(const FilePath& plugin_dir);
+ void AddExtraPluginDir(const base::FilePath& plugin_dir);
// Get the ordered list of directories from which to load plugins
- void GetPluginDirectories(std::vector<FilePath>* plugin_dirs);
+ void GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs);
// Register an internal plugin with the specified plugin information.
// An internal plugin must be registered before it can
@@ -100,7 +100,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// on the path from the version info previously registered.
//
// This is generally only necessary for tests.
- void UnregisterInternalPlugin(const FilePath& path);
+ void UnregisterInternalPlugin(const base::FilePath& path);
// Gets a list of all the registered internal plugins.
void GetInternalPlugins(std::vector<webkit::WebPluginInfo>* plugins);
@@ -110,7 +110,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// internal plugin, "entry_points" is filled in as well with a
// internally-owned PluginEntryPoints pointer.
// Returns false if the library couldn't be found, or if it's not a plugin.
- bool ReadPluginInfo(const FilePath& filename,
+ bool ReadPluginInfo(const base::FilePath& filename,
webkit::WebPluginInfo* info,
const PluginEntryPoints** entry_points);
@@ -153,7 +153,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// Load a specific plugin with full path. Return true iff loading the plug-in
// was successful.
- bool LoadPluginIntoPluginList(const FilePath& filename,
+ bool LoadPluginIntoPluginList(const base::FilePath& filename,
std::vector<webkit::WebPluginInfo>* plugins,
webkit::WebPluginInfo* plugin_info);
@@ -161,7 +161,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// using a different instance of this class.
// Computes a list of all plugins to potentially load from all sources.
- void GetPluginPathsToLoad(std::vector<FilePath>* plugin_paths);
+ void GetPluginPathsToLoad(std::vector<base::FilePath>* plugin_paths);
// Clears the internal list of Plugins and copies them from the vector.
void SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins);
@@ -200,7 +200,8 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// Walks a directory and produces a list of all the plugins to potentially
// load in that directory.
- void GetPluginsInDir(const FilePath& path, std::vector<FilePath>* plugins);
+ void GetPluginsInDir(const base::FilePath& path,
+ std::vector<base::FilePath>* plugins);
// Returns true if we should load the given plugin, or false otherwise.
// |plugins| is the list of plugins we have crawled in the current plugin
@@ -234,7 +235,7 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
// Gets plugin paths registered under HKCU\Software\MozillaPlugins and
// HKLM\Software\MozillaPlugins.
- void GetPluginPathsFromRegistry(std::vector<FilePath>* plugins);
+ void GetPluginPathsFromRegistry(std::vector<base::FilePath>* plugins);
#endif
//
@@ -247,10 +248,10 @@ class WEBKIT_PLUGINS_EXPORT PluginList {
LoadingState loading_state_;
// Extra plugin paths that we want to search when loading.
- std::vector<FilePath> extra_plugin_paths_;
+ std::vector<base::FilePath> extra_plugin_paths_;
// Extra plugin directories that we want to search when loading.
- std::vector<FilePath> extra_plugin_dirs_;
+ std::vector<base::FilePath> extra_plugin_dirs_;
// Holds information about internal plugins.
std::vector<InternalPlugin> internal_plugins_;
diff --git a/webkit/plugins/npapi/plugin_list_mac.mm b/webkit/plugins/npapi/plugin_list_mac.mm
index 719301d..b818f89 100644
--- a/webkit/plugins/npapi/plugin_list_mac.mm
+++ b/webkit/plugins/npapi/plugin_list_mac.mm
@@ -19,7 +19,7 @@ namespace npapi {
namespace {
-void GetPluginCommonDirectory(std::vector<FilePath>* plugin_dirs,
+void GetPluginCommonDirectory(std::vector<base::FilePath>* plugin_dirs,
bool user) {
// Note that there are no NSSearchPathDirectory constants for these
// directories so we can't use Cocoa's NSSearchPathForDirectoriesInDomains().
@@ -32,7 +32,7 @@ void GetPluginCommonDirectory(std::vector<FilePath>* plugin_dirs,
if (err)
return;
- plugin_dirs->push_back(FilePath(base::mac::PathFromFSRef(ref)));
+ plugin_dirs->push_back(base::FilePath(base::mac::PathFromFSRef(ref)));
}
// Returns true if the plugin should be prevented from loading.
@@ -68,7 +68,7 @@ bool IsBlacklistedPlugin(const WebPluginInfo& info) {
void PluginList::PlatformInit() {
}
-void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
+void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) {
// Load from the user's area
GetPluginCommonDirectory(plugin_dirs, true);
@@ -77,11 +77,11 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
}
void PluginList::GetPluginsInDir(
- const FilePath& path, std::vector<FilePath>* plugins) {
+ const base::FilePath& path, std::vector<base::FilePath>* plugins) {
file_util::FileEnumerator enumerator(path,
false, // not recursive
file_util::FileEnumerator::DIRECTORIES);
- for (FilePath path = enumerator.Next(); !path.value().empty();
+ for (base::FilePath path = enumerator.Next(); !path.value().empty();
path = enumerator.Next()) {
plugins->push_back(path);
}
diff --git a/webkit/plugins/npapi/plugin_list_posix.cc b/webkit/plugins/npapi/plugin_list_posix.cc
index 94974a5..62c4990 100644
--- a/webkit/plugins/npapi/plugin_list_posix.cc
+++ b/webkit/plugins/npapi/plugin_list_posix.cc
@@ -21,7 +21,7 @@ namespace npapi {
namespace {
// We build up a list of files and mtimes so we can sort them.
-typedef std::pair<FilePath, base::Time> FileAndTime;
+typedef std::pair<base::FilePath, base::Time> FileAndTime;
typedef std::vector<FileAndTime> FileTimeList;
enum PluginQuirk {
@@ -63,7 +63,7 @@ bool CheckQuirks(PluginQuirk quirks) {
// Also check against any PluginQuirks the bad plugin may have.
// The use of the file size is an optimization so we don't have to read in
// the entire file unless we have to.
-bool IsBlacklistedBySha1sumAndQuirks(const FilePath& path) {
+bool IsBlacklistedBySha1sumAndQuirks(const base::FilePath& path) {
const struct BadEntry {
int64 size;
std::string sha1;
@@ -123,7 +123,7 @@ bool IsUndesirablePlugin(const WebPluginInfo& info) {
// This is an ugly hack to blacklist Adobe Acrobat due to not supporting
// its Xt-based mainloop.
// http://code.google.com/p/chromium/issues/detail?id=38229
-bool IsBlacklistedPlugin(const FilePath& path) {
+bool IsBlacklistedPlugin(const base::FilePath& path) {
const char* kBlackListedPlugins[] = {
"nppdf.so", // Adobe PDF
};
@@ -141,7 +141,7 @@ bool IsBlacklistedPlugin(const FilePath& path) {
void PluginList::PlatformInit() {
}
-void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
+void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) {
// See http://groups.google.com/group/chromium-dev/browse_thread/thread/7a70e5fcbac786a9
// for discussion.
// We first consult Chrome-specific dirs, then fall back on the logic
@@ -152,7 +152,7 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
// related to extra_plugin_dirs in plugin_list.cc.
// The Chrome binary dir + "plugins/".
- FilePath dir;
+ base::FilePath dir;
PathService::Get(base::DIR_EXE, &dir);
plugin_dirs->push_back(dir.Append("plugins"));
@@ -169,36 +169,36 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
std::vector<std::string> paths;
base::SplitString(moz_plugin_path, ':', &paths);
for (size_t i = 0; i < paths.size(); ++i)
- plugin_dirs->push_back(FilePath(paths[i]));
+ plugin_dirs->push_back(base::FilePath(paths[i]));
}
// 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins.
// This is a de-facto standard, so even though we're not Mozilla, let's
// look in there too.
- FilePath home = file_util::GetHomeDir();
+ base::FilePath home = file_util::GetHomeDir();
if (!home.empty())
plugin_dirs->push_back(home.Append(".mozilla/plugins"));
// 3) NS_SYSTEM_PLUGINS_DIR:
// This varies across different browsers and versions, so check 'em all.
- plugin_dirs->push_back(FilePath("/usr/lib/browser-plugins"));
- plugin_dirs->push_back(FilePath("/usr/lib/mozilla/plugins"));
- plugin_dirs->push_back(FilePath("/usr/lib/firefox/plugins"));
- plugin_dirs->push_back(FilePath("/usr/lib/xulrunner-addons/plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib/browser-plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib/mozilla/plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib/firefox/plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib/xulrunner-addons/plugins"));
#if defined(ARCH_CPU_64_BITS)
// On my Ubuntu system, /usr/lib64 is a symlink to /usr/lib.
// But a user reported on their Fedora system they are separate.
- plugin_dirs->push_back(FilePath("/usr/lib64/browser-plugins"));
- plugin_dirs->push_back(FilePath("/usr/lib64/mozilla/plugins"));
- plugin_dirs->push_back(FilePath("/usr/lib64/firefox/plugins"));
- plugin_dirs->push_back(FilePath("/usr/lib64/xulrunner-addons/plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib64/browser-plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib64/mozilla/plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib64/firefox/plugins"));
+ plugin_dirs->push_back(base::FilePath("/usr/lib64/xulrunner-addons/plugins"));
#endif // defined(ARCH_CPU_64_BITS)
#endif // !defined(OS_CHROMEOS)
}
void PluginList::GetPluginsInDir(
- const FilePath& dir_path, std::vector<FilePath>* plugins) {
+ const base::FilePath& dir_path, std::vector<base::FilePath>* plugins) {
// See ScanPluginsDirectory near
// http://mxr.mozilla.org/firefox/source/modules/plugin/base/src/nsPluginHostImpl.cpp#5052
@@ -208,7 +208,7 @@ void PluginList::GetPluginsInDir(
file_util::FileEnumerator enumerator(dir_path,
false, // not recursive
file_util::FileEnumerator::FILES);
- for (FilePath path = enumerator.Next(); !path.value().empty();
+ for (base::FilePath path = enumerator.Next(); !path.value().empty();
path = enumerator.Next()) {
// Skip over Mozilla .xpt files.
if (path.MatchesExtension(FILE_PATH_LITERAL(".xpt")))
@@ -218,7 +218,7 @@ void PluginList::GetPluginsInDir(
// its path to find dependent data files.
// file_util::AbsolutePath calls through to realpath(), which resolves
// symlinks.
- FilePath orig_path = path;
+ base::FilePath orig_path = path;
file_util::AbsolutePath(&path);
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "Resolved " << orig_path.value() << " -> " << path.value();
diff --git a/webkit/plugins/npapi/plugin_list_unittest.cc b/webkit/plugins/npapi/plugin_list_unittest.cc
index 5d198d1..0fc55bf 100644
--- a/webkit/plugins/npapi/plugin_list_unittest.cc
+++ b/webkit/plugins/npapi/plugin_list_unittest.cc
@@ -31,8 +31,8 @@ bool Contains(const std::vector<WebPluginInfo>& list,
return false;
}
-FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin");
-FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin");
+base::FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin");
+base::FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin");
const char* kFooName = "Foo Plugin";
} // namespace
@@ -41,11 +41,11 @@ class PluginListTest : public testing::Test {
public:
PluginListTest()
: foo_plugin_(ASCIIToUTF16(kFooName),
- FilePath(kFooPath),
+ base::FilePath(kFooPath),
ASCIIToUTF16("1.2.3"),
ASCIIToUTF16("foo")),
bar_plugin_(ASCIIToUTF16("Bar Plugin"),
- FilePath(kBarPath),
+ base::FilePath(kBarPath),
ASCIIToUTF16("2.3.4"),
ASCIIToUTF16("bar")) {
}
@@ -71,7 +71,7 @@ TEST_F(PluginListTest, GetPlugins) {
TEST_F(PluginListTest, BadPluginDescription) {
WebPluginInfo plugin_3043(
- string16(), FilePath(FILE_PATH_LITERAL("/myplugin.3.0.43")),
+ string16(), base::FilePath(FILE_PATH_LITERAL("/myplugin.3.0.43")),
string16(), string16());
// Simulate loading of the plugins.
plugin_list_.ClearPluginsToLoad();
diff --git a/webkit/plugins/npapi/plugin_list_win.cc b/webkit/plugins/npapi/plugin_list_win.cc
index 22dce63..0f19d08 100644
--- a/webkit/plugins/npapi/plugin_list_win.cc
+++ b/webkit/plugins/npapi/plugin_list_win.cc
@@ -43,7 +43,7 @@ const char16 kRegistryJavaHome[] = L"JavaHome";
const char16 kJavaDeploy1[] = L"npdeploytk.dll";
const char16 kJavaDeploy2[] = L"npdeployjava1.dll";
-FilePath AppendPluginsDir(const FilePath& path) {
+base::FilePath AppendPluginsDir(const base::FilePath& path) {
return path.AppendASCII("plugins");
}
@@ -51,8 +51,8 @@ FilePath AppendPluginsDir(const FilePath& path) {
// may be a versioned subdirectory, or it may be the same directory as the
// GetExeDirectory(), depending on the embedder's implementation.
// Path is an output parameter to receive the path.
-void GetAppDirectory(std::set<FilePath>* plugin_dirs) {
- FilePath app_path;
+void GetAppDirectory(std::set<base::FilePath>* plugin_dirs) {
+ base::FilePath app_path;
if (!PathService::Get(base::DIR_MODULE, &app_path))
return;
plugin_dirs->insert(AppendPluginsDir(app_path));
@@ -60,15 +60,15 @@ void GetAppDirectory(std::set<FilePath>* plugin_dirs) {
// Gets the directory where the launching executable resides on disk.
// Path is an output parameter to receive the path.
-void GetExeDirectory(std::set<FilePath>* plugin_dirs) {
- FilePath exe_path;
+void GetExeDirectory(std::set<base::FilePath>* plugin_dirs) {
+ base::FilePath exe_path;
if (!PathService::Get(base::DIR_EXE, &exe_path))
return;
plugin_dirs->insert(AppendPluginsDir(exe_path));
}
// Gets the installed path for a registered app.
-bool GetInstalledPath(const char16* app, FilePath* out) {
+bool GetInstalledPath(const char16* app, base::FilePath* out) {
string16 reg_path(kRegistryApps);
reg_path.append(L"\\");
reg_path.append(app);
@@ -78,12 +78,12 @@ bool GetInstalledPath(const char16* app, FilePath* out) {
// As of Win7 AppPaths can also be registered in HKCU: http://goo.gl/UgFOf.
if (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
hkcu_key.ReadValue(kRegistryPath, &path) == ERROR_SUCCESS) {
- *out = FilePath(path);
+ *out = base::FilePath(path);
return true;
} else {
base::win::RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ);
if (hklm_key.ReadValue(kRegistryPath, &path) == ERROR_SUCCESS) {
- *out = FilePath(path);
+ *out = base::FilePath(path);
return true;
}
}
@@ -95,7 +95,7 @@ bool GetInstalledPath(const char16* app, FilePath* out) {
void GetPluginsInRegistryDirectory(
HKEY root_key,
const string16& registry_folder,
- std::set<FilePath>* plugin_dirs) {
+ std::set<base::FilePath>* plugin_dirs) {
for (base::win::RegistryKeyIterator iter(root_key, registry_folder.c_str());
iter.Valid(); ++iter) {
// Use the registry to gather plugin across the file system.
@@ -106,13 +106,13 @@ void GetPluginsInRegistryDirectory(
string16 path;
if (key.ReadValue(kRegistryPath, &path) == ERROR_SUCCESS)
- plugin_dirs->insert(FilePath(path));
+ plugin_dirs->insert(base::FilePath(path));
}
}
// Enumerate through the registry key to find all installed FireFox paths.
// FireFox 3 beta and version 2 can coexist. See bug: 1025003
-void GetFirefoxInstalledPaths(std::vector<FilePath>* out) {
+void GetFirefoxInstalledPaths(std::vector<base::FilePath>* out) {
base::win::RegistryKeyIterator it(HKEY_LOCAL_MACHINE,
kRegistryFirefoxInstalled);
for (; it.Valid(); ++it) {
@@ -122,7 +122,7 @@ void GetFirefoxInstalledPaths(std::vector<FilePath>* out) {
string16 install_dir;
if (key.ReadValue(L"Install Directory", &install_dir) != ERROR_SUCCESS)
continue;
- out->push_back(FilePath(install_dir));
+ out->push_back(base::FilePath(install_dir));
}
}
@@ -130,14 +130,14 @@ void GetFirefoxInstalledPaths(std::vector<FilePath>* out) {
// of a kludge, but it helps us locate the flash player for users that
// already have it for firefox. Not having to download yet-another-plugin
// is a good thing.
-void GetFirefoxDirectory(std::set<FilePath>* plugin_dirs) {
- std::vector<FilePath> paths;
+void GetFirefoxDirectory(std::set<base::FilePath>* plugin_dirs) {
+ std::vector<base::FilePath> paths;
GetFirefoxInstalledPaths(&paths);
for (unsigned int i = 0; i < paths.size(); ++i) {
plugin_dirs->insert(AppendPluginsDir(paths[i]));
}
- FilePath firefox_app_data_plugin_path;
+ base::FilePath firefox_app_data_plugin_path;
if (PathService::Get(base::DIR_APP_DATA, &firefox_app_data_plugin_path)) {
firefox_app_data_plugin_path =
firefox_app_data_plugin_path.AppendASCII("Mozilla");
@@ -146,8 +146,8 @@ void GetFirefoxDirectory(std::set<FilePath>* plugin_dirs) {
}
// Hardcoded logic to detect Acrobat plugins locations.
-void GetAcrobatDirectory(std::set<FilePath>* plugin_dirs) {
- FilePath path;
+void GetAcrobatDirectory(std::set<base::FilePath>* plugin_dirs) {
+ base::FilePath path;
if (!GetInstalledPath(kRegistryAcrobatReader, &path) &&
!GetInstalledPath(kRegistryAcrobat, &path)) {
return;
@@ -157,21 +157,21 @@ void GetAcrobatDirectory(std::set<FilePath>* plugin_dirs) {
}
// Hardcoded logic to detect QuickTime plugin location.
-void GetQuicktimeDirectory(std::set<FilePath>* plugin_dirs) {
- FilePath path;
+void GetQuicktimeDirectory(std::set<base::FilePath>* plugin_dirs) {
+ base::FilePath path;
if (GetInstalledPath(kRegistryQuickTime, &path))
plugin_dirs->insert(AppendPluginsDir(path));
}
// Hardcoded logic to detect Windows Media Player plugin location.
-void GetWindowsMediaDirectory(std::set<FilePath>* plugin_dirs) {
- FilePath path;
+void GetWindowsMediaDirectory(std::set<base::FilePath>* plugin_dirs) {
+ base::FilePath path;
if (GetInstalledPath(kRegistryWindowsMedia, &path))
plugin_dirs->insert(path);
}
// Hardcoded logic to detect Java plugin location.
-void GetJavaDirectory(std::set<FilePath>* plugin_dirs) {
+void GetJavaDirectory(std::set<base::FilePath>* plugin_dirs) {
// Load the new NPAPI Java plugin
// 1. Open the main JRE key under HKLM
base::win::RegKey java_key(HKEY_LOCAL_MACHINE, kRegistryJava,
@@ -199,12 +199,12 @@ void GetJavaDirectory(std::set<FilePath>* plugin_dirs) {
// 5. We don't know the exact name of the DLL but it's in the form
// NP*.dll so just invoke LoadPlugins on this path.
- plugin_dirs->insert(FilePath(java_plugin_directory));
+ plugin_dirs->insert(base::FilePath(java_plugin_directory));
}
}
}
-bool IsValid32BitImage(const FilePath& path) {
+bool IsValid32BitImage(const base::FilePath& path) {
file_util::MemoryMappedFile plugin_image;
if (!plugin_image.InitializeAsImageSection(path))
@@ -266,9 +266,9 @@ void PluginList::PlatformInit() {
dont_load_new_wmp_ = command_line.HasSwitch(switches::kUseOldWMPPlugin);
}
-void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
+void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) {
// We use a set for uniqueness, which we require, over order, which we do not.
- std::set<FilePath> dirs;
+ std::set<base::FilePath> dirs;
// Load from the application-specific area
GetAppDirectory(&dirs);
@@ -289,12 +289,12 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) {
GetQuicktimeDirectory(&dirs);
GetWindowsMediaDirectory(&dirs);
- for (std::set<FilePath>::iterator i = dirs.begin(); i != dirs.end(); ++i)
+ for (std::set<base::FilePath>::iterator i = dirs.begin(); i != dirs.end(); ++i)
plugin_dirs->push_back(*i);
}
void PluginList::GetPluginsInDir(
- const FilePath& path, std::vector<FilePath>* plugins) {
+ const base::FilePath& path, std::vector<base::FilePath>* plugins) {
WIN32_FIND_DATA find_file_data;
HANDLE find_handle;
@@ -308,7 +308,7 @@ void PluginList::GetPluginsInDir(
do {
if (!(find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- FilePath filename = path.Append(find_file_data.cFileName);
+ base::FilePath filename = path.Append(find_file_data.cFileName);
plugins->push_back(filename);
}
} while (FindNextFile(find_handle, &find_file_data) != 0);
@@ -317,15 +317,15 @@ void PluginList::GetPluginsInDir(
FindClose(find_handle);
}
-void PluginList::GetPluginPathsFromRegistry(std::vector<FilePath>* plugins) {
- std::set<FilePath> plugin_dirs;
+void PluginList::GetPluginPathsFromRegistry(std::vector<base::FilePath>* plugins) {
+ std::set<base::FilePath> plugin_dirs;
GetPluginsInRegistryDirectory(
HKEY_CURRENT_USER, kRegistryMozillaPlugins, &plugin_dirs);
GetPluginsInRegistryDirectory(
HKEY_LOCAL_MACHINE, kRegistryMozillaPlugins, &plugin_dirs);
- for (std::set<FilePath>::iterator i = plugin_dirs.begin();
+ for (std::set<base::FilePath>::iterator i = plugin_dirs.begin();
i != plugin_dirs.end(); ++i) {
plugins->push_back(*i);
}
@@ -336,9 +336,9 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
std::vector<webkit::WebPluginInfo>* plugins) {
// Version check
for (size_t j = 0; j < plugins->size(); ++j) {
- FilePath::StringType plugin1 =
+ base::FilePath::StringType plugin1 =
StringToLowerASCII((*plugins)[j].path.BaseName().value());
- FilePath::StringType plugin2 =
+ base::FilePath::StringType plugin2 =
StringToLowerASCII(info.path.BaseName().value());
if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) ||
(plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) ||
@@ -361,7 +361,7 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
}
// Troublemakers.
- FilePath::StringType filename =
+ base::FilePath::StringType filename =
StringToLowerASCII(info.path.BaseName().value());
// Depends on XPCOM.
if (filename == kMozillaActiveXPlugin)
@@ -383,7 +383,7 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
// We only work with newer versions of the Java plugin which use NPAPI only
// and don't depend on XPCOM.
if (filename == kJavaPlugin1 || filename == kJavaPlugin2) {
- std::vector<FilePath::StringType> ver;
+ std::vector<base::FilePath::StringType> ver;
base::SplitString(info.version, '.', &ver);
int major, minor, update;
if (ver.size() == 4 &&
@@ -417,7 +417,7 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
#if !defined(ARCH_CPU_X86_64)
// The plugin in question could be a 64 bit plugin which we cannot load.
- FilePath plugin_path(info.path);
+ base::FilePath plugin_path(info.path);
file_util::AbsolutePath(&plugin_path);
if (!IsValid32BitImage(plugin_path))
return false;
diff --git a/webkit/plugins/npapi/plugin_stream.cc b/webkit/plugins/npapi/plugin_stream.cc
index 8946030..543ab3e 100644
--- a/webkit/plugins/npapi/plugin_stream.cc
+++ b/webkit/plugins/npapi/plugin_stream.cc
@@ -84,9 +84,9 @@ bool PluginStream::Open(const std::string& mime_type,
GURL gurl(stream_.url);
#if defined(OS_WIN)
- FilePath path(UTF8ToWide(gurl.path()));
+ base::FilePath path(UTF8ToWide(gurl.path()));
#elif defined(OS_POSIX)
- FilePath path(gurl.path());
+ base::FilePath path(gurl.path());
#endif
if (net::GetMimeTypeFromFile(path, &temp_mime_type))
char_mime_type = temp_mime_type.c_str();
diff --git a/webkit/plugins/npapi/plugin_stream.h b/webkit/plugins/npapi/plugin_stream.h
index 2bc691a..10993f0 100644
--- a/webkit/plugins/npapi/plugin_stream.h
+++ b/webkit/plugins/npapi/plugin_stream.h
@@ -146,7 +146,7 @@ class PluginStream : public base::RefCounted<PluginStream> {
HANDLE temp_file_handle_;
#elif defined(OS_POSIX)
FILE* temp_file_;
- FilePath temp_file_path_;
+ base::FilePath temp_file_path_;
#endif
std::vector<char> delivery_data_;
int data_offset_;
diff --git a/webkit/plugins/npapi/plugin_stream_posix.cc b/webkit/plugins/npapi/plugin_stream_posix.cc
index 3422d99..ab4b0d4 100644
--- a/webkit/plugins/npapi/plugin_stream_posix.cc
+++ b/webkit/plugins/npapi/plugin_stream_posix.cc
@@ -19,7 +19,7 @@ void PluginStream::ResetTempFileHandle() {
}
void PluginStream::ResetTempFileName() {
- temp_file_path_ = FilePath();
+ temp_file_path_ = base::FilePath();
}
void PluginStream::WriteAsFile() {
diff --git a/webkit/plugins/npapi/test/plugin_geturl_test.cc b/webkit/plugins/npapi/test/plugin_geturl_test.cc
index f03c5c31..b1ab554 100644
--- a/webkit/plugins/npapi/test/plugin_geturl_test.cc
+++ b/webkit/plugins/npapi/test/plugin_geturl_test.cc
@@ -187,10 +187,10 @@ NPError PluginGetURLTest::NewStream(NPMIMEType type, NPStream* stream,
#if defined(OS_WIN)
filename = filename.substr(8); // remove "file:///"
// Assume an ASCII path on Windows.
- FilePath path = FilePath(ASCIIToWide(filename));
+ base::FilePath path = base::FilePath(ASCIIToWide(filename));
#else
filename = filename.substr(7); // remove "file://"
- FilePath path = FilePath(filename);
+ base::FilePath path = base::FilePath(filename);
#endif
test_file_ = file_util::OpenFile(path, "r");
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.cc b/webkit/plugins/npapi/webplugin_delegate_impl.cc
index e3f5785..3ff6116 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl.cc
+++ b/webkit/plugins/npapi/webplugin_delegate_impl.cc
@@ -24,7 +24,7 @@ namespace webkit {
namespace npapi {
WebPluginDelegateImpl* WebPluginDelegateImpl::Create(
- const FilePath& filename,
+ const base::FilePath& filename,
const std::string& mime_type) {
scoped_refptr<PluginLib> plugin_lib(PluginLib::CreatePluginLib(filename));
if (plugin_lib.get() == NULL)
@@ -239,7 +239,7 @@ void WebPluginDelegateImpl::DidManualLoadFail() {
instance()->DidManualLoadFail();
}
-FilePath WebPluginDelegateImpl::GetPluginPath() {
+base::FilePath WebPluginDelegateImpl::GetPluginPath() {
return instance()->plugin_lib()->plugin_info().path;
}
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.h b/webkit/plugins/npapi/webplugin_delegate_impl.h
index 38f18cd..d0a624b 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl.h
+++ b/webkit/plugins/npapi/webplugin_delegate_impl.h
@@ -27,7 +27,9 @@
typedef struct _GdkDrawable GdkPixmap;
#endif
+namespace base {
class FilePath;
+}
#if defined(OS_MACOSX)
#ifdef __OBJC__
@@ -77,7 +79,7 @@ class WEBKIT_PLUGINS_EXPORT WebPluginDelegateImpl : public WebPluginDelegate {
PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows.
};
- static WebPluginDelegateImpl* Create(const FilePath& filename,
+ static WebPluginDelegateImpl* Create(const base::FilePath& filename,
const std::string& mime_type);
#if defined(OS_WIN)
@@ -138,7 +140,7 @@ class WEBKIT_PLUGINS_EXPORT WebPluginDelegateImpl : public WebPluginDelegate {
gfx::Rect GetClipRect() const { return clip_rect_; }
// Returns the path for the library implementing this plugin.
- FilePath GetPluginPath();
+ base::FilePath GetPluginPath();
// Returns a combination of PluginQuirks.
int GetQuirks() const { return quirks_; }
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index 64a36e2..357bb01 100644
--- a/webkit/plugins/npapi/webplugin_impl.cc
+++ b/webkit/plugins/npapi/webplugin_impl.cc
@@ -464,7 +464,7 @@ bool WebPluginImpl::isPlaceholder() {
WebPluginImpl::WebPluginImpl(
WebFrame* webframe,
const WebPluginParams& params,
- const FilePath& file_path,
+ const base::FilePath& file_path,
const base::WeakPtr<WebPluginPageDelegate>& page_delegate)
: windowless_(false),
window_(gfx::kNullPluginWindow),
diff --git a/webkit/plugins/npapi/webplugin_impl.h b/webkit/plugins/npapi/webplugin_impl.h
index 844ddd4..90ac280 100644
--- a/webkit/plugins/npapi/webplugin_impl.h
+++ b/webkit/plugins/npapi/webplugin_impl.h
@@ -58,7 +58,7 @@ class WEBKIT_PLUGINS_EXPORT WebPluginImpl :
WebPluginImpl(
WebKit::WebFrame* frame,
const WebKit::WebPluginParams& params,
- const FilePath& file_path,
+ const base::FilePath& file_path,
const base::WeakPtr<WebPluginPageDelegate>& page_delegate);
virtual ~WebPluginImpl();
@@ -315,7 +315,7 @@ class WEBKIT_PLUGINS_EXPORT WebPluginImpl :
WebPluginGeometry geometry_;
// The location of the plugin on disk.
- FilePath file_path_;
+ base::FilePath file_path_;
// The mime type of the plugin.
std::string mime_type_;
diff --git a/webkit/plugins/npapi/webplugin_page_delegate.h b/webkit/plugins/npapi/webplugin_page_delegate.h
index ec4b34a..e632014 100644
--- a/webkit/plugins/npapi/webplugin_page_delegate.h
+++ b/webkit/plugins/npapi/webplugin_page_delegate.h
@@ -9,7 +9,9 @@
#include "ui/gfx/native_widget_types.h"
+namespace base {
class FilePath;
+}
namespace WebKit {
class WebCookieJar;
@@ -29,12 +31,12 @@ class WebPluginPageDelegate {
// new plugin is instanced. See CreateWebPluginDelegateHelper
// for a default WebPluginDelegate implementation.
virtual WebPluginDelegate* CreatePluginDelegate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const std::string& mime_type) = 0;
// Caled to create a replacement plug-in when loading a plug-in failed.
virtual WebKit::WebPlugin* CreatePluginReplacement(
- const FilePath& file_path) = 0;
+ const base::FilePath& file_path) = 0;
// Called when a windowed plugin is created.
// Lets the view delegate create anything it is using to wrap the plugin.
diff --git a/webkit/plugins/ppapi/file_callbacks.cc b/webkit/plugins/ppapi/file_callbacks.cc
index 0ab4453..dd8906d 100644
--- a/webkit/plugins/ppapi/file_callbacks.cc
+++ b/webkit/plugins/ppapi/file_callbacks.cc
@@ -46,7 +46,7 @@ void FileCallbacks::DidSucceed() {
void FileCallbacks::DidReadMetadata(
const base::PlatformFileInfo& file_info,
- const FilePath& unused) {
+ const base::FilePath& unused) {
if (callback_->completed())
return;
diff --git a/webkit/plugins/ppapi/file_callbacks.h b/webkit/plugins/ppapi/file_callbacks.h
index c254dab..2e31e2f 100644
--- a/webkit/plugins/ppapi/file_callbacks.h
+++ b/webkit/plugins/ppapi/file_callbacks.h
@@ -46,7 +46,7 @@ class FileCallbacks : public fileapi::FileSystemCallbackDispatcher {
virtual void DidSucceed();
virtual void DidReadMetadata(
const base::PlatformFileInfo& file_info,
- const FilePath& unused);
+ const base::FilePath& unused);
virtual void DidReadDirectory(
const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more);
virtual void DidOpenFileSystem(const std::string&,
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc
index d54356a..e60a6ef 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.cc
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc
@@ -68,7 +68,7 @@ SkBitmap* MockPluginDelegate::GetSadPluginBitmap() {
}
WebKit::WebPlugin* MockPluginDelegate::CreatePluginReplacement(
- const FilePath& file_path) {
+ const base::FilePath& file_path) {
return NULL;
}
@@ -141,7 +141,7 @@ void MockPluginDelegate::NumberOfFindResultsChanged(int identifier,
void MockPluginDelegate::SelectedFindResultChanged(int identifier, int index) {
}
-bool MockPluginDelegate::AsyncOpenFile(const FilePath& path,
+bool MockPluginDelegate::AsyncOpenFile(const base::FilePath& path,
int flags,
const AsyncOpenFileCallback& callback) {
return false;
@@ -222,9 +222,9 @@ void MockPluginDelegate::DidUpdateFile(const GURL& file_path, int64_t delta) {
void MockPluginDelegate::SyncGetFileSystemPlatformPath(
const GURL& url,
- FilePath* platform_path) {
+ base::FilePath* platform_path) {
DCHECK(platform_path);
- *platform_path = FilePath();
+ *platform_path = base::FilePath();
}
scoped_refptr<base::MessageLoopProxy>
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h
index de4c28f..c4c1342 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.h
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.h
@@ -35,7 +35,8 @@ class MockPluginDelegate : public PluginDelegate {
virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
CreateResourceCreationAPI(PluginInstance* instance);
virtual SkBitmap* GetSadPluginBitmap();
- virtual WebKit::WebPlugin* CreatePluginReplacement(const FilePath& file_path);
+ virtual WebKit::WebPlugin* CreatePluginReplacement(
+ const base::FilePath& file_path);
virtual PlatformImage2D* CreateImage2D(int width, int height);
virtual PlatformGraphics2D* GetGraphics2D(PluginInstance* instance,
PP_Resource graphics_2d);
@@ -63,7 +64,7 @@ class MockPluginDelegate : public PluginDelegate {
int total,
bool final_result);
virtual void SelectedFindResultChanged(int identifier, int index);
- virtual bool AsyncOpenFile(const FilePath& path,
+ virtual bool AsyncOpenFile(const base::FilePath& path,
int flags,
const AsyncOpenFileCallback& callback);
virtual bool AsyncOpenFileSystemURL(
@@ -102,7 +103,7 @@ class MockPluginDelegate : public PluginDelegate {
virtual void WillUpdateFile(const GURL& file_path);
virtual void DidUpdateFile(const GURL& file_path, int64_t delta);
virtual void SyncGetFileSystemPlatformPath(const GURL& url,
- FilePath* platform_path);
+ base::FilePath* platform_path);
virtual scoped_refptr<base::MessageLoopProxy>
GetFileThreadMessageLoopProxy();
virtual uint32 TCPSocketCreate();
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h
index 3f6d058..5b7b923 100644
--- a/webkit/plugins/ppapi/plugin_delegate.h
+++ b/webkit/plugins/ppapi/plugin_delegate.h
@@ -392,7 +392,7 @@ class PluginDelegate {
// Creates a replacement plug-in that is shown when the plug-in at |file_path|
// couldn't be loaded.
virtual WebKit::WebPlugin* CreatePluginReplacement(
- const FilePath& file_path) = 0;
+ const base::FilePath& file_path) = 0;
// The caller will own the pointer returned from this.
virtual PlatformImage2D* CreateImage2D(int width, int height) = 0;
@@ -460,7 +460,7 @@ class PluginDelegate {
// Sends an async IPC to open a local file.
typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)>
AsyncOpenFileCallback;
- virtual bool AsyncOpenFile(const FilePath& path,
+ virtual bool AsyncOpenFile(const base::FilePath& path,
int flags,
const AsyncOpenFileCallback& callback) = 0;
@@ -518,7 +518,7 @@ class PluginDelegate {
// Synchronously returns the platform file path for a filesystem URL.
virtual void SyncGetFileSystemPlatformPath(const GURL& url,
- FilePath* platform_path) = 0;
+ base::FilePath* platform_path) = 0;
// Returns a MessageLoopProxy instance associated with the message loop
// of the file thread in this renderer.
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index de17710..d021864 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -400,7 +400,7 @@ PluginModule::EntryPoints::EntryPoints()
// PluginModule ----------------------------------------------------------------
PluginModule::PluginModule(const std::string& name,
- const FilePath& path,
+ const base::FilePath& path,
PluginDelegate::ModuleLifetime* lifetime_delegate,
const ::ppapi::PpapiPermissions& perms)
: lifetime_delegate_(lifetime_delegate),
@@ -476,7 +476,7 @@ bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) {
return false;
}
-bool PluginModule::InitAsLibrary(const FilePath& path) {
+bool PluginModule::InitAsLibrary(const base::FilePath& path) {
base::NativeLibrary library = base::LoadNativeLibrary(path, NULL);
if (!library)
return false;
diff --git a/webkit/plugins/ppapi/plugin_module.h b/webkit/plugins/ppapi/plugin_module.h
index 4d47459..ecf17bb 100644
--- a/webkit/plugins/ppapi/plugin_module.h
+++ b/webkit/plugins/ppapi/plugin_module.h
@@ -26,9 +26,12 @@
#include "webkit/plugins/ppapi/plugin_delegate.h"
#include "webkit/plugins/webkit_plugins_export.h"
-class FilePath;
typedef void* NPIdentifier;
+namespace base {
+class FilePath;
+}
+
namespace ppapi {
class CallbackTracker;
class WebKitForwarding;
@@ -83,7 +86,7 @@ class WEBKIT_PLUGINS_EXPORT PluginModule :
// all plugin modules. In practice it will be a global singleton that
// tracks which modules are alive.
PluginModule(const std::string& name,
- const FilePath& path,
+ const base::FilePath& path,
PluginDelegate::ModuleLifetime* lifetime_delegate,
const ::ppapi::PpapiPermissions& perms);
@@ -104,7 +107,7 @@ class WEBKIT_PLUGINS_EXPORT PluginModule :
// Initializes this module using the given library path as the plugin.
// Returns true on success. False means that the plugin can not be used.
- bool InitAsLibrary(const FilePath& path);
+ bool InitAsLibrary(const base::FilePath& path);
// Initializes this module for the given out of process proxy. This takes
// ownership of the given pointer, even in the failure case.
@@ -144,7 +147,7 @@ class WEBKIT_PLUGINS_EXPORT PluginModule :
PP_Module pp_module() const { return pp_module_; }
const std::string& name() const { return name_; }
- const FilePath& path() const { return path_; }
+ const base::FilePath& path() const { return path_; }
const ::ppapi::PpapiPermissions& permissions() const { return permissions_; }
PluginInstance* CreateInstance(PluginDelegate* delegate,
@@ -241,7 +244,7 @@ class WEBKIT_PLUGINS_EXPORT PluginModule :
// The name and file location of the module.
const std::string name_;
- const FilePath path_;
+ const base::FilePath path_;
::ppapi::PpapiPermissions permissions_;
diff --git a/webkit/plugins/ppapi/ppapi_unittest.cc b/webkit/plugins/ppapi/ppapi_unittest.cc
index 05dbfed..bccebd9 100644
--- a/webkit/plugins/ppapi/ppapi_unittest.cc
+++ b/webkit/plugins/ppapi/ppapi_unittest.cc
@@ -78,7 +78,7 @@ void PpapiUnittest::SetUp() {
delegate_.reset(NewPluginDelegate());
// Initialize the mock module.
- module_ = new PluginModule("Mock plugin", FilePath(), this,
+ module_ = new PluginModule("Mock plugin", base::FilePath(), this,
::ppapi::PpapiPermissions());
PluginModule::EntryPoints entry_points;
entry_points.get_interface = &MockGetInterface;
diff --git a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
index ec1315e..7cd8d5d 100644
--- a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
+++ b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
@@ -33,7 +33,7 @@ namespace ppapi {
namespace {
-std::string FilePathStringToUTF8String(const FilePath::StringType& str) {
+std::string FilePathStringToUTF8String(const base::FilePath::StringType& str) {
#if defined(OS_WIN)
return WideToUTF8(str);
#elif defined(OS_POSIX)
@@ -43,7 +43,7 @@ std::string FilePathStringToUTF8String(const FilePath::StringType& str) {
#endif
}
-FilePath::StringType UTF8StringToFilePathString(const std::string& str) {
+base::FilePath::StringType UTF8StringToFilePathString(const std::string& str) {
#if defined(OS_WIN)
return UTF8ToWide(str);
#elif defined(OS_POSIX)
@@ -110,7 +110,7 @@ void PPB_DirectoryReader_Impl::AddNewEntries(
std::string dir_path = directory_ref_->GetCreateInfo().path;
if (dir_path[dir_path.size() - 1] != '/')
dir_path += '/';
- FilePath::StringType dir_file_path = UTF8StringToFilePathString(dir_path);
+ base::FilePath::StringType dir_file_path = UTF8StringToFilePathString(dir_path);
for (std::vector<base::FileUtilProxy::Entry>::const_iterator it =
entries.begin(); it != entries.end(); it++) {
base::FileUtilProxy::Entry entry;
diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.cc b/webkit/plugins/ppapi/ppb_file_ref_impl.cc
index b74a4c4..ec785e4 100644
--- a/webkit/plugins/ppapi/ppb_file_ref_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_ref_impl.cc
@@ -55,10 +55,10 @@ void TrimTrailingSlash(std::string* path) {
path->erase(path->size() - 1, 1);
}
-std::string GetNameForExternalFilePath(const FilePath& in_path) {
- const FilePath::StringType& path = in_path.value();
- size_t pos = path.rfind(FilePath::kSeparators[0]);
- CHECK(pos != FilePath::StringType::npos);
+std::string GetNameForExternalFilePath(const base::FilePath& in_path) {
+ const base::FilePath::StringType& path = in_path.value();
+ size_t pos = path.rfind(base::FilePath::kSeparators[0]);
+ CHECK(pos != base::FilePath::StringType::npos);
#if defined(OS_WIN)
return WideToUTF8(path.substr(pos + 1));
#elif defined(OS_POSIX)
@@ -88,7 +88,7 @@ PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info,
}
PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info,
- const FilePath& external_file_path)
+ const base::FilePath& external_file_path)
: PPB_FileRef_Shared(::ppapi::OBJECT_IS_IMPL, info),
file_system_(),
external_file_system_path_(external_file_path) {
@@ -132,7 +132,7 @@ PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Resource pp_file_system,
// static
PPB_FileRef_Impl* PPB_FileRef_Impl::CreateExternal(
PP_Instance instance,
- const FilePath& external_file_path,
+ const base::FilePath& external_file_path,
const std::string& display_name) {
PPB_FileRef_CreateInfo info;
info.resource = HostResource::MakeInstanceOnly(instance);
@@ -249,10 +249,10 @@ PP_Var PPB_FileRef_Impl::GetAbsolutePath() {
return external_path_var_->GetPPVar();
}
-FilePath PPB_FileRef_Impl::GetSystemPath() const {
+base::FilePath PPB_FileRef_Impl::GetSystemPath() const {
if (GetFileSystemType() != PP_FILESYSTEMTYPE_EXTERNAL) {
NOTREACHED();
- return FilePath();
+ return base::FilePath();
}
return external_file_system_path_;
}
diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.h b/webkit/plugins/ppapi/ppb_file_ref_impl.h
index d7bb8c5..4d455a7 100644
--- a/webkit/plugins/ppapi/ppb_file_ref_impl.h
+++ b/webkit/plugins/ppapi/ppb_file_ref_impl.h
@@ -27,7 +27,7 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info,
PPB_FileSystem_Impl* file_system);
PPB_FileRef_Impl(const ::ppapi::PPB_FileRef_CreateInfo& info,
- const FilePath& external_file_path);
+ const base::FilePath& external_file_path);
virtual ~PPB_FileRef_Impl();
// The returned object will have a refcount of 0 (just like "new").
@@ -36,7 +36,7 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
// The returned object will have a refcount of 0 (just like "new").
static PPB_FileRef_Impl* CreateExternal(PP_Instance instance,
- const FilePath& external_file_path,
+ const base::FilePath& external_file_path,
const std::string& display_name);
// PPB_FileRef_API implementation (not provided by PPB_FileRef_Shared).
@@ -59,7 +59,7 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
// Returns the system path corresponding to this file. Valid only for
// external filesystems.
- FilePath GetSystemPath() const;
+ base::FilePath GetSystemPath() const;
// Returns the FileSystem API URL corresponding to this file.
GURL GetFileSystemURL() const;
@@ -76,7 +76,7 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
scoped_refptr<PPB_FileSystem_Impl> file_system_;
// Used only for external filesystems.
- FilePath external_file_system_path_;
+ base::FilePath external_file_system_path_;
// Lazily initialized var created from the external path. This is so we can
// return the identical string object every time it is requested.
diff --git a/webkit/plugins/ppapi/quota_file_io_unittest.cc b/webkit/plugins/ppapi/quota_file_io_unittest.cc
index 3e052a2..65df7d7 100644
--- a/webkit/plugins/ppapi/quota_file_io_unittest.cc
+++ b/webkit/plugins/ppapi/quota_file_io_unittest.cc
@@ -88,7 +88,7 @@ class QuotaFileIOTest : public PpapiUnittest {
virtual void SetUp() OVERRIDE {
PpapiUnittest::SetUp();
ASSERT_TRUE(dir_.CreateUniqueTempDir());
- FilePath path;
+ base::FilePath path;
ASSERT_TRUE(file_util::CreateTemporaryFileInDir(dir_.path(), &path));
int file_flags = base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ |
diff --git a/webkit/plugins/ppapi/url_request_info_util.cc b/webkit/plugins/ppapi/url_request_info_util.cc
index 6b1f512..8dcad54 100644
--- a/webkit/plugins/ppapi/url_request_info_util.cc
+++ b/webkit/plugins/ppapi/url_request_info_util.cc
@@ -64,7 +64,7 @@ bool AppendFileRefToBody(
if (!plugin_delegate)
return false;
- FilePath platform_path;
+ base::FilePath platform_path;
switch (file_ref->GetFileSystemType()) {
case PP_FILESYSTEMTYPE_LOCALTEMPORARY:
case PP_FILESYSTEMTYPE_LOCALPERSISTENT:
diff --git a/webkit/plugins/webplugininfo.cc b/webkit/plugins/webplugininfo.cc
index 27c6514..a581647 100644
--- a/webkit/plugins/webplugininfo.cc
+++ b/webkit/plugins/webplugininfo.cc
@@ -51,7 +51,7 @@ WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) {
}
WebPluginInfo::WebPluginInfo(const string16& fake_name,
- const FilePath& fake_path,
+ const base::FilePath& fake_path,
const string16& fake_version,
const string16& fake_desc)
: name(fake_name),
diff --git a/webkit/plugins/webplugininfo.h b/webkit/plugins/webplugininfo.h
index cc09f78..514a046 100644
--- a/webkit/plugins/webplugininfo.h
+++ b/webkit/plugins/webplugininfo.h
@@ -53,7 +53,7 @@ struct WEBKIT_PLUGINS_EXPORT WebPluginInfo {
// Special constructor only used during unit testing:
WebPluginInfo(const string16& fake_name,
- const FilePath& fake_path,
+ const base::FilePath& fake_path,
const string16& fake_version,
const string16& fake_desc);
@@ -61,7 +61,7 @@ struct WEBKIT_PLUGINS_EXPORT WebPluginInfo {
string16 name;
// The path to the plugin file (DLL/bundle/library).
- FilePath path;
+ base::FilePath path;
// The version number of the plugin file (may be OS-specific)
string16 version;
diff --git a/webkit/quota/mock_quota_manager.cc b/webkit/quota/mock_quota_manager.cc
index 4904f453..e37dc59 100644
--- a/webkit/quota/mock_quota_manager.cc
+++ b/webkit/quota/mock_quota_manager.cc
@@ -36,7 +36,7 @@ MockQuotaManager::StorageInfo::~StorageInfo() {}
MockQuotaManager::MockQuotaManager(
bool is_incognito,
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
base::SingleThreadTaskRunner* io_thread,
base::SequencedTaskRunner* db_thread,
SpecialStoragePolicy* special_storage_policy)
diff --git a/webkit/quota/mock_quota_manager.h b/webkit/quota/mock_quota_manager.h
index 013fef9..e195e61 100644
--- a/webkit/quota/mock_quota_manager.h
+++ b/webkit/quota/mock_quota_manager.h
@@ -31,7 +31,7 @@ namespace quota {
class MockQuotaManager : public QuotaManager {
public:
MockQuotaManager(bool is_incognito,
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
base::SingleThreadTaskRunner* io_thread,
base::SequencedTaskRunner* db_thread,
SpecialStoragePolicy* special_storage_policy);
diff --git a/webkit/quota/quota_database.cc b/webkit/quota/quota_database.cc
index aaf6245..aeac443 100644
--- a/webkit/quota/quota_database.cc
+++ b/webkit/quota/quota_database.cc
@@ -121,7 +121,7 @@ QuotaDatabase::OriginInfoTableEntry::OriginInfoTableEntry(
}
// QuotaDatabase ------------------------------------------------------------
-QuotaDatabase::QuotaDatabase(const FilePath& path)
+QuotaDatabase::QuotaDatabase(const base::FilePath& path)
: db_file_path_(path),
is_recreating_(false),
is_disabled_(false) {
diff --git a/webkit/quota/quota_database.h b/webkit/quota/quota_database.h
index 2450559..a5c8a27 100644
--- a/webkit/quota/quota_database.h
+++ b/webkit/quota/quota_database.h
@@ -38,7 +38,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE QuotaDatabase {
static const char kTemporaryQuotaOverrideKey[];
// If 'path' is empty, an in memory database will be used.
- explicit QuotaDatabase(const FilePath& path);
+ explicit QuotaDatabase(const base::FilePath& path);
~QuotaDatabase();
void CloseConnection();
@@ -163,7 +163,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE QuotaDatabase {
bool DumpQuotaTable(QuotaTableCallback* callback);
bool DumpOriginInfoTable(OriginInfoTableCallback* callback);
- FilePath db_file_path_;
+ base::FilePath db_file_path_;
scoped_ptr<sql::Connection> db_;
scoped_ptr<sql::MetaTable> meta_table_;
diff --git a/webkit/quota/quota_database_unittest.cc b/webkit/quota/quota_database_unittest.cc
index 40e671c..39abfac 100644
--- a/webkit/quota/quota_database_unittest.cc
+++ b/webkit/quota/quota_database_unittest.cc
@@ -46,7 +46,7 @@ class QuotaDatabaseTest : public testing::Test {
typedef QuotaDatabase::OriginInfoTableCallback
OriginInfoTableCallback;
- void LazyOpen(const FilePath& kDbFile) {
+ void LazyOpen(const base::FilePath& kDbFile) {
QuotaDatabase db(kDbFile);
EXPECT_FALSE(db.LazyOpen(false));
ASSERT_TRUE(db.LazyOpen(true));
@@ -54,7 +54,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_TRUE(kDbFile.empty() || file_util::PathExists(kDbFile));
}
- void UpgradeSchemaV2toV3(const FilePath& kDbFile) {
+ void UpgradeSchemaV2toV3(const base::FilePath& kDbFile) {
const QuotaTableEntry entries[] = {
QuotaTableEntry("a", kStorageTypeTemporary, 1),
QuotaTableEntry("b", kStorageTypeTemporary, 2),
@@ -76,7 +76,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_TRUE(verifier.table.empty());
}
- void HostQuota(const FilePath& kDbFile) {
+ void HostQuota(const base::FilePath& kDbFile) {
QuotaDatabase db(kDbFile);
ASSERT_TRUE(db.LazyOpen(true));
@@ -106,7 +106,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_FALSE(db.GetHostQuota(kHost, kStorageTypeTemporary, &quota));
}
- void GlobalQuota(const FilePath& kDbFile) {
+ void GlobalQuota(const base::FilePath& kDbFile) {
QuotaDatabase db(kDbFile);
ASSERT_TRUE(db.LazyOpen(true));
@@ -136,7 +136,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_EQ(kValue2, value);
}
- void OriginLastAccessTimeLRU(const FilePath& kDbFile) {
+ void OriginLastAccessTimeLRU(const base::FilePath& kDbFile) {
QuotaDatabase db(kDbFile);
ASSERT_TRUE(db.LazyOpen(true));
@@ -211,7 +211,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_TRUE(origin.is_empty());
}
- void OriginLastModifiedSince(const FilePath& kDbFile) {
+ void OriginLastModifiedSince(const base::FilePath& kDbFile) {
QuotaDatabase db(kDbFile);
ASSERT_TRUE(db.LazyOpen(true));
@@ -288,7 +288,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_EQ(0U, origins.count(kOrigin3));
}
- void RegisterInitialOriginInfo(const FilePath& kDbFile) {
+ void RegisterInitialOriginInfo(const base::FilePath& kDbFile) {
QuotaDatabase db(kDbFile);
const GURL kOrigins[] = {
@@ -337,7 +337,7 @@ class QuotaDatabaseTest : public testing::Test {
}
};
- void DumpQuotaTable(const FilePath& kDbFile) {
+ void DumpQuotaTable(const base::FilePath& kDbFile) {
QuotaTableEntry kTableEntries[] = {
QuotaTableEntry("http://go/", kStorageTypeTemporary, 1),
QuotaTableEntry("http://oo/", kStorageTypeTemporary, 2),
@@ -360,7 +360,7 @@ class QuotaDatabaseTest : public testing::Test {
EXPECT_TRUE(verifier.table.empty());
}
- void DumpOriginInfoTable(const FilePath& kDbFile) {
+ void DumpOriginInfoTable(const base::FilePath& kDbFile) {
base::Time now(base::Time::Now());
typedef QuotaDatabase::OriginInfoTableEntry Entry;
Entry kTableEntries[] = {
@@ -426,7 +426,7 @@ class QuotaDatabaseTest : public testing::Test {
}
}
- bool OpenDatabase(sql::Connection* db, const FilePath& kDbFile) {
+ bool OpenDatabase(sql::Connection* db, const base::FilePath& kDbFile) {
if (kDbFile.empty()) {
return db->OpenInMemory();
}
@@ -440,7 +440,7 @@ class QuotaDatabaseTest : public testing::Test {
// Create V2 database and populate some data.
void CreateV2Database(
- const FilePath& kDbFile,
+ const base::FilePath& kDbFile,
const QuotaTableEntry* entries,
size_t entries_size) {
scoped_ptr<sql::Connection> db(new sql::Connection);
@@ -495,55 +495,55 @@ class QuotaDatabaseTest : public testing::Test {
TEST_F(QuotaDatabaseTest, LazyOpen) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
LazyOpen(kDbFile);
- LazyOpen(FilePath());
+ LazyOpen(base::FilePath());
}
TEST_F(QuotaDatabaseTest, UpgradeSchema) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
UpgradeSchemaV2toV3(kDbFile);
}
TEST_F(QuotaDatabaseTest, HostQuota) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
HostQuota(kDbFile);
- HostQuota(FilePath());
+ HostQuota(base::FilePath());
}
TEST_F(QuotaDatabaseTest, GlobalQuota) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
GlobalQuota(kDbFile);
- GlobalQuota(FilePath());
+ GlobalQuota(base::FilePath());
}
TEST_F(QuotaDatabaseTest, OriginLastAccessTimeLRU) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
OriginLastAccessTimeLRU(kDbFile);
- OriginLastAccessTimeLRU(FilePath());
+ OriginLastAccessTimeLRU(base::FilePath());
}
TEST_F(QuotaDatabaseTest, OriginLastModifiedSince) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
OriginLastModifiedSince(kDbFile);
- OriginLastModifiedSince(FilePath());
+ OriginLastModifiedSince(base::FilePath());
}
TEST_F(QuotaDatabaseTest, BootstrapFlag) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
QuotaDatabase db(kDbFile);
EXPECT_FALSE(db.IsOriginDatabaseBootstrapped());
@@ -556,24 +556,24 @@ TEST_F(QuotaDatabaseTest, BootstrapFlag) {
TEST_F(QuotaDatabaseTest, RegisterInitialOriginInfo) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
RegisterInitialOriginInfo(kDbFile);
- RegisterInitialOriginInfo(FilePath());
+ RegisterInitialOriginInfo(base::FilePath());
}
TEST_F(QuotaDatabaseTest, DumpQuotaTable) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
DumpQuotaTable(kDbFile);
- DumpQuotaTable(FilePath());
+ DumpQuotaTable(base::FilePath());
}
TEST_F(QuotaDatabaseTest, DumpOriginInfoTable) {
base::ScopedTempDir data_dir;
ASSERT_TRUE(data_dir.CreateUniqueTempDir());
- const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
+ const base::FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db");
DumpOriginInfoTable(kDbFile);
- DumpOriginInfoTable(FilePath());
+ DumpOriginInfoTable(base::FilePath());
}
} // namespace quota
diff --git a/webkit/quota/quota_manager.cc b/webkit/quota/quota_manager.cc
index 0d875f0..1801372 100644
--- a/webkit/quota/quota_manager.cc
+++ b/webkit/quota/quota_manager.cc
@@ -151,7 +151,7 @@ bool UpdateModifiedTimeOnDBThread(const GURL& origin,
return database->SetOriginLastModifiedTime(origin, type, modified_time);
}
-int64 CallSystemGetAmountOfFreeDiskSpace(const FilePath& profile_path) {
+int64 CallSystemGetAmountOfFreeDiskSpace(const base::FilePath& profile_path) {
// Ensure the profile path exists.
if(!file_util::CreateDirectory(profile_path)) {
LOG(WARNING) << "Create directory failed for path" << profile_path.value();
@@ -876,7 +876,7 @@ class QuotaManager::DumpOriginInfoTableHelper {
// QuotaManager ---------------------------------------------------------------
QuotaManager::QuotaManager(bool is_incognito,
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
base::SingleThreadTaskRunner* io_thread,
base::SequencedTaskRunner* db_thread,
SpecialStoragePolicy* special_storage_policy)
@@ -1183,7 +1183,7 @@ void QuotaManager::LazyInitialize() {
}
// Use an empty path to open an in-memory only databse for incognito.
- database_.reset(new QuotaDatabase(is_incognito_ ? FilePath() :
+ database_.reset(new QuotaDatabase(is_incognito_ ? base::FilePath() :
profile_path_.AppendASCII(kDatabaseName)));
temporary_usage_tracker_.reset(
diff --git a/webkit/quota/quota_manager.h b/webkit/quota/quota_manager.h
index 62f21d2..b8d9e18 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -26,9 +26,8 @@
#include "webkit/quota/special_storage_policy.h"
#include "webkit/storage/webkit_storage_export.h"
-class FilePath;
-
namespace base {
+class FilePath;
class SequencedTaskRunner;
class SingleThreadTaskRunner;
}
@@ -106,7 +105,7 @@ class WEBKIT_STORAGE_EXPORT QuotaManager
static const int64 kNoLimit;
QuotaManager(bool is_incognito,
- const FilePath& profile_path,
+ const base::FilePath& profile_path,
base::SingleThreadTaskRunner* io_thread,
base::SequencedTaskRunner* db_thread,
SpecialStoragePolicy* special_storage_policy);
@@ -246,7 +245,7 @@ class WEBKIT_STORAGE_EXPORT QuotaManager
// Function pointer type used to store the function which returns the
// available disk space for the disk containing the given FilePath.
- typedef int64 (*GetAvailableDiskSpaceFn)(const FilePath&);
+ typedef int64 (*GetAvailableDiskSpaceFn)(const base::FilePath&);
typedef base::Callback<void(const QuotaTableEntries&)>
DumpQuotaTableCallback;
@@ -365,7 +364,7 @@ class WEBKIT_STORAGE_EXPORT QuotaManager
const base::Callback<void(bool)>& reply);
const bool is_incognito_;
- const FilePath profile_path_;
+ const base::FilePath profile_path_;
scoped_refptr<QuotaManagerProxy> proxy_;
bool db_disabled_;
diff --git a/webkit/quota/quota_manager_unittest.cc b/webkit/quota/quota_manager_unittest.cc
index 49476d0..0f800a2 100644
--- a/webkit/quota/quota_manager_unittest.cc
+++ b/webkit/quota/quota_manager_unittest.cc
@@ -35,7 +35,7 @@ const StorageType kSync = kStorageTypeSyncable;
const int kAllClients = QuotaClient::kAllClientsMask;
// Returns a deterministic value for the amount of available disk space.
-int64 GetAvailableDiskSpaceForTest(const FilePath&) {
+int64 GetAvailableDiskSpaceForTest(const base::FilePath&) {
return 13377331;
}
@@ -393,7 +393,7 @@ class QuotaManagerTest : public testing::Test {
const OriginInfoTableEntries& origin_info_entries() const {
return origin_info_entries_;
}
- FilePath profile_path() const { return data_dir_.path(); }
+ base::FilePath profile_path() const { return data_dir_.path(); }
int status_callback_count() const { return status_callback_count_; }
void reset_status_callback_count() { status_callback_count_ = 0; }
diff --git a/webkit/support/platform_support_android.cc b/webkit/support/platform_support_android.cc
index f6bf077..30effc7 100644
--- a/webkit/support/platform_support_android.cc
+++ b/webkit/support/platform_support_android.cc
@@ -36,7 +36,7 @@ void BeforeInitialize(bool unit_test_mode) {
base::InitAndroidTestPaths();
// Place cache under kDumpRenderTreeDir to allow the NRWT script to clear it.
- FilePath path(kDumpRenderTreeDir);
+ base::FilePath path(kDumpRenderTreeDir);
path = path.Append("cache");
PathService::Override(base::DIR_CACHE, path);
@@ -57,7 +57,7 @@ void BeforeInitialize(bool unit_test_mode) {
}
void AfterInitialize(bool unit_test_mode) {
- FilePath data_path(kDumpRenderTreeDir);
+ base::FilePath data_path(kDumpRenderTreeDir);
data_path = data_path.Append("DumpRenderTree.pak");
ResourceBundle::InitSharedInstanceWithPakPath(data_path);
@@ -96,13 +96,13 @@ string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) {
base::StringPiece TestWebKitPlatformSupport::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) {
- FilePath resources_path(kDumpRenderTreeDir);
+ base::FilePath resources_path(kDumpRenderTreeDir);
resources_path = resources_path.Append("DumpRenderTree_resources");
switch (resource_id) {
case IDR_BROKENIMAGE: {
CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ());
if (broken_image_data.empty()) {
- FilePath path = resources_path.Append("missingImage.gif");
+ base::FilePath path = resources_path.Append("missingImage.gif");
bool success = file_util::ReadFileToString(path, &broken_image_data);
if (!success)
LOG(FATAL) << "Failed reading: " << path.value();
@@ -112,7 +112,7 @@ base::StringPiece TestWebKitPlatformSupport::GetDataResource(
case IDR_TEXTAREA_RESIZER: {
CR_DEFINE_STATIC_LOCAL(std::string, resize_corner_data, ());
if (resize_corner_data.empty()) {
- FilePath path = resources_path.Append("textAreaResizeCorner.png");
+ base::FilePath path = resources_path.Append("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success)
LOG(FATAL) << "Failed reading: " << path.value();
diff --git a/webkit/support/platform_support_linux.cc b/webkit/support/platform_support_linux.cc
index fa795f9..a26c5f4 100644
--- a/webkit/support/platform_support_linux.cc
+++ b/webkit/support/platform_support_linux.cc
@@ -23,7 +23,7 @@ void BeforeInitialize(bool unit_test_mode) {
}
void AfterInitialize(bool unit_test_mode) {
- FilePath data_path;
+ base::FilePath data_path;
PathService::Get(base::DIR_EXE, &data_path);
data_path = data_path.Append("DumpRenderTree.pak");
ResourceBundle::InitSharedInstanceWithPakPath(data_path);
@@ -45,14 +45,14 @@ string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) {
base::StringPiece TestWebKitPlatformSupport::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) {
- FilePath resources_path;
+ base::FilePath resources_path;
PathService::Get(base::DIR_EXE, &resources_path);
resources_path = resources_path.Append("DumpRenderTree_resources");
switch (resource_id) {
case IDR_BROKENIMAGE: {
CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ());
if (broken_image_data.empty()) {
- FilePath path = resources_path.Append("missingImage.gif");
+ base::FilePath path = resources_path.Append("missingImage.gif");
bool success = file_util::ReadFileToString(path, &broken_image_data);
if (!success)
LOG(FATAL) << "Failed reading: " << path.value();
@@ -62,7 +62,7 @@ base::StringPiece TestWebKitPlatformSupport::GetDataResource(
case IDR_TEXTAREA_RESIZER: {
CR_DEFINE_STATIC_LOCAL(std::string, resize_corner_data, ());
if (resize_corner_data.empty()) {
- FilePath path = resources_path.Append("textAreaResizeCorner.png");
+ base::FilePath path = resources_path.Append("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success)
LOG(FATAL) << "Failed reading: " << path.value();
diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm
index 9a758ec..2681cb4 100644
--- a/webkit/support/platform_support_mac.mm
+++ b/webkit/support/platform_support_mac.mm
@@ -101,7 +101,7 @@ static void SwizzleNSPasteboard() {
void AfterInitialize(bool unit_test_mode) {
// Load a data pack.
g_resource_data_pack = new ui::DataPack(ui::SCALE_FACTOR_100P);
- FilePath resources_pak_path;
+ base::FilePath resources_pak_path;
if (unit_test_mode) {
PathService::Get(base::DIR_EXE, &resources_pak_path);
resources_pak_path = resources_pak_path.Append("DumpRenderTree.app")
@@ -112,7 +112,7 @@ void AfterInitialize(bool unit_test_mode) {
NSString* resource_path =
[base::mac::FrameworkBundle() pathForResource:@"DumpRenderTree"
ofType:@"pak"];
- resources_pak_path = FilePath([resource_path fileSystemRepresentation]);
+ resources_pak_path = base::FilePath([resource_path fileSystemRepresentation]);
}
if (!g_resource_data_pack->LoadFromPath(resources_pak_path)) {
LOG(FATAL) << "failed to load DumpRenderTree.pak";
@@ -156,7 +156,7 @@ void AfterInitialize(bool unit_test_mode) {
// Add <app bundle's parent dir>/plugins to the plugin path so we can load
// test plugins.
- FilePath plugins_dir;
+ base::FilePath plugins_dir;
PathService::Get(base::DIR_EXE, &plugins_dir);
plugins_dir = plugins_dir.AppendASCII("../../../plugins");
webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(plugins_dir);
@@ -202,14 +202,14 @@ string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) {
}
// Helper method for getting the path to the test shell resources directory.
-static FilePath GetResourcesFilePath() {
- FilePath path;
+static base::FilePath GetResourcesFilePath() {
+ base::FilePath path;
// We assume the application is bundled.
if (!base::mac::AmIBundled()) {
LOG(FATAL) << "Failed to locate resources. The applicaiton is not bundled.";
}
PathService::Get(base::DIR_EXE, &path);
- path = path.Append(FilePath::kParentDirectory);
+ path = path.Append(base::FilePath::kParentDirectory);
return path.AppendASCII("Resources");
}
@@ -221,7 +221,7 @@ base::StringPiece TestWebKitPlatformSupport::GetDataResource(
// Use webkit's broken image icon (16x16)
CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ());
if (broken_image_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
// In order to match WebKit's colors for the missing image, we have to
// use a PNG. The GIF doesn't have the color range needed to correctly
// match the TIFF they use in Safari.
@@ -238,7 +238,7 @@ base::StringPiece TestWebKitPlatformSupport::GetDataResource(
// Use webkit's text area resizer image.
CR_DEFINE_STATIC_LOCAL(std::string, resize_corner_data, ());
if (resize_corner_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("textAreaResizeCorner.png");
file_util::AbsolutePath(&path);
bool success = file_util::ReadFileToString(path, &resize_corner_data);
diff --git a/webkit/support/platform_support_win.cc b/webkit/support/platform_support_win.cc
index 249a533..f1c61b9 100644
--- a/webkit/support/platform_support_win.cc
+++ b/webkit/support/platform_support_win.cc
@@ -20,8 +20,8 @@
namespace {
-FilePath GetResourceFilePath(const char* ascii_name) {
- FilePath path;
+base::FilePath GetResourceFilePath(const char* ascii_name) {
+ base::FilePath path;
PathService::Get(base::DIR_EXE, &path);
path = path.AppendASCII("DumpRenderTree_resources");
return path.AppendASCII(ascii_name);
@@ -80,7 +80,7 @@ base::StringPiece TestWebKitPlatformSupport::GetDataResource(
// Use webkit's broken image icon (16x16)
static std::string broken_image_data;
if (broken_image_data.empty()) {
- FilePath path = GetResourceFilePath("missingImage.gif");
+ base::FilePath path = GetResourceFilePath("missingImage.gif");
bool success = file_util::ReadFileToString(path, &broken_image_data);
if (!success) {
LOG(FATAL) << "Failed reading: " << path.value();
@@ -92,7 +92,7 @@ base::StringPiece TestWebKitPlatformSupport::GetDataResource(
// Use webkit's text area resizer image.
static std::string resize_corner_data;
if (resize_corner_data.empty()) {
- FilePath path = GetResourceFilePath("textAreaResizeCorner.png");
+ base::FilePath path = GetResourceFilePath("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success) {
LOG(FATAL) << "Failed reading: " << path.value();
diff --git a/webkit/support/simple_database_system.cc b/webkit/support/simple_database_system.cc
index c8b5a02..88e088c 100644
--- a/webkit/support/simple_database_system.cc
+++ b/webkit/support/simple_database_system.cc
@@ -221,7 +221,7 @@ void SimpleDatabaseSystem::VfsOpenFile(
const string16& vfs_file_name, int desired_flags,
base::PlatformFile* file_handle, base::WaitableEvent* done_event ) {
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
- FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
+ base::FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
if (file_name.empty()) {
VfsBackend::OpenTempFileInDirectory(
db_tracker_->DatabaseDirectory(), desired_flags, file_handle);
@@ -241,7 +241,7 @@ void SimpleDatabaseSystem::VfsDeleteFile(
const int kNumDeleteRetries = 3;
int num_retries = 0;
*result = SQLITE_OK;
- FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
+ base::FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name);
do {
*result = VfsBackend::DeleteFile(file_name, sync_dir);
} while ((++num_retries < kNumDeleteRetries) &&
@@ -287,11 +287,11 @@ void SimpleDatabaseSystem::VfsGetSpaceAvailable(
done_event->Signal();
}
-FilePath SimpleDatabaseSystem::GetFullFilePathForVfsFile(
+base::FilePath SimpleDatabaseSystem::GetFullFilePathForVfsFile(
const string16& vfs_file_name) {
DCHECK(db_thread_proxy_->BelongsToCurrentThread());
if (vfs_file_name.empty()) // temp file, used for vacuuming
- return FilePath();
+ return base::FilePath();
return DatabaseUtil::GetFullFilePathForVfsFile(
db_tracker_.get(), vfs_file_name);
}
diff --git a/webkit/support/simple_database_system.h b/webkit/support/simple_database_system.h
index bd92fc2..3fef6f8f 100644
--- a/webkit/support/simple_database_system.h
+++ b/webkit/support/simple_database_system.h
@@ -80,7 +80,7 @@ class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer,
void VfsGetSpaceAvailable(const string16& origin_identifier,
int64* result, base::WaitableEvent* done_event);
- FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name);
+ base::FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name);
void ResetTracker();
void ThreadCleanup(base::WaitableEvent* done_event);
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index a6cf5a9..750b32b 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -92,7 +92,7 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode,
// Load libraries for media and enable the media player.
bool enable_media = false;
- FilePath module_path;
+ base::FilePath module_path;
if (PathService::Get(base::DIR_MODULE, &module_path)) {
#if defined(OS_MACOSX)
if (base::mac::AmIBundled())
@@ -141,7 +141,7 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode,
// Initializing with a default context, which means no on-disk cookie DB,
// and no support for directory listings.
- SimpleResourceLoaderBridge::Init(FilePath(), cache_mode, true);
+ SimpleResourceLoaderBridge::Init(base::FilePath(), cache_mode, true);
// Test shell always exposes the GC.
webkit_glue::SetJavaScriptFlags(" --expose-gc");
@@ -483,7 +483,7 @@ void TestWebKitPlatformSupport::GetPlugins(
webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
// Don't load the forked npapi_layout_test_plugin in DRT, we only want to
// use the upstream version TestNetscapePlugIn.
- const FilePath::StringType kPluginBlackList[] = {
+ const base::FilePath::StringType kPluginBlackList[] = {
FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"),
FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"),
FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"),
@@ -491,7 +491,7 @@ void TestWebKitPlatformSupport::GetPlugins(
for (int i = plugins->size() - 1; i >= 0; --i) {
webkit::WebPluginInfo plugin_info = plugins->at(i);
for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) {
- if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) {
+ if (plugin_info.path.BaseName() == base::FilePath(kPluginBlackList[j])) {
plugins->erase(plugins->begin() + i);
}
}
@@ -546,7 +546,7 @@ size_t TestWebKitPlatformSupport::computeLastHyphenLocation(
if (!hyphen_dictionary_) {
// Initialize the hyphen library with a sample dictionary. To avoid test
// flakiness, this code synchronously loads the dictionary.
- FilePath path = webkit_support::GetChromiumRootDirFilePath();
+ base::FilePath path = webkit_support::GetChromiumRootDirFilePath();
path = path.Append(FILE_PATH_LITERAL("third_party/hyphen/hyph_en_US.dic"));
std::string dictionary;
if (!file_util::ReadFileToString(path, &dictionary))
diff --git a/webkit/support/test_webkit_platform_support.h b/webkit/support/test_webkit_platform_support.h
index 6e2dc6e..ec43ce5 100644
--- a/webkit/support/test_webkit_platform_support.h
+++ b/webkit/support/test_webkit_platform_support.h
@@ -90,7 +90,7 @@ class TestWebKitPlatformSupport :
return &url_loader_factory_;
}
- const FilePath& file_system_root() const {
+ const base::FilePath& file_system_root() const {
return file_system_root_.path();
}
diff --git a/webkit/support/test_webplugin_page_delegate.cc b/webkit/support/test_webplugin_page_delegate.cc
index 36ac1d8..99686f1 100644
--- a/webkit/support/test_webplugin_page_delegate.cc
+++ b/webkit/support/test_webplugin_page_delegate.cc
@@ -11,13 +11,13 @@ namespace webkit_support {
webkit::npapi::WebPluginDelegate*
TestWebPluginPageDelegate::CreatePluginDelegate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const std::string& mime_type) {
return webkit::npapi::WebPluginDelegateImpl::Create(file_path, mime_type);
}
WebKit::WebPlugin* TestWebPluginPageDelegate::CreatePluginReplacement(
- const FilePath& file_path) {
+ const base::FilePath& file_path) {
return NULL;
}
diff --git a/webkit/support/test_webplugin_page_delegate.h b/webkit/support/test_webplugin_page_delegate.h
index 3949af7..b861a05 100644
--- a/webkit/support/test_webplugin_page_delegate.h
+++ b/webkit/support/test_webplugin_page_delegate.h
@@ -18,10 +18,10 @@ class TestWebPluginPageDelegate : public webkit::npapi::WebPluginPageDelegate {
virtual ~TestWebPluginPageDelegate() {}
virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate(
- const FilePath& file_path,
+ const base::FilePath& file_path,
const std::string& mime_type) OVERRIDE;
virtual WebKit::WebPlugin* CreatePluginReplacement(
- const FilePath& file_path) OVERRIDE;
+ const base::FilePath& file_path) OVERRIDE;
virtual void CreatedPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE {}
virtual void WillDestroyPluginWindow(
gfx::PluginWindowHandle handle) OVERRIDE {}
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 9e376272..66b9831 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -123,7 +123,7 @@ void InitLogging() {
// On Android we expect the log to appear in logcat.
base::InitAndroidTestLogging();
#else
- FilePath log_filename;
+ base::FilePath log_filename;
PathService::Get(base::DIR_EXE, &log_filename);
log_filename = log_filename.AppendASCII("DumpRenderTree.log");
logging::InitLogging(
@@ -215,11 +215,11 @@ class TestEnvironment {
// in SetCurrentDirectoryForFileURL() and GetAbsoluteWebStringFromUTF8Path(),
// as the directory might not exist on the device because we are using
// file-over-http bridge.
- void set_mock_current_directory(const FilePath& directory) {
+ void set_mock_current_directory(const base::FilePath& directory) {
mock_current_directory_ = directory;
}
- FilePath mock_current_directory() const {
+ base::FilePath mock_current_directory() const {
return mock_current_directory_;
}
@@ -240,7 +240,7 @@ class TestEnvironment {
scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_;
#if defined(OS_ANDROID)
- FilePath mock_current_directory_;
+ base::FilePath mock_current_directory_;
scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_;
scoped_ptr<webkit_media::MediaPlayerBridgeManagerImpl> media_bridge_manager_;
#endif
@@ -253,7 +253,7 @@ class WebPluginImplWithPageDelegate
public:
WebPluginImplWithPageDelegate(WebFrame* frame,
const WebPluginParams& params,
- const FilePath& path)
+ const base::FilePath& path)
: webkit_support::TestWebPluginPageDelegate(),
webkit::npapi::WebPluginImpl(frame, params, path, AsWeakPtr()) {}
virtual ~WebPluginImplWithPageDelegate() {}
@@ -261,8 +261,8 @@ class WebPluginImplWithPageDelegate
DISALLOW_COPY_AND_ASSIGN(WebPluginImplWithPageDelegate);
};
-FilePath GetWebKitRootDirFilePath() {
- FilePath basePath;
+base::FilePath GetWebKitRootDirFilePath() {
+ base::FilePath basePath;
PathService::Get(base::DIR_SOURCE_ROOT, &basePath);
if (file_util::PathExists(
basePath.Append(FILE_PATH_LITERAL("third_party/WebKit")))) {
@@ -353,8 +353,8 @@ void SetUpTestEnvironmentImpl(bool unit_test_mode,
namespace webkit_support {
-FilePath GetChromiumRootDirFilePath() {
- FilePath basePath;
+base::FilePath GetChromiumRootDirFilePath() {
+ base::FilePath basePath;
PathService::Get(base::DIR_SOURCE_ROOT, &basePath);
if (file_util::PathExists(
basePath.Append(FILE_PATH_LITERAL("third_party/WebKit")))) {
@@ -480,7 +480,7 @@ WebKit::WebStorageNamespace* CreateSessionStorageNamespace(unsigned quota) {
}
WebKit::WebString GetWebKitRootDir() {
- FilePath path = GetWebKitRootDirFilePath();
+ base::FilePath path = GetWebKitRootDirFilePath();
std::string path_ascii = path.MaybeAsASCII();
CHECK(!path_ascii.empty());
return WebKit::WebString::fromUTF8(path_ascii.c_str());
@@ -619,11 +619,11 @@ void PostDelayedTask(TaskAdaptor* task, int64 delay_ms) {
WebString GetAbsoluteWebStringFromUTF8Path(const std::string& utf8_path) {
#if defined(OS_WIN)
- FilePath path(UTF8ToWide(utf8_path));
+ base::FilePath path(UTF8ToWide(utf8_path));
file_util::AbsolutePath(&path);
return WebString(path.value());
#else
- FilePath path(base::SysWideToNativeMB(base::SysUTF8ToWide(utf8_path)));
+ base::FilePath path(base::SysWideToNativeMB(base::SysUTF8ToWide(utf8_path)));
#if defined(OS_ANDROID)
if (WebKit::layoutTestMode()) {
// See comment of TestEnvironment::set_mock_current_directory().
@@ -655,9 +655,9 @@ WebURL CreateURLForPathOrURL(const std::string& path_or_url_in_nativemb) {
if (url.is_valid() && url.has_scheme())
return WebURL(url);
#if defined(OS_WIN)
- FilePath path(wide_path_or_url);
+ base::FilePath path(wide_path_or_url);
#else
- FilePath path(path_or_url_in_nativemb);
+ base::FilePath path(path_or_url_in_nativemb);
#endif
file_util::AbsolutePath(&path);
return net::FilePathToFileURL(path);
@@ -670,7 +670,7 @@ WebURL RewriteLayoutTestsURL(const std::string& utf8_url) {
if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen))
return WebURL(GURL(utf8_url));
- FilePath replacePath =
+ base::FilePath replacePath =
GetWebKitRootDirFilePath().Append(FILE_PATH_LITERAL("LayoutTests/"));
// On Android, the file is actually accessed through file-over-http. Disable
@@ -692,14 +692,14 @@ WebURL RewriteLayoutTestsURL(const std::string& utf8_url) {
}
bool SetCurrentDirectoryForFileURL(const WebKit::WebURL& fileUrl) {
- FilePath local_path;
+ base::FilePath local_path;
if (!net::FileURLToFilePath(fileUrl, &local_path))
return false;
#if defined(OS_ANDROID)
if (WebKit::layoutTestMode()) {
// See comment of TestEnvironment::set_mock_current_directory().
DCHECK(test_environment);
- FilePath directory = local_path.DirName();
+ base::FilePath directory = local_path.DirName();
test_environment->set_mock_current_directory(directory);
// Still try to actually change the directory, but ignore any error.
// For a few tests that need to access resources directly as files
@@ -712,7 +712,7 @@ bool SetCurrentDirectoryForFileURL(const WebKit::WebURL& fileUrl) {
}
WebURL LocalFileToDataURL(const WebURL& fileUrl) {
- FilePath local_path;
+ base::FilePath local_path;
if (!net::FileURLToFilePath(fileUrl, &local_path))
return WebURL();
@@ -834,7 +834,7 @@ WebKit::WebThemeEngine* GetThemeEngine() {
// DevTools frontend path for inspector LayoutTests.
WebURL GetDevToolsPathAsURL() {
- FilePath dirExe;
+ base::FilePath dirExe;
if (!PathService::Get(base::DIR_EXE, &dirExe)) {
DCHECK(false);
return WebURL();
@@ -842,7 +842,7 @@ WebURL GetDevToolsPathAsURL() {
#if defined(OS_MACOSX)
dirExe = dirExe.AppendASCII("../../..");
#endif
- FilePath devToolsPath = dirExe.AppendASCII(
+ base::FilePath devToolsPath = dirExe.AppendASCII(
"resources/inspector/devtools.html");
return net::FilePathToFileURL(devToolsPath);
}
@@ -866,7 +866,7 @@ WebKit::WebString RegisterIsolatedFileSystem(
const WebKit::WebVector<WebKit::WebString>& filenames) {
fileapi::IsolatedContext::FileInfoSet files;
for (size_t i = 0; i < filenames.size(); ++i) {
- FilePath path = webkit_base::WebStringToFilePath(filenames[i]);
+ base::FilePath path = webkit_base::WebStringToFilePath(filenames[i]);
files.AddPath(path, NULL);
}
std::string filesystemId =
diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h
index 3120d0b..5ff2558 100644
--- a/webkit/support/webkit_support.h
+++ b/webkit/support/webkit_support.h
@@ -17,7 +17,9 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h"
#include "ui/base/keycodes/keyboard_codes.h"
+namespace base {
class FilePath;
+}
namespace WebKit {
class WebApplicationCacheHost;
@@ -56,7 +58,7 @@ namespace webkit_support {
// webkit-in-chromium build, this is the root directory of the checkout. In a
// standalone webkit build, it is Source/WebKit/chromium relative from the
// checkout's root directory.
-FilePath GetChromiumRootDirFilePath();
+base::FilePath GetChromiumRootDirFilePath();
// Initializes or terminates a test environment.
// |unit_test_mode| should be set to true when running in a TestSuite, in which
diff --git a/webkit/support/weburl_loader_mock_factory.cc b/webkit/support/weburl_loader_mock_factory.cc
index 43b15e4..11da208 100644
--- a/webkit/support/weburl_loader_mock_factory.cc
+++ b/webkit/support/weburl_loader_mock_factory.cc
@@ -25,7 +25,7 @@ using WebKit::WebURLResponse;
struct WebURLLoaderMockFactory::ResponseInfo {
WebKit::WebURLResponse response;
- FilePath file_path;
+ base::FilePath file_path;
};
WebURLLoaderMockFactory::WebURLLoaderMockFactory() {}
@@ -41,10 +41,10 @@ void WebURLLoaderMockFactory::RegisterURL(const WebURL& url,
#if defined(OS_POSIX)
// TODO(jcivelli): On Linux, UTF8 might not be correct.
response_info.file_path =
- FilePath(static_cast<std::string>(file_path.utf8()));
+ base::FilePath(static_cast<std::string>(file_path.utf8()));
#elif defined(OS_WIN)
response_info.file_path =
- FilePath(std::wstring(file_path.data(), file_path.length()));
+ base::FilePath(std::wstring(file_path.data(), file_path.length()));
#endif
DCHECK(file_util::PathExists(response_info.file_path))
<< response_info.file_path.MaybeAsASCII() << " does not exist.";
@@ -176,7 +176,7 @@ bool WebURLLoaderMockFactory::IsPending(WebURLLoaderMock* loader) {
}
// static
-bool WebURLLoaderMockFactory::ReadFile(const FilePath& file_path,
+bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path,
WebData* data) {
int64 file_size = 0;
if (!file_util::GetFileSize(file_path, &file_size))
diff --git a/webkit/support/weburl_loader_mock_factory.h b/webkit/support/weburl_loader_mock_factory.h
index 310dbbc..85fe0cc0 100644
--- a/webkit/support/weburl_loader_mock_factory.h
+++ b/webkit/support/weburl_loader_mock_factory.h
@@ -89,7 +89,7 @@ class WebURLLoaderMockFactory {
// Reads |m_filePath| and puts its content in |data|.
// Returns true if it successfully read the file.
- static bool ReadFile(const FilePath& file_path, WebKit::WebData* data);
+ static bool ReadFile(const base::FilePath& file_path, WebKit::WebData* data);
// The loaders that have not being served data yet.
typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap;
diff --git a/webkit/tools/test_shell/image_decoder_unittest.cc b/webkit/tools/test_shell/image_decoder_unittest.cc
index 849d1b2..0458af2 100644
--- a/webkit/tools/test_shell/image_decoder_unittest.cc
+++ b/webkit/tools/test_shell/image_decoder_unittest.cc
@@ -23,7 +23,7 @@ const int kFirstFrameIndex = 0;
// Determine if we should test with file specified by |path| based
// on |file_selection| and the |threshold| for the file size.
-bool ShouldSkipFile(const FilePath& path,
+bool ShouldSkipFile(const base::FilePath& path,
ImageDecoderTestFileSelection file_selection,
const int64 threshold) {
if (file_selection == TEST_ALL)
@@ -36,21 +36,21 @@ bool ShouldSkipFile(const FilePath& path,
} // namespace
-void ReadFileToVector(const FilePath& path, std::vector<char>* contents) {
+void ReadFileToVector(const base::FilePath& path, std::vector<char>* contents) {
std::string raw_image_data;
file_util::ReadFileToString(path, &raw_image_data);
contents->resize(raw_image_data.size());
memcpy(&contents->at(0), raw_image_data.data(), raw_image_data.size());
}
-FilePath GetMD5SumPath(const FilePath& path) {
- static const FilePath::StringType kDecodedDataExtension(
+base::FilePath GetMD5SumPath(const base::FilePath& path) {
+ static const base::FilePath::StringType kDecodedDataExtension(
FILE_PATH_LITERAL(".md5sum"));
- return FilePath(path.value() + kDecodedDataExtension);
+ return base::FilePath(path.value() + kDecodedDataExtension);
}
#if defined(CALCULATE_MD5_SUMS)
-void SaveMD5Sum(const FilePath& path, const WebKit::WebImage& web_image) {
+void SaveMD5Sum(const base::FilePath& path, const WebKit::WebImage& web_image) {
// Calculate MD5 sum.
base::MD5Digest digest;
web_image.getSkBitmap().lockPixels();
@@ -69,8 +69,8 @@ void SaveMD5Sum(const FilePath& path, const WebKit::WebImage& web_image) {
#if !defined(CALCULATE_MD5_SUMS)
void VerifyImage(const WebKit::WebImageDecoder& decoder,
- const FilePath& path,
- const FilePath& md5_sum_path,
+ const base::FilePath& path,
+ const base::FilePath& md5_sum_path,
size_t frame_index) {
// Make sure decoding can complete successfully.
EXPECT_TRUE(decoder.isSizeAvailable()) << path.value();
@@ -103,7 +103,7 @@ void VerifyImage(const WebKit::WebImageDecoder& decoder,
#endif
void ImageDecoderTest::SetUp() {
- FilePath data_dir;
+ base::FilePath data_dir;
ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir));
data_dir_ = data_dir.AppendASCII("webkit").
AppendASCII("data").
@@ -111,17 +111,17 @@ void ImageDecoderTest::SetUp() {
ASSERT_TRUE(file_util::PathExists(data_dir_)) << data_dir_.value();
}
-std::vector<FilePath> ImageDecoderTest::GetImageFiles() const {
+std::vector<base::FilePath> ImageDecoderTest::GetImageFiles() const {
std::string pattern = "*." + format_;
file_util::FileEnumerator enumerator(data_dir_,
false,
file_util::FileEnumerator::FILES);
- std::vector<FilePath> image_files;
- FilePath next_file_name;
+ std::vector<base::FilePath> image_files;
+ base::FilePath next_file_name;
while (!(next_file_name = enumerator.Next()).empty()) {
- FilePath base_name = next_file_name.BaseName();
+ base::FilePath base_name = next_file_name.BaseName();
#if defined(OS_WIN)
std::string base_name_ascii = WideToASCII(base_name.value());
#else
@@ -135,8 +135,8 @@ std::vector<FilePath> ImageDecoderTest::GetImageFiles() const {
return image_files;
}
-bool ImageDecoderTest::ShouldImageFail(const FilePath& path) const {
- static const FilePath::StringType kBadSuffix(FILE_PATH_LITERAL(".bad."));
+bool ImageDecoderTest::ShouldImageFail(const base::FilePath& path) const {
+ static const base::FilePath::StringType kBadSuffix(FILE_PATH_LITERAL(".bad."));
return (path.value().length() > (kBadSuffix.length() + format_.length()) &&
!path.value().compare(path.value().length() - format_.length() -
kBadSuffix.length(),
@@ -146,18 +146,18 @@ bool ImageDecoderTest::ShouldImageFail(const FilePath& path) const {
void ImageDecoderTest::TestDecoding(
ImageDecoderTestFileSelection file_selection,
const int64 threshold) {
- const std::vector<FilePath> image_files(GetImageFiles());
- for (std::vector<FilePath>::const_iterator i = image_files.begin();
+ const std::vector<base::FilePath> image_files(GetImageFiles());
+ for (std::vector<base::FilePath>::const_iterator i = image_files.begin();
i != image_files.end(); ++i) {
if (ShouldSkipFile(*i, file_selection, threshold))
continue;
- const FilePath md5_sum_path(GetMD5SumPath(*i));
+ const base::FilePath md5_sum_path(GetMD5SumPath(*i));
TestWebKitImageDecoder(*i, md5_sum_path, kFirstFrameIndex);
}
}
-void ImageDecoderTest::TestWebKitImageDecoder(const FilePath& image_path,
- const FilePath& md5_sum_path, int desired_frame_index) const {
+void ImageDecoderTest::TestWebKitImageDecoder(const base::FilePath& image_path,
+ const base::FilePath& md5_sum_path, int desired_frame_index) const {
bool should_test_chunking = true;
bool should_test_failed_images = true;
#ifdef CALCULATE_MD5_SUMS
diff --git a/webkit/tools/test_shell/image_decoder_unittest.h b/webkit/tools/test_shell/image_decoder_unittest.h
index d9bff21..85b88c2 100644
--- a/webkit/tools/test_shell/image_decoder_unittest.h
+++ b/webkit/tools/test_shell/image_decoder_unittest.h
@@ -37,7 +37,7 @@ enum ImageDecoderTestFileSelection {
};
// Returns the path the decoded data is saved at.
-FilePath GetMD5SumPath(const FilePath& path);
+base::FilePath GetMD5SumPath(const base::FilePath& path);
class ImageDecoderTest : public testing::Test {
public:
@@ -47,16 +47,16 @@ class ImageDecoderTest : public testing::Test {
virtual void SetUp() OVERRIDE;
// Returns the vector of image files for testing.
- std::vector<FilePath> GetImageFiles() const;
+ std::vector<base::FilePath> GetImageFiles() const;
// Returns true if the image is bogus and should not be successfully decoded.
- bool ShouldImageFail(const FilePath& path) const;
+ bool ShouldImageFail(const base::FilePath& path) const;
// Tests if decoder decodes image at image_path with underlying frame at
// index desired_frame_index. The md5_sum_path is needed if the test is not
// asked to generate one i.e. if # #define CALCULATE_MD5_SUMS is set.
- void TestWebKitImageDecoder(const FilePath& image_path,
- const FilePath& md5_sum_path, int desired_frame_index) const;
+ void TestWebKitImageDecoder(const base::FilePath& image_path,
+ const base::FilePath& md5_sum_path, int desired_frame_index) const;
// Verifies each of the test image files is decoded correctly and matches the
// expected state. |file_selection| and |threshold| can be used to select
@@ -77,7 +77,7 @@ class ImageDecoderTest : public testing::Test {
protected:
// Path to the test files.
- FilePath data_dir_;
+ base::FilePath data_dir_;
private:
DISALLOW_COPY_AND_ASSIGN(ImageDecoderTest);
diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc
index 8a4dbda..ec352b4 100644
--- a/webkit/tools/test_shell/plugin_tests.cc
+++ b/webkit/tools/test_shell/plugin_tests.cc
@@ -42,7 +42,7 @@ const char kPluginsDir[] = "plugins";
class PluginTest : public TestShellTest {
public:
PluginTest() {
- FilePath executable_directory;
+ base::FilePath executable_directory;
PathService::Get(base::DIR_EXE, &executable_directory);
plugin_src_ = executable_directory.AppendASCII(TEST_PLUGIN_NAME);
CHECK(file_util::PathExists(plugin_src_));
@@ -69,8 +69,8 @@ class PluginTest : public TestShellTest {
TestShellTest::SetUp();
}
- FilePath plugin_src_;
- FilePath plugin_file_path_;
+ base::FilePath plugin_src_;
+ base::FilePath plugin_file_path_;
};
// Tests navigator.plugins.refresh() works.
@@ -126,7 +126,7 @@ TEST_F(PluginTest, Refresh) {
// Tests that if a frame is deleted as a result of calling NPP_HandleEvent, we
// don't crash.
TEST_F(PluginTest, DeleteFrameDuringEvent) {
- FilePath test_html = data_dir_;
+ base::FilePath test_html = data_dir_;
test_html = test_html.AppendASCII(kPluginsDir);
test_html = test_html.AppendASCII("delete_frame.html");
test_shell_->LoadFile(test_html);
@@ -144,7 +144,7 @@ TEST_F(PluginTest, DeleteFrameDuringEvent) {
// Tests that a forced reload of the plugin will not crash.
TEST_F(PluginTest, ForceReload) {
- FilePath test_html = data_dir_;
+ base::FilePath test_html = data_dir_;
test_html = test_html.AppendASCII(kPluginsDir);
test_html = test_html.AppendASCII("force_reload.html");
test_shell_->LoadFile(test_html);
@@ -174,7 +174,7 @@ BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lparam) {
#endif
TEST_F(PluginTest, MAYBE_PluginVisibilty) {
- FilePath test_html = data_dir_;
+ base::FilePath test_html = data_dir_;
test_html = test_html.AppendASCII(kPluginsDir);
test_html = test_html.AppendASCII("plugin_visibility.html");
test_shell_->LoadFile(test_html);
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc
index 19d1a30..9b3ec46 100644
--- a/webkit/tools/test_shell/run_all_tests.cc
+++ b/webkit/tools/test_shell/run_all_tests.cc
@@ -43,7 +43,7 @@ class TestShellTestSuite : public base::TestSuite {
virtual void Initialize() {
// Override DIR_EXE early in case anything in base::TestSuite uses it.
#if defined(OS_MACOSX)
- FilePath path;
+ base::FilePath path;
PathService::Get(base::DIR_EXE, &path);
path = path.AppendASCII("TestShell.app");
base::mac::SetOverrideFrameworkBundlePath(path);
diff --git a/webkit/tools/test_shell/simple_appcache_system.cc b/webkit/tools/test_shell/simple_appcache_system.cc
index 6c066db..8503672 100644
--- a/webkit/tools/test_shell/simple_appcache_system.cc
+++ b/webkit/tools/test_shell/simple_appcache_system.cc
@@ -387,7 +387,7 @@ SimpleAppCacheSystem::~SimpleAppCacheSystem() {
}
}
-void SimpleAppCacheSystem::InitOnUIThread(const FilePath& cache_directory) {
+void SimpleAppCacheSystem::InitOnUIThread(const base::FilePath& cache_directory) {
DCHECK(!ui_message_loop_);
ui_message_loop_ = MessageLoop::current();
cache_directory_ = cache_directory;
diff --git a/webkit/tools/test_shell/simple_appcache_system.h b/webkit/tools/test_shell/simple_appcache_system.h
index 2975268a..7371913 100644
--- a/webkit/tools/test_shell/simple_appcache_system.h
+++ b/webkit/tools/test_shell/simple_appcache_system.h
@@ -38,7 +38,7 @@ class SimpleAppCacheSystem {
virtual ~SimpleAppCacheSystem();
// One-time main UI thread initialization.
- static void InitializeOnUIThread(const FilePath& cache_directory) {
+ static void InitializeOnUIThread(const base::FilePath& cache_directory) {
if (instance_)
instance_->InitOnUIThread(cache_directory);
}
@@ -85,7 +85,7 @@ class SimpleAppCacheSystem {
friend class SimpleFrontendProxy;
// Instance methods called by our static public methods
- void InitOnUIThread(const FilePath& cache_directory);
+ void InitOnUIThread(const base::FilePath& cache_directory);
void InitOnIOThread(net::URLRequestContext* request_context);
void CleanupIOThread();
WebKit::WebApplicationCacheHost* CreateCacheHostForWebKit(
@@ -109,7 +109,7 @@ class SimpleAppCacheSystem {
return ui_message_loop_ ? true : false;
}
- FilePath cache_directory_;
+ base::FilePath cache_directory_;
MessageLoop* io_message_loop_;
MessageLoop* ui_message_loop_;
scoped_refptr<SimpleBackendProxy> backend_proxy_;
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc
index f665541..87aabf4 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -54,10 +54,10 @@ namespace {
MessageLoop* g_io_thread;
webkit_blob::BlobStorageController* g_blob_storage_controller;
-void RegisterBlob(const GURL& blob_url, const FilePath& file_path) {
+void RegisterBlob(const GURL& blob_url, const base::FilePath& file_path) {
DCHECK(g_blob_storage_controller);
- FilePath::StringType extension = file_path.Extension();
+ base::FilePath::StringType extension = file_path.Extension();
if (!extension.empty())
extension = extension.substr(1); // Strip leading ".".
@@ -324,7 +324,7 @@ void SimpleFileSystem::DidFinish(WebFileSystemCallbacks* callbacks,
void SimpleFileSystem::DidGetMetadata(WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
if (result == base::PLATFORM_FILE_OK) {
WebFileInfo web_file_info;
web_file_info.length = info.size;
@@ -388,7 +388,7 @@ void SimpleFileSystem::DidCreateSnapshotFile(
WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
DCHECK(g_io_thread);
if (result == base::PLATFORM_FILE_OK) {
diff --git a/webkit/tools/test_shell/simple_file_system.h b/webkit/tools/test_shell/simple_file_system.h
index 7d55a9f..099aeba 100644
--- a/webkit/tools/test_shell/simple_file_system.h
+++ b/webkit/tools/test_shell/simple_file_system.h
@@ -128,7 +128,7 @@ class SimpleFileSystem
void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
void DidReadDirectory(
WebKit::WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
@@ -144,7 +144,7 @@ class SimpleFileSystem
WebKit::WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
// A temporary directory for FileSystem API.
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 02aaf80..743ba26 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -93,14 +93,14 @@ namespace {
struct TestShellRequestContextParams {
TestShellRequestContextParams(
- const FilePath& in_cache_path,
+ const base::FilePath& in_cache_path,
net::HttpCache::Mode in_cache_mode,
bool in_no_proxy)
: cache_path(in_cache_path),
cache_mode(in_cache_mode),
no_proxy(in_no_proxy) {}
- FilePath cache_path;
+ base::FilePath cache_path;
net::HttpCache::Mode cache_mode;
bool no_proxy;
};
@@ -177,7 +177,7 @@ class TestShellNetworkDelegate : public net::NetworkDelegate {
return rv == net::OK;
}
virtual bool OnCanAccessFile(const net::URLRequest& request,
- const FilePath& path) const OVERRIDE {
+ const base::FilePath& path) const OVERRIDE {
return true;
}
virtual bool OnCanThrottleRequest(
@@ -475,7 +475,7 @@ class RequestProxy
download_to_file_ = params->download_to_file;
if (download_to_file_) {
- FilePath path;
+ base::FilePath path;
if (file_util::CreateTemporaryFile(&path)) {
downloaded_file_ = ShareableFileReference::GetOrCreate(
path, ShareableFileReference::DELETE_ON_FINAL_RELEASE,
@@ -755,7 +755,7 @@ class RequestProxy
// Get the File URL.
original_request.replace(0, http_prefix.size(), file_url_prefix_);
- FilePath file_path;
+ base::FilePath file_path;
if (!net::FileURLToFilePath(GURL(original_request), &file_path)) {
NOTREACHED();
}
@@ -1027,7 +1027,7 @@ class CookieGetter : public base::RefCountedThreadSafe<CookieGetter> {
// static
void SimpleResourceLoaderBridge::Init(
- const FilePath& cache_path,
+ const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
// Make sure to stop any existing IO thread since it may be using the
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.h b/webkit/tools/test_shell/simple_resource_loader_bridge.h
index 6d1c63a..35d38b5 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.h
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.h
@@ -10,9 +10,12 @@
#include "net/http/http_cache.h"
#include "webkit/glue/resource_loader_bridge.h"
-class FilePath;
class GURL;
+namespace base {
+class FilePath;
+}
+
class SimpleResourceLoaderBridge {
public:
// Call this function to initialize the simple resource loader bridge.
@@ -21,7 +24,7 @@ class SimpleResourceLoaderBridge {
// NOTE: If this function is not called, then a default request context will
// be initialized lazily.
//
- static void Init(const FilePath& cache_path,
+ static void Init(const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy);
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 763495ea..677dc42 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -88,7 +88,7 @@ class URLRequestTestShellFileJob : public net::URLRequestFileJob {
net::URLRequest* request,
net::NetworkDelegate* network_delegate,
const std::string& scheme) {
- FilePath path;
+ base::FilePath path;
PathService::Get(base::DIR_EXE, &path);
path = path.AppendASCII("resources");
path = path.AppendASCII("inspector");
@@ -99,7 +99,7 @@ class URLRequestTestShellFileJob : public net::URLRequestFileJob {
private:
URLRequestTestShellFileJob(net::URLRequest* request,
net::NetworkDelegate* network_delegate,
- const FilePath& path)
+ const base::FilePath& path)
: net::URLRequestFileJob(request, network_delegate, path) {
}
virtual ~URLRequestTestShellFileJob() { }
@@ -263,7 +263,7 @@ void TestShell::InitLogging(bool suppress_error_dialogs,
destination = logging::LOG_ONLY_TO_FILE;
// We might have multiple test_shell processes going at once
- FilePath log_filename;
+ base::FilePath log_filename;
PathService::Get(base::DIR_EXE, &log_filename);
log_filename = log_filename.AppendASCII("test_shell.log");
logging::InitLogging(
@@ -459,9 +459,9 @@ WebView* TestShell::CreateWebView() {
void TestShell::ShowDevTools() {
if (!devtools_shell_) {
- FilePath dir_exe;
+ base::FilePath dir_exe;
PathService::Get(base::DIR_EXE, &dir_exe);
- FilePath devtools_path =
+ base::FilePath devtools_path =
dir_exe.AppendASCII("resources/inspector/devtools.html");
TestShell* devtools_shell;
TestShell::CreateNewWindow(GURL(devtools_path.value()),
@@ -502,7 +502,7 @@ void TestShell::ResetTestController() {
geolocation_client_mock_->resetMock();
}
-void TestShell::LoadFile(const FilePath& file) {
+void TestShell::LoadFile(const base::FilePath& file) {
LoadURLForFrame(net::FilePathToFileURL(file), string16());
}
@@ -559,7 +559,7 @@ void TestShell::GoBackOrForward(int offset) {
}
void TestShell::DumpDocumentText() {
- FilePath file_path;
+ base::FilePath file_path;
if (!PromptForSaveFile(L"Dump document text", &file_path))
return;
@@ -569,7 +569,7 @@ void TestShell::DumpDocumentText() {
}
void TestShell::DumpRenderTree() {
- FilePath file_path;
+ base::FilePath file_path;
if (!PromptForSaveFile(L"Dump render tree", &file_path))
return;
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index 58118ab..e464423 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -59,7 +59,7 @@ public:
bool dump_pixels;
// Filename we dump pixels to (when pixel testing is enabled).
- FilePath pixel_file_name;
+ base::FilePath pixel_file_name;
// The md5 hash of the bitmap dump (when pixel testing is enabled).
std::string pixel_hash;
// URL of the test.
@@ -150,14 +150,14 @@ public:
return true;
}
- void LoadFile(const FilePath& file);
+ void LoadFile(const base::FilePath& file);
void LoadURL(const GURL& url);
void LoadURLForFrame(const GURL& url, const string16& frame_name);
void GoBackOrForward(int offset);
void Reload();
bool Navigate(const TestNavigationEntry& entry, bool reload);
- bool PromptForSaveFile(const wchar_t* prompt_title, FilePath* result);
+ bool PromptForSaveFile(const wchar_t* prompt_title, base::FilePath* result);
string16 GetDocumentText();
void DumpDocumentText();
void DumpRenderTree();
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index 0ec3fd5..6576d07 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -41,9 +41,9 @@ using WebKit::WebWidget;
namespace {
-// Convert a FilePath into an FcChar* (used by fontconfig).
+// Convert a base::FilePath into an FcChar* (used by fontconfig).
// The pointer only lives for the duration for the expression.
-const FcChar8* FilePathAsFcChar(const FilePath& path) {
+const FcChar8* FilePathAsFcChar(const base::FilePath& path) {
return reinterpret_cast<const FcChar8*>(path.value().c_str());
}
@@ -159,12 +159,12 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
web_prefs_ = new webkit_glue::WebPreferences;
- FilePath data_path;
+ base::FilePath data_path;
PathService::Get(base::DIR_EXE, &data_path);
data_path = data_path.Append("test_shell.pak");
ResourceBundle::InitSharedInstanceWithPakPath(data_path);
- FilePath resources_dir;
+ base::FilePath resources_dir;
PathService::Get(base::DIR_SOURCE_ROOT, &resources_dir);
resources_dir = resources_dir.Append("webkit/tools/test_shell/resources");
@@ -185,7 +185,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
FcInit();
FcConfig* fontcfg = FcConfigCreate();
- FilePath fontconfig_path = resources_dir.Append("fonts.conf");
+ base::FilePath fontconfig_path = resources_dir.Append("fonts.conf");
if (!FcConfigParseAndLoad(fontcfg, FilePathAsFcChar(fontconfig_path),
true)) {
LOG(FATAL) << "Failed to parse fontconfig config file";
@@ -263,7 +263,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
}
// Also load the layout-test-specific "Ahem" font.
- FilePath ahem_path = resources_dir.Append("AHEM____.TTF");
+ base::FilePath ahem_path = resources_dir.Append("AHEM____.TTF");
if (!FcConfigAppFontAddFile(fontcfg, FilePathAsFcChar(ahem_path))) {
LOG(FATAL) << "Failed to load font " << ahem_path.value().c_str();
}
@@ -508,7 +508,7 @@ void TestShell::LoadURLForFrame(const GURL& url,
}
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
- FilePath* result) {
+ base::FilePath* result) {
GtkWidget* dialog;
dialog = gtk_file_chooser_dialog_new(WideToUTF8(prompt_title).c_str(),
GTK_WINDOW(m_mainWnd),
@@ -525,7 +525,7 @@ bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
}
char* path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
gtk_widget_destroy(dialog);
- *result = FilePath(path);
+ *result = base::FilePath(path);
g_free(path);
return true;
}
@@ -538,7 +538,7 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) {
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- FilePath replace_path;
+ base::FilePath replace_path;
PathService::Get(base::DIR_SOURCE_ROOT, &replace_path);
replace_path = replace_path.Append(
"third_party/WebKit/LayoutTests/");
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index ccfaa67..fe86310 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -78,12 +78,12 @@ base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> >
TestShell::window_map_ = LAZY_INSTANCE_INITIALIZER;
// Helper method for getting the path to the test shell resources directory.
-FilePath GetResourcesFilePath() {
- FilePath path;
+base::FilePath GetResourcesFilePath() {
+ base::FilePath path;
// We need to know if we're bundled or not to know which path to use.
if (base::mac::AmIBundled()) {
PathService::Get(base::DIR_EXE, &path);
- path = path.Append(FilePath::kParentDirectory);
+ path = path.Append(base::FilePath::kParentDirectory);
return path.AppendASCII("Resources");
} else {
PathService::Get(base::DIR_SOURCE_ROOT, &path);
@@ -215,7 +215,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
NSString *resource_path =
[base::mac::FrameworkBundle() pathForResource:@"test_shell"
ofType:@"pak"];
- FilePath resources_pak_path([resource_path fileSystemRepresentation]);
+ base::FilePath resources_pak_path([resource_path fileSystemRepresentation]);
if (!g_resource_data_pack->LoadFromPath(resources_pak_path)) {
LOG(FATAL) << "failed to load test_shell.pak";
}
@@ -236,7 +236,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
// Add <app bundle's parent dir>/plugins to the plugin path so we can load
// test plugins.
- FilePath plugins_dir;
+ base::FilePath plugins_dir;
PathService::Get(base::DIR_EXE, &plugins_dir);
if (base::mac::AmIBundled()) {
plugins_dir = plugins_dir.AppendASCII("../../../plugins");
@@ -539,7 +539,7 @@ void TestShell::LoadURLForFrame(const GURL& url,
}
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
- FilePath* result)
+ base::FilePath* result)
{
NSSavePanel* save_panel = [NSSavePanel savePanel];
@@ -552,7 +552,7 @@ bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
[save_panel setDirectoryURL:[NSURL fileURLWithPath:NSHomeDirectory()]];
[save_panel setNameFieldStringValue:@""];
if ([save_panel runModal] == NSFileHandlingPanelOKButton) {
- *result = FilePath([[[save_panel URL] path] fileSystemRepresentation]);
+ *result = base::FilePath([[[save_panel URL] path] fileSystemRepresentation]);
return true;
}
return false;
@@ -566,7 +566,7 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) {
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- FilePath replace_path;
+ base::FilePath replace_path;
PathService::Get(base::DIR_SOURCE_ROOT, &replace_path);
replace_path = replace_path.Append(
"third_party/WebKit/LayoutTests/");
@@ -628,7 +628,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's broken image icon (16x16)
static std::string broken_image_data;
if (broken_image_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
// In order to match WebKit's colors for the missing image, we have to
// use a PNG. The GIF doesn't have the color range needed to correctly
// match the TIFF they use in Safari.
@@ -644,7 +644,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's text area resizer image.
static std::string resize_corner_data;
if (resize_corner_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success) {
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index 5bebaad..5c98d98 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -160,7 +160,7 @@ int main(int argc, char* argv[]) {
if (parsed_command_line.HasSwitch(test_shell::kEnableFileCookies))
net::CookieMonster::EnableFileScheme();
- FilePath cache_path =
+ base::FilePath cache_path =
parsed_command_line.GetSwitchValuePath(test_shell::kCacheDir);
if (cache_path.empty()) {
PathService::Get(base::DIR_EXE, &cache_path);
@@ -214,7 +214,7 @@ int main(int argc, char* argv[]) {
// Treat the first argument as the initial URL to open.
GURL starting_url;
- FilePath path;
+ base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.AppendASCII("webkit").AppendASCII("data")
.AppendASCII("test_shell").AppendASCII("index.html");
@@ -227,7 +227,7 @@ int main(int argc, char* argv[]) {
starting_url = url;
} else {
// Treat as a relative file path.
- FilePath path = FilePath(args[0]);
+ base::FilePath path = base::FilePath(args[0]);
file_util::AbsolutePath(&path);
starting_url = net::FilePathToFileURL(path);
}
diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc
index 5bdf4c9..eec8e82 100644
--- a/webkit/tools/test_shell/test_shell_request_context.cc
+++ b/webkit/tools/test_shell/test_shell_request_context.cc
@@ -58,11 +58,11 @@ class TestShellHttpUserAgentSettings : public net::HttpUserAgentSettings {
TestShellRequestContext::TestShellRequestContext()
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
- Init(FilePath(), net::HttpCache::NORMAL, false);
+ Init(base::FilePath(), net::HttpCache::NORMAL, false);
}
TestShellRequestContext::TestShellRequestContext(
- const FilePath& cache_path,
+ const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy)
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
@@ -70,7 +70,7 @@ TestShellRequestContext::TestShellRequestContext(
}
void TestShellRequestContext::Init(
- const FilePath& cache_path,
+ const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
storage_.set_cookie_store(new net::CookieMonster(NULL, NULL));
diff --git a/webkit/tools/test_shell/test_shell_request_context.h b/webkit/tools/test_shell/test_shell_request_context.h
index 27ef6fe..bcd59e4 100644
--- a/webkit/tools/test_shell/test_shell_request_context.h
+++ b/webkit/tools/test_shell/test_shell_request_context.h
@@ -10,7 +10,9 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_storage.h"
+namespace base {
class FilePath;
+}
namespace fileapi {
class FileSystemContext;
@@ -28,7 +30,7 @@ class TestShellRequestContext : public net::URLRequestContext {
// Use an on-disk cache at the specified location. Optionally, use the cache
// in playback or record mode.
- TestShellRequestContext(const FilePath& cache_path,
+ TestShellRequestContext(const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy);
@@ -43,7 +45,7 @@ class TestShellRequestContext : public net::URLRequestContext {
}
private:
- void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode,
+ void Init(const base::FilePath& cache_path, net::HttpCache::Mode cache_mode,
bool no_proxy);
net::URLRequestContextStorage storage_;
diff --git a/webkit/tools/test_shell/test_shell_test.cc b/webkit/tools/test_shell/test_shell_test.cc
index 16357f2..2ea5e74 100644
--- a/webkit/tools/test_shell/test_shell_test.cc
+++ b/webkit/tools/test_shell/test_shell_test.cc
@@ -17,7 +17,7 @@
#include "webkit/user_agent/user_agent.h"
#include "webkit/user_agent/user_agent_util.h"
-GURL TestShellTest::GetTestURL(const FilePath& test_case_path,
+GURL TestShellTest::GetTestURL(const base::FilePath& test_case_path,
const std::string& test_case) {
return net::FilePathToFileURL(test_case_path.AppendASCII(test_case));
}
diff --git a/webkit/tools/test_shell/test_shell_test.h b/webkit/tools/test_shell/test_shell_test.h
index 3e2e354..c29a37d 100644
--- a/webkit/tools/test_shell/test_shell_test.h
+++ b/webkit/tools/test_shell/test_shell_test.h
@@ -20,7 +20,7 @@
class TestShellTest : public testing::Test {
protected:
// Returns the path "test_case_path/test_case".
- GURL GetTestURL(const FilePath& test_case_path,
+ GURL GetTestURL(const base::FilePath& test_case_path,
const std::string& test_case);
virtual void SetUp() OVERRIDE;
@@ -31,7 +31,7 @@ class TestShellTest : public testing::Test {
protected:
// Location of SOURCE_ROOT/webkit/data/
- FilePath data_dir_;
+ base::FilePath data_dir_;
TestShell* test_shell_;
};
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc
index ded88b3..72ddbbf 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.cc
+++ b/webkit/tools/test_shell/test_shell_webkit_init.cc
@@ -52,7 +52,7 @@ TestShellWebKitInit::TestShellWebKitInit(bool layout_test_mode)
WebKit::WebRuntimeFeatures::enableJavaScriptI18NAPI(true);
// Load libraries for media and enable the media player.
- FilePath module_path;
+ base::FilePath module_path;
WebKit::WebRuntimeFeatures::enableMediaPlayer(
PathService::Get(base::DIR_MODULE, &module_path) &&
media::InitializeMediaLibrary(module_path));
@@ -277,7 +277,7 @@ void TestShellWebKitInit::GetPlugins(
webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
// Don't load the forked TestNetscapePlugIn in the chromium code, use
// the copy in webkit.org's repository instead.
- const FilePath::StringType kPluginBlackList[] = {
+ const base::FilePath::StringType kPluginBlackList[] = {
FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"),
FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"),
FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"),
@@ -285,7 +285,7 @@ void TestShellWebKitInit::GetPlugins(
for (int i = plugins->size() - 1; i >= 0; --i) {
webkit::WebPluginInfo plugin_info = plugins->at(i);
for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) {
- if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) {
+ if (plugin_info.path.BaseName() == base::FilePath(kPluginBlackList[j])) {
plugins->erase(plugins->begin() + i);
}
}
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index b2d2c46..0897c44 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -101,13 +101,13 @@ bool MinidumpCallback(const wchar_t *dumpPath,
// will be happening on developers' machines where they have debuggers.
base::StackString16<kPathBufSize * 2> origPath;
origPath->append(dumpPath);
- origPath->push_back(FilePath::kSeparators[0]);
+ origPath->push_back(base::FilePath::kSeparators[0]);
origPath->append(minidumpID);
origPath->append(L".dmp");
base::StackString16<kPathBufSize * 2> newPath;
newPath->append(dumpPath);
- newPath->push_back(FilePath::kSeparators[0]);
+ newPath->push_back(base::FilePath::kSeparators[0]);
newPath->append(g_currentTestName);
newPath->append(L"-");
newPath->append(minidumpID);
@@ -121,8 +121,8 @@ bool MinidumpCallback(const wchar_t *dumpPath,
}
// Helper method for getting the path to the test shell resources directory.
-FilePath GetResourcesFilePath() {
- FilePath path;
+base::FilePath GetResourcesFilePath() {
+ base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.AppendASCII("webkit");
path = path.AppendASCII("tools");
@@ -251,7 +251,7 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) {
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- FilePath replace_url;
+ base::FilePath replace_url;
PathService::Get(base::DIR_EXE, &replace_url);
replace_url = replace_url.DirName();
replace_url = replace_url.DirName();
@@ -640,7 +640,7 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
}
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
- FilePath* result) {
+ base::FilePath* result) {
wchar_t path_buf[MAX_PATH] = L"data.txt";
OPENFILENAME info = {0};
@@ -654,7 +654,7 @@ bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
if (!GetSaveFileName(&info))
return false;
- *result = FilePath(info.lpstrFile);
+ *result = base::FilePath(info.lpstrFile);
return true;
}
@@ -689,7 +689,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's broken image icon (16x16)
static std::string broken_image_data;
if (broken_image_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("missingImage.gif");
bool success = file_util::ReadFileToString(path, &broken_image_data);
if (!success) {
@@ -702,7 +702,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's text area resizer image.
static std::string resize_corner_data;
if (resize_corner_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success) {
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index e946255..1fb12e0 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -823,7 +823,7 @@ void TestWebViewDelegate::openFileSystem(
// WebPluginPageDelegate -----------------------------------------------------
WebKit::WebPlugin* TestWebViewDelegate::CreatePluginReplacement(
- const FilePath& file_path) {
+ const base::FilePath& file_path) {
return NULL;
}
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h
index be1464d..e882017 100644
--- a/webkit/tools/test_shell/test_webview_delegate.h
+++ b/webkit/tools/test_shell/test_webview_delegate.h
@@ -236,10 +236,10 @@ class TestWebViewDelegate : public WebKit::WebViewClient,
// webkit::npapi::WebPluginPageDelegate
virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate(
- const FilePath& url,
+ const base::FilePath& url,
const std::string& mime_type) OVERRIDE;
virtual WebKit::WebPlugin* CreatePluginReplacement(
- const FilePath& file_path) OVERRIDE;
+ const base::FilePath& file_path) OVERRIDE;
virtual void CreatedPluginWindow(
gfx::PluginWindowHandle handle) OVERRIDE;
virtual void WillDestroyPluginWindow(
diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
index 8141b1c..ec72930 100644
--- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
@@ -198,7 +198,7 @@ void TestWebViewDelegate::runModal() {
// WebPluginPageDelegate ------------------------------------------------------
webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
- const FilePath& path,
+ const base::FilePath& path,
const std::string& mime_type) {
return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type);
}
diff --git a/webkit/tools/test_shell/test_webview_delegate_mac.mm b/webkit/tools/test_shell/test_webview_delegate_mac.mm
index 197ad97..42f5a64 100644
--- a/webkit/tools/test_shell/test_webview_delegate_mac.mm
+++ b/webkit/tools/test_shell/test_webview_delegate_mac.mm
@@ -227,7 +227,7 @@ void TestWebViewDelegate::runModal() {
// WebPluginPageDelegate ------------------------------------------------------
webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
- const FilePath& path,
+ const base::FilePath& path,
const std::string& mime_type) {
WebWidgetHost *host = GetWidgetHost();
if (!host)
diff --git a/webkit/tools/test_shell/test_webview_delegate_win.cc b/webkit/tools/test_shell/test_webview_delegate_win.cc
index f9ea1a7..c811f0e 100644
--- a/webkit/tools/test_shell/test_webview_delegate_win.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_win.cc
@@ -133,7 +133,7 @@ void TestWebViewDelegate::runModal() {
// WebPluginPageDelegate ------------------------------------------------------
webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
- const FilePath& path,
+ const base::FilePath& path,
const std::string& mime_type) {
HWND hwnd = shell_->webViewHost()->view_handle();
if (!hwnd)
diff --git a/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp b/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp
index f4cdd3d..0c905ca 100644
--- a/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp
+++ b/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp
@@ -26,8 +26,8 @@ TEST_F(ICOImageDecoderTest, Decoding) {
TEST_F(ICOImageDecoderTest, ImageNonZeroFrameIndex) {
// Test that the decoder decodes multiple sizes of icons which have them.
// Load an icon that has both favicon-size and larger entries.
- FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico"));
- const FilePath md5_sum_path(
+ base::FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico"));
+ const base::FilePath md5_sum_path(
GetMD5SumPath(multisize_icon_path).value() + FILE_PATH_LITERAL("2"));
static const int kDesiredFrameIndex = 3;
TestWebKitImageDecoder(multisize_icon_path, md5_sum_path, kDesiredFrameIndex);