diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-08 20:40:15 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-08 20:40:15 +0000 |
commit | 6cdfd7f74ebadbe6fd2f557039b8b94242dd714e (patch) | |
tree | 39125d76f2a25515427dd53a81265d73bbb8ed18 /net | |
parent | 81aee95aa6bcb433e4bc26212ea3341edf839bdb (diff) | |
download | chromium_src-6cdfd7f74ebadbe6fd2f557039b8b94242dd714e.zip chromium_src-6cdfd7f74ebadbe6fd2f557039b8b94242dd714e.tar.gz chromium_src-6cdfd7f74ebadbe6fd2f557039b8b94242dd714e.tar.bz2 |
Replace FilePath with base::FilePath in net.
Review URL: https://codereview.chromium.org/12218081
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
131 files changed, 671 insertions, 642 deletions
diff --git a/net/base/cert_test_util.cc b/net/base/cert_test_util.cc index 74b4a95..d384abe 100644 --- a/net/base/cert_test_util.cc +++ b/net/base/cert_test_util.cc @@ -14,10 +14,10 @@ namespace net { CertificateList CreateCertificateListFromFile( - const FilePath& certs_dir, + const base::FilePath& certs_dir, const std::string& cert_file, int format) { - FilePath cert_path = certs_dir.AppendASCII(cert_file); + base::FilePath cert_path = certs_dir.AppendASCII(cert_file); std::string cert_data; if (!file_util::ReadFileToString(cert_path, &cert_data)) return CertificateList(); @@ -27,9 +27,9 @@ CertificateList CreateCertificateListFromFile( } scoped_refptr<X509Certificate> ImportCertFromFile( - const FilePath& certs_dir, + const base::FilePath& certs_dir, const std::string& cert_file) { - FilePath cert_path = certs_dir.AppendASCII(cert_file); + base::FilePath cert_path = certs_dir.AppendASCII(cert_file); std::string cert_data; if (!file_util::ReadFileToString(cert_path, &cert_data)) return NULL; diff --git a/net/base/cert_verify_proc_unittest.cc b/net/base/cert_verify_proc_unittest.cc index 9a03123f..9dae0b2 100644 --- a/net/base/cert_verify_proc_unittest.cc +++ b/net/base/cert_verify_proc_unittest.cc @@ -152,7 +152,7 @@ TEST_F(CertVerifyProcTest, PaypalNullCertParsing) { // pass if error == ERR_CERT_DATE_INVALID. TODO(wtc): generate test // certificates for this unit test. http://crbug.com/111742 TEST_F(CertVerifyProcTest, IntermediateCARequireExplicitPolicy) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "www_us_army_mil_cert.der"); @@ -197,7 +197,7 @@ TEST_F(CertVerifyProcTest, IntermediateCARequireExplicitPolicy) { // SEC_ERROR_REVOKED_CERTIFICATE. This indicates a lack of revocation // status, i.e. that the revocation check is failing for some reason. TEST_F(CertVerifyProcTest, DISABLED_GlobalSignR3EVTest) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "2029_globalsign_com_cert.pem"); @@ -227,7 +227,7 @@ TEST_F(CertVerifyProcTest, DISABLED_GlobalSignR3EVTest) { // Test that verifying an ECDSA certificate doesn't crash on XP. (See // crbug.com/144466). TEST_F(CertVerifyProcTest, ECDSA_RSA) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> cert = ImportCertFromFile(certs_dir, @@ -258,7 +258,7 @@ static bool IsWeakKeyType(const std::string& key_type) { } TEST_F(CertVerifyProcTest, RejectWeakKeys) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); typedef std::vector<std::string> Strings; Strings key_types; @@ -329,7 +329,7 @@ TEST_F(CertVerifyProcTest, RejectWeakKeys) { // pass if error == ERR_CERT_DATE_INVALID. TODO(rsleevi): generate test // certificates for this unit test. http://crbug.com/111730 TEST_F(CertVerifyProcTest, ExtraneousMD5RootCert) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "images_etrade_wallst_com.pem"); @@ -363,7 +363,7 @@ TEST_F(CertVerifyProcTest, ExtraneousMD5RootCert) { // Test for bug 94673. TEST_F(CertVerifyProcTest, GoogleDigiNotarTest) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "google_diginotar.pem"); @@ -402,7 +402,7 @@ TEST_F(CertVerifyProcTest, DigiNotarCerts) { NULL, }; - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); for (size_t i = 0; kDigiNotarFilenames[i]; i++) { scoped_refptr<X509Certificate> diginotar_cert = @@ -428,7 +428,7 @@ TEST_F(CertVerifyProcTest, DigiNotarCerts) { } TEST_F(CertVerifyProcTest, TestKnownRoot) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, "certse.pem", X509Certificate::FORMAT_AUTO); ASSERT_EQ(3U, certs.size()); @@ -452,7 +452,7 @@ TEST_F(CertVerifyProcTest, TestKnownRoot) { } TEST_F(CertVerifyProcTest, PublicKeyHashes) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, "certse.pem", X509Certificate::FORMAT_AUTO); ASSERT_EQ(3U, certs.size()); @@ -492,7 +492,7 @@ TEST_F(CertVerifyProcTest, PublicKeyHashes) { // The Key Usage extension in this RSA SSL server certificate does not have // the keyEncipherment bit. TEST_F(CertVerifyProcTest, InvalidKeyUsage) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "invalid_key_usage_cert.der"); @@ -526,7 +526,7 @@ TEST_F(CertVerifyProcTest, InvalidKeyUsage) { // used to ensure that the actual, verified chain is being returned by // Verify(). TEST_F(CertVerifyProcTest, VerifyReturnChainBasic) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, "x509_verify_results.chain.pem", X509Certificate::FORMAT_AUTO); @@ -569,7 +569,7 @@ TEST_F(CertVerifyProcTest, VerifyReturnChainBasic) { // of intermediate certificates are combined, it's possible that order may // not be maintained. TEST_F(CertVerifyProcTest, VerifyReturnChainProperlyOrdered) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, "x509_verify_results.chain.pem", X509Certificate::FORMAT_AUTO); @@ -610,7 +610,7 @@ TEST_F(CertVerifyProcTest, VerifyReturnChainProperlyOrdered) { // Test that Verify() filters out certificates which are not related to // or part of the certificate chain being verified. TEST_F(CertVerifyProcTest, VerifyReturnChainFiltersUnrelatedCerts) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, "x509_verify_results.chain.pem", X509Certificate::FORMAT_AUTO); @@ -792,7 +792,7 @@ class CertVerifyProcWeakDigestTest TEST_P(CertVerifyProcWeakDigestTest, Verify) { WeakDigestTestData data = GetParam(); - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); ScopedTestRoot test_root; if (data.root_cert_filename) { diff --git a/net/base/directory_lister.cc b/net/base/directory_lister.cc index f61b9e3..7bb3991 100644 --- a/net/base/directory_lister.cc +++ b/net/base/directory_lister.cc @@ -94,7 +94,7 @@ void SortData(std::vector<DirectoryLister::DirectoryListerData>* data, } // namespace -DirectoryLister::DirectoryLister(const FilePath& dir, +DirectoryLister::DirectoryLister(const base::FilePath& dir, DirectoryListerDelegate* delegate) : ALLOW_THIS_IN_INITIALIZER_LIST( core_(new Core(dir, false, ALPHA_DIRS_FIRST, this))), @@ -103,7 +103,7 @@ DirectoryLister::DirectoryLister(const FilePath& dir, DCHECK(!dir.value().empty()); } -DirectoryLister::DirectoryLister(const FilePath& dir, +DirectoryLister::DirectoryLister(const base::FilePath& dir, bool recursive, SortType sort, DirectoryListerDelegate* delegate) @@ -126,7 +126,7 @@ void DirectoryLister::Cancel() { return core_->Cancel(); } -DirectoryLister::Core::Core(const FilePath& dir, +DirectoryLister::Core::Core(const base::FilePath& dir, bool recursive, SortType sort, DirectoryLister* lister) @@ -166,7 +166,7 @@ void DirectoryLister::Core::StartInternal() { file_util::FileEnumerator file_enum(dir_, recursive_, types); - FilePath path; + base::FilePath path; std::vector<DirectoryListerData> file_data; while (lister_ && !(path = file_enum.Next()).empty()) { DirectoryListerData data; diff --git a/net/base/directory_lister.h b/net/base/directory_lister.h index 11976df..f1c5234 100644 --- a/net/base/directory_lister.h +++ b/net/base/directory_lister.h @@ -27,7 +27,7 @@ class NET_EXPORT DirectoryLister { // Represents one file found. struct DirectoryListerData { file_util::FileEnumerator::FindInfo info; - FilePath path; + base::FilePath path; }; // Implement this class to receive directory entries. @@ -55,10 +55,10 @@ class NET_EXPORT DirectoryLister { FULL_PATH }; - DirectoryLister(const FilePath& dir, + DirectoryLister(const base::FilePath& dir, DirectoryListerDelegate* delegate); - DirectoryLister(const FilePath& dir, + DirectoryLister(const base::FilePath& dir, bool recursive, SortType sort, DirectoryListerDelegate* delegate); @@ -76,7 +76,7 @@ class NET_EXPORT DirectoryLister { private: class Core : public base::RefCountedThreadSafe<Core> { public: - Core(const FilePath& dir, + Core(const base::FilePath& dir, bool recursive, SortType sort, DirectoryLister* lister); @@ -98,7 +98,7 @@ class NET_EXPORT DirectoryLister { void OnDone(int error); - FilePath dir_; + base::FilePath dir_; bool recursive_; SortType sort_; scoped_refptr<base::MessageLoopProxy> origin_loop_; diff --git a/net/base/directory_lister_unittest.cc b/net/base/directory_lister_unittest.cc index 8759946..07d85ab 100644 --- a/net/base/directory_lister_unittest.cc +++ b/net/base/directory_lister_unittest.cc @@ -84,11 +84,11 @@ class ListerDelegate : public DirectoryLister::DirectoryListerDelegate { bool recursive_; bool quit_loop_after_each_file_; std::vector<file_util::FileEnumerator::FindInfo> file_list_; - std::vector<FilePath> paths_; + std::vector<base::FilePath> paths_; }; TEST(DirectoryListerTest, BigDirTest) { - FilePath path; + base::FilePath path; ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &path)); ListerDelegate delegate(false, false); @@ -101,7 +101,7 @@ TEST(DirectoryListerTest, BigDirTest) { } TEST(DirectoryListerTest, BigDirRecursiveTest) { - FilePath path; + base::FilePath path; ASSERT_TRUE(PathService::Get(base::DIR_EXE, &path)); ListerDelegate delegate(true, false); @@ -114,7 +114,7 @@ TEST(DirectoryListerTest, BigDirRecursiveTest) { } TEST(DirectoryListerTest, CancelTest) { - FilePath path; + base::FilePath path; ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &path)); ListerDelegate delegate(false, true); diff --git a/net/base/file_stream.cc b/net/base/file_stream.cc index 036fd19..aefdb69 100644 --- a/net/base/file_stream.cc +++ b/net/base/file_stream.cc @@ -43,7 +43,7 @@ FileStream::~FileStream() { bound_net_log_.EndEvent(NetLog::TYPE_FILE_STREAM_ALIVE); } -int FileStream::Open(const FilePath& path, int open_flags, +int FileStream::Open(const base::FilePath& path, int open_flags, const CompletionCallback& callback) { if (IsOpen()) { DLOG(FATAL) << "File is already open!"; @@ -56,7 +56,7 @@ int FileStream::Open(const FilePath& path, int open_flags, return ERR_IO_PENDING; } -int FileStream::OpenSync(const FilePath& path, int open_flags) { +int FileStream::OpenSync(const base::FilePath& path, int open_flags) { base::ThreadRestrictions::AssertIOAllowed(); if (IsOpen()) { diff --git a/net/base/file_stream_context.cc b/net/base/file_stream_context.cc index 1e0c157..53f3c3d 100644 --- a/net/base/file_stream_context.cc +++ b/net/base/file_stream_context.cc @@ -36,7 +36,7 @@ void FileStream::Context::Orphan() { } } -void FileStream::Context::OpenAsync(const FilePath& path, +void FileStream::Context::OpenAsync(const base::FilePath& path, int open_flags, const CompletionCallback& callback) { DCHECK(!async_in_progress_); @@ -55,7 +55,7 @@ void FileStream::Context::OpenAsync(const FilePath& path, async_in_progress_ = true; } -int FileStream::Context::OpenSync(const FilePath& path, int open_flags) { +int FileStream::Context::OpenSync(const base::FilePath& path, int open_flags) { DCHECK(!async_in_progress_); BeginOpenEvent(path); @@ -143,14 +143,14 @@ int FileStream::Context::RecordAndMapError(int error, return net_error; } -void FileStream::Context::BeginOpenEvent(const FilePath& path) { +void FileStream::Context::BeginOpenEvent(const base::FilePath& path) { std::string file_name = path.AsUTF8Unsafe(); bound_net_log_.BeginEvent(NetLog::TYPE_FILE_STREAM_OPEN, NetLog::StringCallback("file_name", &file_name)); } FileStream::Context::OpenResult FileStream::Context::OpenFileImpl( - const FilePath& path, int open_flags) { + const base::FilePath& path, int open_flags) { // FileStream::Context actually closes the file asynchronously, independently // from FileStream's destructor. It can cause problems for users wanting to // delete the file right after FileStream deletion. Thus we are always diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc index 731de77..1757918 100644 --- a/net/base/file_stream_unittest.cc +++ b/net/base/file_stream_unittest.cc @@ -49,10 +49,10 @@ class FileStreamTest : public PlatformTest { PlatformTest::TearDown(); } - const FilePath temp_file_path() const { return temp_file_path_; } + const base::FilePath temp_file_path() const { return temp_file_path_; } private: - FilePath temp_file_path_; + base::FilePath temp_file_path_; }; namespace { diff --git a/net/base/filter.cc b/net/base/filter.cc index d633ca5..dbda8a6 100644 --- a/net/base/filter.cc +++ b/net/base/filter.cc @@ -178,8 +178,9 @@ void Filter::FixupEncodingTypes( GURL url; success = filter_context.GetURL(&url); DCHECK(success); - FilePath filename = FilePath().AppendASCII(url.ExtractFileName()); - FilePath::StringType extension = filename.Extension(); + base::FilePath filename = + base::FilePath().AppendASCII(url.ExtractFileName()); + base::FilePath::StringType extension = filename.Extension(); if (filter_context.IsDownload()) { // We don't want to decompress gzipped files when the user explicitly diff --git a/net/base/gzip_filter_unittest.cc b/net/base/gzip_filter_unittest.cc index c889143..be98bae 100644 --- a/net/base/gzip_filter_unittest.cc +++ b/net/base/gzip_filter_unittest.cc @@ -61,7 +61,7 @@ class GZipUnitTest : public PlatformTest { gzip_encode_buffer_ = NULL; // Get the path of source data file. - FilePath file_path; + base::FilePath file_path; PathService::Get(base::DIR_SOURCE_ROOT, &file_path); file_path = file_path.AppendASCII("net"); file_path = file_path.AppendASCII("data"); diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 0ad9ea6..27c3919 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -45,13 +45,13 @@ namespace net { // Singleton utility class for mime types. class MimeUtil : public PlatformMimeUtil { public: - bool GetMimeTypeFromExtension(const FilePath::StringType& ext, + bool GetMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type) const; - bool GetMimeTypeFromFile(const FilePath& file_path, + bool GetMimeTypeFromFile(const base::FilePath& file_path, std::string* mime_type) const; - bool GetWellKnownMimeTypeFromExtension(const FilePath::StringType& ext, + bool GetWellKnownMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type) const; bool IsSupportedImageMimeType(const std::string& mime_type) const; @@ -94,7 +94,7 @@ class MimeUtil : public PlatformMimeUtil { // For faster lookup, keep hash sets. void InitializeMimeTypeMaps(); - bool GetMimeTypeFromExtensionHelper(const FilePath::StringType& ext, + bool GetMimeTypeFromExtensionHelper(const base::FilePath::StringType& ext, bool include_platform_types, std::string* mime_type) const; @@ -184,28 +184,29 @@ static const char* FindMimeType(const MimeInfo* mappings, return NULL; } -bool MimeUtil::GetMimeTypeFromExtension(const FilePath::StringType& ext, +bool MimeUtil::GetMimeTypeFromExtension(const base::FilePath::StringType& ext, string* result) const { return GetMimeTypeFromExtensionHelper(ext, true, result); } bool MimeUtil::GetWellKnownMimeTypeFromExtension( - const FilePath::StringType& ext, + const base::FilePath::StringType& ext, string* result) const { return GetMimeTypeFromExtensionHelper(ext, false, result); } -bool MimeUtil::GetMimeTypeFromFile(const FilePath& file_path, +bool MimeUtil::GetMimeTypeFromFile(const base::FilePath& file_path, string* result) const { - FilePath::StringType file_name_str = file_path.Extension(); + base::FilePath::StringType file_name_str = file_path.Extension(); if (file_name_str.empty()) return false; return GetMimeTypeFromExtension(file_name_str.substr(1), result); } -bool MimeUtil::GetMimeTypeFromExtensionHelper(const FilePath::StringType& ext, - bool include_platform_types, - string* result) const { +bool MimeUtil::GetMimeTypeFromExtensionHelper( + const base::FilePath::StringType& ext, + bool include_platform_types, + string* result) const { // Avoids crash when unable to handle a long file path. See crbug.com/48733. const unsigned kMaxFilePathSize = 65536; if (ext.length() > kMaxFilePathSize) @@ -677,22 +678,23 @@ bool MimeUtil::IsSupportedStrictMediaMimeType( // Wrappers for the singleton //---------------------------------------------------------------------------- -bool GetMimeTypeFromExtension(const FilePath::StringType& ext, +bool GetMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type) { return g_mime_util.Get().GetMimeTypeFromExtension(ext, mime_type); } -bool GetMimeTypeFromFile(const FilePath& file_path, std::string* mime_type) { +bool GetMimeTypeFromFile(const base::FilePath& file_path, + std::string* mime_type) { return g_mime_util.Get().GetMimeTypeFromFile(file_path, mime_type); } -bool GetWellKnownMimeTypeFromExtension(const FilePath::StringType& ext, +bool GetWellKnownMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type) { return g_mime_util.Get().GetWellKnownMimeTypeFromExtension(ext, mime_type); } bool GetPreferredExtensionForMimeType(const std::string& mime_type, - FilePath::StringType* extension) { + base::FilePath::StringType* extension) { return g_mime_util.Get().GetPreferredExtensionForMimeType(mime_type, extension); } @@ -829,8 +831,8 @@ void GetExtensionsFromHardCodedMappings( const MimeInfo* mappings, size_t mappings_len, const std::string& leading_mime_type, - base::hash_set<FilePath::StringType>* extensions) { - FilePath::StringType extension; + base::hash_set<base::FilePath::StringType>* extensions) { + base::FilePath::StringType extension; for (size_t i = 0; i < mappings_len; ++i) { if (StartsWithASCII(mappings[i].mime_type, leading_mime_type, false)) { std::vector<string> this_extensions; @@ -838,9 +840,9 @@ void GetExtensionsFromHardCodedMappings( &this_extensions); for (size_t j = 0; j < this_extensions.size(); ++j) { #if defined(OS_WIN) - FilePath::StringType extension(UTF8ToWide(this_extensions[j])); + base::FilePath::StringType extension(UTF8ToWide(this_extensions[j])); #else - FilePath::StringType extension(this_extensions[j]); + base::FilePath::StringType extension(this_extensions[j]); #endif extensions->insert(extension); } @@ -848,10 +850,11 @@ void GetExtensionsFromHardCodedMappings( } } -void GetExtensionsHelper(const char* const* standard_types, - size_t standard_types_len, - const std::string& leading_mime_type, - base::hash_set<FilePath::StringType>* extensions) { +void GetExtensionsHelper( + const char* const* standard_types, + size_t standard_types_len, + const std::string& leading_mime_type, + base::hash_set<base::FilePath::StringType>* extensions) { for (size_t i = 0; i < standard_types_len; ++i) { g_mime_util.Get().GetPlatformExtensionsForMimeType(standard_types[i], extensions); @@ -883,13 +886,14 @@ void HashSetToVector(base::hash_set<T>* source, std::vector<T>* target) { } } -void GetExtensionsForMimeType(const std::string& unsafe_mime_type, - std::vector<FilePath::StringType>* extensions) { +void GetExtensionsForMimeType( + const std::string& unsafe_mime_type, + std::vector<base::FilePath::StringType>* extensions) { if (unsafe_mime_type == "*/*" || unsafe_mime_type == "*") return; const std::string mime_type = StringToLowerASCII(unsafe_mime_type); - base::hash_set<FilePath::StringType> unique_extensions; + base::hash_set<base::FilePath::StringType> unique_extensions; if (EndsWith(mime_type, "/*", true)) { std::string leading_mime_type = mime_type.substr(0, mime_type.length() - 1); diff --git a/net/base/mime_util.h b/net/base/mime_util.h index 45990d3..96d638a 100644 --- a/net/base/mime_util.h +++ b/net/base/mime_util.h @@ -15,7 +15,7 @@ namespace net { // Get the mime type (if any) that is associated with the given file extension. // Returns true if a corresponding mime type exists. -NET_EXPORT bool GetMimeTypeFromExtension(const FilePath::StringType& ext, +NET_EXPORT bool GetMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type); // Get the mime type (if any) that is associated with the given file extension. @@ -23,12 +23,12 @@ NET_EXPORT bool GetMimeTypeFromExtension(const FilePath::StringType& ext, // the search for a mime type is constrained to a limited set of // types known to the net library, the OS/registry is not consulted. NET_EXPORT bool GetWellKnownMimeTypeFromExtension( - const FilePath::StringType& ext, + const base::FilePath::StringType& ext, std::string* mime_type); // Get the mime type (if any) that is associated with the given file. Returns // true if a corresponding mime type exists. -NET_EXPORT bool GetMimeTypeFromFile(const FilePath& file_path, +NET_EXPORT bool GetMimeTypeFromFile(const base::FilePath& file_path, std::string* mime_type); // Get the preferred extension (if any) associated with the given mime type. @@ -36,7 +36,7 @@ NET_EXPORT bool GetMimeTypeFromFile(const FilePath& file_path, // returned without a prefixed dot, ex "html". NET_EXPORT bool GetPreferredExtensionForMimeType( const std::string& mime_type, - FilePath::StringType* extension); + base::FilePath::StringType* extension); // Check to see if a particular MIME type is in our list. NET_EXPORT bool IsSupportedImageMimeType(const std::string& mime_type); @@ -92,7 +92,7 @@ NET_EXPORT bool IsSupportedStrictMediaMimeType( // Instead, we append the result to it. NET_EXPORT void GetExtensionsForMimeType( const std::string& mime_type, - std::vector<FilePath::StringType>* extensions); + std::vector<base::FilePath::StringType>* extensions); // Test only methods that return lists of proprietary media types and codecs // that are not supported by all variations of Chromium. diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc index be4d7ca..38445f0 100644 --- a/net/base/mime_util_unittest.cc +++ b/net/base/mime_util_unittest.cc @@ -12,7 +12,7 @@ namespace net { TEST(MimeUtilTest, ExtensionTest) { const struct { - const FilePath::CharType* extension; + const base::FilePath::CharType* extension; const char* mime_type; bool valid; } tests[] = { @@ -36,7 +36,7 @@ TEST(MimeUtilTest, ExtensionTest) { TEST(MimeUtilTest, FileTest) { const struct { - const FilePath::CharType* file_path; + const base::FilePath::CharType* file_path; const char* mime_type; bool valid; } tests[] = { @@ -52,7 +52,7 @@ TEST(MimeUtilTest, FileTest) { bool rv; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { - rv = GetMimeTypeFromFile(FilePath(tests[i].file_path), + rv = GetMimeTypeFromFile(base::FilePath(tests[i].file_path), &mime_type); EXPECT_EQ(tests[i].valid, rv); if (rv) @@ -255,7 +255,7 @@ TEST(MimeUtilTest, TestGetExtensionsForMimeType) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { - std::vector<FilePath::StringType> extensions; + std::vector<base::FilePath::StringType> extensions; GetExtensionsForMimeType(tests[i].mime_type, &extensions); ASSERT_TRUE(tests[i].min_expected_size <= extensions.size()); diff --git a/net/base/mock_file_stream.cc b/net/base/mock_file_stream.cc index fccb7a0..d160f0c 100644 --- a/net/base/mock_file_stream.cc +++ b/net/base/mock_file_stream.cc @@ -8,7 +8,7 @@ namespace net { namespace testing { -int MockFileStream::OpenSync(const FilePath& path, int open_flags) { +int MockFileStream::OpenSync(const base::FilePath& path, int open_flags) { path_ = path; return ReturnError(FileStream::OpenSync(path, open_flags)); } diff --git a/net/base/mock_file_stream.h b/net/base/mock_file_stream.h index f9c8bbd..1509b50 100644 --- a/net/base/mock_file_stream.h +++ b/net/base/mock_file_stream.h @@ -28,7 +28,7 @@ class MockFileStream : public net::FileStream { : net::FileStream(file, flags, net_log), forced_error_(net::OK) {} // FileStream methods. - virtual int OpenSync(const FilePath& path, int open_flags) OVERRIDE; + virtual int OpenSync(const base::FilePath& path, int open_flags) OVERRIDE; virtual int Seek(net::Whence whence, int64 offset, const Int64CompletionCallback& callback) OVERRIDE; virtual int64 SeekSync(net::Whence whence, int64 offset) OVERRIDE; @@ -49,7 +49,7 @@ class MockFileStream : public net::FileStream { void set_forced_error(int error) { forced_error_ = error; } void clear_forced_error() { forced_error_ = net::OK; } int forced_error() const { return forced_error_; } - const FilePath& get_path() const { return path_; } + const base::FilePath& get_path() const { return path_; } private: int ReturnError(int function_error) { @@ -73,7 +73,7 @@ class MockFileStream : public net::FileStream { } int forced_error_; - FilePath path_; + base::FilePath path_; }; } // namespace testing diff --git a/net/base/multi_threaded_cert_verifier_unittest.cc b/net/base/multi_threaded_cert_verifier_unittest.cc index 6b0570c..f9bab0a 100644 --- a/net/base/multi_threaded_cert_verifier_unittest.cc +++ b/net/base/multi_threaded_cert_verifier_unittest.cc @@ -58,7 +58,7 @@ class MultiThreadedCertVerifierTest : public ::testing::Test { }; TEST_F(MultiThreadedCertVerifierTest, CacheHit) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "ok_cert.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); @@ -97,7 +97,7 @@ TEST_F(MultiThreadedCertVerifierTest, CacheHit) { // certificates. These should be treated as different certificate chains even // though the two X509Certificate objects contain the same server certificate. TEST_F(MultiThreadedCertVerifierTest, DifferentCACerts) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "salesforce_com_test.pem"); @@ -155,7 +155,7 @@ TEST_F(MultiThreadedCertVerifierTest, DifferentCACerts) { // Tests an inflight join. TEST_F(MultiThreadedCertVerifierTest, InflightJoin) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "ok_cert.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); @@ -189,7 +189,7 @@ TEST_F(MultiThreadedCertVerifierTest, InflightJoin) { // Tests that the callback of a canceled request is never made. TEST_F(MultiThreadedCertVerifierTest, CancelRequest) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "ok_cert.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); @@ -222,7 +222,7 @@ TEST_F(MultiThreadedCertVerifierTest, CancelRequest) { // Tests that a canceled request is not leaked. TEST_F(MultiThreadedCertVerifierTest, CancelRequestThenQuit) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "ok_cert.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); diff --git a/net/base/net_util.cc b/net/base/net_util.cc index cd1df3e..ce1f786 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -83,7 +83,7 @@ namespace net { namespace { // what we prepend to get a file URL -static const FilePath::CharType kFileURLPrefix[] = +static const base::FilePath::CharType kFileURLPrefix[] = FILE_PATH_LITERAL("file:///"); // The general list of blocked ports. Will be blocked unless a specific @@ -852,15 +852,15 @@ bool IsReservedName(const string16& filename) { // integrating with the user's shell. void EnsureSafeExtension(const std::string& mime_type, bool ignore_extension, - FilePath* file_name) { + base::FilePath* file_name) { // See if our file name already contains an extension. - FilePath::StringType extension = file_name->Extension(); + base::FilePath::StringType extension = file_name->Extension(); if (!extension.empty()) extension.erase(extension.begin()); // Erase preceding '.'. if ((ignore_extension || extension.empty()) && !mime_type.empty()) { - FilePath::StringType preferred_mime_extension; - std::vector<FilePath::StringType> all_mime_extensions; + base::FilePath::StringType preferred_mime_extension; + std::vector<base::FilePath::StringType> all_mime_extensions; // The GetPreferredExtensionForMimeType call will end up going to disk. Do // this on another thread to avoid slowing the IO thread. // http://crbug.com/61827 @@ -882,7 +882,7 @@ void EnsureSafeExtension(const std::string& mime_type, } #if defined(OS_WIN) - static const FilePath::CharType default_extension[] = + static const base::FilePath::CharType default_extension[] = FILE_PATH_LITERAL("download"); // Rename shell-integrated extensions. @@ -911,11 +911,11 @@ size_t GetCountOfExplicitlyAllowedPorts() { return g_explicitly_allowed_ports.Get().size(); } -GURL FilePathToFileURL(const FilePath& path) { +GURL FilePathToFileURL(const base::FilePath& path) { // Produce a URL like "file:///C:/foo" for a regular file, or // "file://///server/path" for UNC. The URL canonicalizer will fix up the // latter case to be the canonical UNC form: "file://server/path" - FilePath::StringType url_string(kFileURLPrefix); + base::FilePath::StringType url_string(kFileURLPrefix); url_string.append(path.value()); // Now do replacement of some characters. Since we assume the input is a @@ -1120,19 +1120,19 @@ string16 StripWWWFromHost(const GURL& url) { void GenerateSafeFileName(const std::string& mime_type, bool ignore_extension, - FilePath* file_path) { + base::FilePath* file_path) { // Make sure we get the right file extension EnsureSafeExtension(mime_type, ignore_extension, file_path); #if defined(OS_WIN) // Prepend "_" to the file name if it's a reserved name - FilePath::StringType leaf_name = file_path->BaseName().value(); + base::FilePath::StringType leaf_name = file_path->BaseName().value(); DCHECK(!leaf_name.empty()); if (IsReservedName(leaf_name)) { - leaf_name = FilePath::StringType(FILE_PATH_LITERAL("_")) + leaf_name; + leaf_name = base::FilePath::StringType(FILE_PATH_LITERAL("_")) + leaf_name; *file_path = file_path->DirName(); - if (file_path->value() == FilePath::kCurrentDirectory) { - *file_path = FilePath(leaf_name); + if (file_path->value() == base::FilePath::kCurrentDirectory) { + *file_path = base::FilePath(leaf_name); } else { *file_path = file_path->Append(leaf_name); } @@ -1207,24 +1207,24 @@ string16 GetSuggestedFilename(const GURL& url, trimmed_trailing_character_count += path_length_before_trim - path.length(); file_util::ReplaceIllegalCharactersInPath(&path, '-'); path.append(trimmed_trailing_character_count, '-'); - FilePath result(path); + base::FilePath result(path); GenerateSafeFileName(mime_type, overwrite_extension, &result); return result.value(); #else std::string path = filename.empty() ? default_name : filename; file_util::ReplaceIllegalCharactersInPath(&path, '-'); - FilePath result(path); + base::FilePath result(path); GenerateSafeFileName(mime_type, overwrite_extension, &result); return UTF8ToUTF16(result.value()); #endif } -FilePath GenerateFileName(const GURL& url, - const std::string& content_disposition, - const std::string& referrer_charset, - const std::string& suggested_name, - const std::string& mime_type, - const std::string& default_file_name) { +base::FilePath GenerateFileName(const GURL& url, + const std::string& content_disposition, + const std::string& referrer_charset, + const std::string& suggested_name, + const std::string& mime_type, + const std::string& default_file_name) { string16 file_name = GetSuggestedFilename(url, content_disposition, referrer_charset, @@ -1233,9 +1233,10 @@ FilePath GenerateFileName(const GURL& url, default_file_name); #if defined(OS_WIN) - FilePath generated_name(file_name); + base::FilePath generated_name(file_name); #else - FilePath generated_name(base::SysWideToNativeMB(UTF16ToWide(file_name))); + base::FilePath generated_name( + base::SysWideToNativeMB(UTF16ToWide(file_name))); #endif #if defined(OS_CHROMEOS) diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc index f66ae97..0bc0de6 100644 --- a/net/base/net_util_posix.cc +++ b/net/base/net_util_posix.cc @@ -29,8 +29,8 @@ namespace net { -bool FileURLToFilePath(const GURL& url, FilePath* path) { - *path = FilePath(); +bool FileURLToFilePath(const GURL& url, base::FilePath* path) { + *path = base::FilePath(); std::string& file_path_str = const_cast<std::string&>(path->value()); file_path_str.clear(); diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc index e4e181b..0945b2c 100644 --- a/net/base/net_util_unittest.cc +++ b/net/base/net_util_unittest.cc @@ -488,7 +488,7 @@ void RunGenerateFileNameTestCase(const GenerateFilenameCase* test_case, size_t iteration, const char* suite) { std::string default_filename(WideToUTF8(test_case->default_filename)); - FilePath file_path = GenerateFileName( + base::FilePath file_path = GenerateFileName( GURL(test_case->url), test_case->content_disp_header, test_case->referrer_charset, test_case->suggested_filename, test_case->mime_type, default_filename); @@ -539,7 +539,7 @@ TEST(NetUtilTest, FileURLConversion) { }; // First, we'll test that we can round-trip all of the above cases of URLs - FilePath output; + base::FilePath output; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(round_trip_cases); i++) { // convert to the file URL GURL file_url(FilePathToFileURL( @@ -818,8 +818,8 @@ TEST(NetUtilTest, StripWWW) { TEST(NetUtilTest, GenerateSafeFileName) { const struct { const char* mime_type; - const FilePath::CharType* filename; - const FilePath::CharType* expected_filename; + const base::FilePath::CharType* filename; + const base::FilePath::CharType* expected_filename; } safe_tests[] = { #if defined(OS_WIN) { @@ -964,7 +964,7 @@ TEST(NetUtilTest, GenerateSafeFileName) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(safe_tests); ++i) { - FilePath file_path(safe_tests[i].filename); + base::FilePath file_path(safe_tests[i].filename); GenerateSafeFileName(safe_tests[i].mime_type, false, &file_path); EXPECT_EQ(safe_tests[i].expected_filename, file_path.value()) << "Iteration " << i; diff --git a/net/base/net_util_win.cc b/net/base/net_util_win.cc index 5debd72..5b101ae 100644 --- a/net/base/net_util_win.cc +++ b/net/base/net_util_win.cc @@ -22,8 +22,8 @@ namespace net { -bool FileURLToFilePath(const GURL& url, FilePath* file_path) { - *file_path = FilePath(); +bool FileURLToFilePath(const GURL& url, base::FilePath* file_path) { + *file_path = base::FilePath(); std::wstring& file_path_str = const_cast<std::wstring&>(file_path->value()); file_path_str.clear(); diff --git a/net/base/nss_cert_database_unittest.cc b/net/base/nss_cert_database_unittest.cc index c88962d..b5e20b81 100644 --- a/net/base/nss_cert_database_unittest.cc +++ b/net/base/nss_cert_database_unittest.cc @@ -67,7 +67,7 @@ class CertDatabaseNSSTest : public testing::Test { protected: static std::string ReadTestFile(const std::string& name) { std::string result; - FilePath cert_path = GetTestCertsDirectory().AppendASCII(name); + base::FilePath cert_path = GetTestCertsDirectory().AppendASCII(name); EXPECT_TRUE(file_util::ReadFileToString(cert_path, &result)); return result; } diff --git a/net/base/platform_mime_util.h b/net/base/platform_mime_util.h index 85ee6cc..2cd4e2d 100644 --- a/net/base/platform_mime_util.h +++ b/net/base/platform_mime_util.h @@ -16,20 +16,21 @@ namespace net { class PlatformMimeUtil { public: // See documentation for base::GetPreferredExtensionForMimeType [mime_util.h] - bool GetPreferredExtensionForMimeType(const std::string& mime_type, - FilePath::StringType* extension) const; + bool GetPreferredExtensionForMimeType( + const std::string& mime_type, + base::FilePath::StringType* extension) const; // Adds all the extensions that the platform associates with the type // |mime_type| to the set |extensions|. Returns at least the value returned // by GetPreferredExtensionForMimeType. void GetPlatformExtensionsForMimeType( const std::string& mime_type, - base::hash_set<FilePath::StringType>* extensions) const; + base::hash_set<base::FilePath::StringType>* extensions) const; protected: // Get the mime type (if any) that is associated with the file extension. // Returns true if a corresponding mime type exists. - bool GetPlatformMimeTypeFromExtension(const FilePath::StringType& ext, + bool GetPlatformMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type) const; }; diff --git a/net/base/platform_mime_util_linux.cc b/net/base/platform_mime_util_linux.cc index 145f218..f4099e4 100644 --- a/net/base/platform_mime_util_linux.cc +++ b/net/base/platform_mime_util_linux.cc @@ -19,12 +19,12 @@ namespace net { #if defined(OS_ANDROID) bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( - const FilePath::StringType& ext, std::string* result) const { + const base::FilePath::StringType& ext, std::string* result) const { return android::GetMimeTypeFromExtension(ext, result); } #else bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( - const FilePath::StringType& ext, std::string* result) const { + const base::FilePath::StringType& ext, std::string* result) const { // TODO(thestig): This is a temporary hack until we can fix this // properly in test shell / webkit. // We have to play dumb and not return application/x-perl here @@ -32,7 +32,7 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( if (ext == "pl") return false; - FilePath dummy_path("foo." + ext); + base::FilePath dummy_path("foo." + ext); std::string out = base::nix::GetFileMimeType(dummy_path); // GetFileMimeType likes to return application/octet-stream @@ -74,7 +74,7 @@ const struct MimeToExt mime_type_ext_map[] = { }; bool PlatformMimeUtil::GetPreferredExtensionForMimeType( - const std::string& mime_type, FilePath::StringType* ext) const { + const std::string& mime_type, base::FilePath::StringType* ext) const { for (size_t x = 0; x < (sizeof(mime_type_ext_map) / sizeof(MimeToExt)); @@ -100,8 +100,8 @@ bool PlatformMimeUtil::GetPreferredExtensionForMimeType( void PlatformMimeUtil::GetPlatformExtensionsForMimeType( const std::string& mime_type, - base::hash_set<FilePath::StringType>* extensions) const { - FilePath::StringType ext; + base::hash_set<base::FilePath::StringType>* extensions) const { + base::FilePath::StringType ext; if (GetPreferredExtensionForMimeType(mime_type, &ext)) extensions->insert(ext); } diff --git a/net/base/platform_mime_util_mac.mm b/net/base/platform_mime_util_mac.mm index a431a36..ca85a8e 100644 --- a/net/base/platform_mime_util_mac.mm +++ b/net/base/platform_mime_util_mac.mm @@ -32,7 +32,7 @@ namespace net { bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( - const FilePath::StringType& ext, std::string* result) const { + const base::FilePath::StringType& ext, std::string* result) const { std::string ext_nodot = ext; if (ext_nodot.length() >= 1 && ext_nodot[0] == L'.') ext_nodot.erase(ext_nodot.begin()); @@ -56,7 +56,7 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( } bool PlatformMimeUtil::GetPreferredExtensionForMimeType( - const std::string& mime_type, FilePath::StringType* ext) const { + const std::string& mime_type, base::FilePath::StringType* ext) const { base::mac::ScopedCFTypeRef<CFStringRef> mime_ref( base::SysUTF8ToCFStringRef(mime_type)); if (!mime_ref) @@ -78,7 +78,7 @@ bool PlatformMimeUtil::GetPreferredExtensionForMimeType( void PlatformMimeUtil::GetPlatformExtensionsForMimeType( const std::string& mime_type, - base::hash_set<FilePath::StringType>* extensions) const { + base::hash_set<base::FilePath::StringType>* extensions) const { #if defined(OS_IOS) NSArray* extensions_list = nil; #else @@ -101,7 +101,7 @@ void PlatformMimeUtil::GetPlatformExtensionsForMimeType( extensions->insert(base::SysNSStringToUTF8(extension)); } else { // Huh? Give up. - FilePath::StringType ext; + base::FilePath::StringType ext; if (GetPreferredExtensionForMimeType(mime_type, &ext)) extensions->insert(ext); } diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc index 7b65965..901a4d3 100644 --- a/net/base/platform_mime_util_win.cc +++ b/net/base/platform_mime_util_win.cc @@ -12,7 +12,7 @@ namespace net { bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( - const FilePath::StringType& ext, std::string* result) const { + const base::FilePath::StringType& ext, std::string* result) const { // check windows registry for file extension's mime type (registry key // names are not case-sensitive). std::wstring value, key = L"." + ext; @@ -26,7 +26,7 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( } bool PlatformMimeUtil::GetPreferredExtensionForMimeType( - const std::string& mime_type, FilePath::StringType* ext) const { + const std::string& mime_type, base::FilePath::StringType* ext) const { std::wstring key(L"MIME\\Database\\Content Type\\" + UTF8ToWide(mime_type)); if (base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue( L"Extension", ext) != ERROR_SUCCESS) { @@ -41,12 +41,12 @@ bool PlatformMimeUtil::GetPreferredExtensionForMimeType( void PlatformMimeUtil::GetPlatformExtensionsForMimeType( const std::string& mime_type, - base::hash_set<FilePath::StringType>* extensions) const { + base::hash_set<base::FilePath::StringType>* extensions) const { // Multiple extensions could have the given mime type specified as their types // in their 'HKCR\.<extension>\Content Type' keys. Iterating all the HKCR // entries, though, is wildly impractical. Cheat by returning just the // preferred extension. - FilePath::StringType ext; + base::FilePath::StringType ext; if (GetPreferredExtensionForMimeType(mime_type, &ext)) extensions->insert(ext); } diff --git a/net/base/test_data_directory.cc b/net/base/test_data_directory.cc index 3398fc0..df30c4f 100644 --- a/net/base/test_data_directory.cc +++ b/net/base/test_data_directory.cc @@ -10,22 +10,22 @@ namespace net { namespace { -const FilePath::CharType kCertificateRelativePath[] = +const base::FilePath::CharType kCertificateRelativePath[] = FILE_PATH_LITERAL("net/data/ssl/certificates"); } // namespace -FilePath GetTestCertsDirectory() { - FilePath src_root; +base::FilePath GetTestCertsDirectory() { + base::FilePath src_root; PathService::Get(base::DIR_SOURCE_ROOT, &src_root); return src_root.Append(kCertificateRelativePath); } -FilePath GetTestCertsDirectoryRelative() { - return FilePath(kCertificateRelativePath); +base::FilePath GetTestCertsDirectoryRelative() { + return base::FilePath(kCertificateRelativePath); } -FilePath GetWebSocketTestDataDirectory() { - FilePath data_dir(FILE_PATH_LITERAL("net/data/websocket")); +base::FilePath GetWebSocketTestDataDirectory() { + base::FilePath data_dir(FILE_PATH_LITERAL("net/data/websocket")); return data_dir; } diff --git a/net/base/test_data_directory.h b/net/base/test_data_directory.h index 0833c8e..2ed0ed6 100644 --- a/net/base/test_data_directory.h +++ b/net/base/test_data_directory.h @@ -11,16 +11,16 @@ namespace net { // Returns the FilePath object representing the absolute path in the source // tree that contains certificates for testing. -FilePath GetTestCertsDirectory(); +base::FilePath GetTestCertsDirectory(); -// Returns the FilePath object representing the path to the certificate +// Returns the base::FilePath object representing the path to the certificate // directory in relation to the source root. -FilePath GetTestCertsDirectoryRelative(); +base::FilePath GetTestCertsDirectoryRelative(); -// Returns the FilePath object representing the relative path containing +// Returns the base::FilePath object representing the relative path containing // resource files for testing WebSocket. Typically the FilePath will be used as // document root argument for net::TestServer with TYPE_WS or TYPE_WSS. -FilePath GetWebSocketTestDataDirectory(); +base::FilePath GetWebSocketTestDataDirectory(); } // namespace net diff --git a/net/base/test_root_certs.cc b/net/base/test_root_certs.cc index 5b742e1..83a98d1 100644 --- a/net/base/test_root_certs.cc +++ b/net/base/test_root_certs.cc @@ -20,7 +20,7 @@ bool g_has_instance = false; base::LazyInstance<TestRootCerts>::Leaky g_test_root_certs = LAZY_INSTANCE_INITIALIZER; -CertificateList LoadCertificates(const FilePath& filename) { +CertificateList LoadCertificates(const base::FilePath& filename) { std::string raw_cert; if (!file_util::ReadFileToString(filename, &raw_cert)) { LOG(ERROR) << "Can't load certificate " << filename.value(); @@ -42,7 +42,7 @@ bool TestRootCerts::HasInstance() { return g_has_instance; } -bool TestRootCerts::AddFromFile(const FilePath& file) { +bool TestRootCerts::AddFromFile(const base::FilePath& file) { CertificateList root_certs = LoadCertificates(file); if (root_certs.empty() || root_certs.size() > 1) return false; diff --git a/net/base/unix_domain_socket_posix_unittest.cc b/net/base/unix_domain_socket_posix_unittest.cc index bad626f..c8dfea1 100644 --- a/net/base/unix_domain_socket_posix_unittest.cc +++ b/net/base/unix_domain_socket_posix_unittest.cc @@ -52,7 +52,7 @@ enum EventType { }; string MakeSocketPath() { - FilePath temp_dir; + base::FilePath temp_dir; file_util::GetTempDir(&temp_dir); return temp_dir.Append(kSocketFilename).value(); } @@ -212,7 +212,7 @@ class UnixDomainSocketTestHelper : public testing::Test { return thread.Pass(); } - const FilePath file_path_; + const base::FilePath file_path_; const bool allow_user_; scoped_refptr<EventManager> event_manager_; scoped_ptr<TestListenSocketDelegate> socket_delegate_; diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc index 5c53e08..48cb202 100644 --- a/net/base/upload_data.cc +++ b/net/base/upload_data.cc @@ -22,7 +22,7 @@ void UploadData::AppendBytes(const char* bytes, int bytes_len) { } } -void UploadData::AppendFileRange(const FilePath& file_path, +void UploadData::AppendFileRange(const base::FilePath& file_path, uint64 offset, uint64 length, const base::Time& expected_modification_time) { DCHECK(!is_chunked_); diff --git a/net/base/upload_data_stream_unittest.cc b/net/base/upload_data_stream_unittest.cc index 49c8da8..76ff088 100644 --- a/net/base/upload_data_stream_unittest.cc +++ b/net/base/upload_data_stream_unittest.cc @@ -126,7 +126,7 @@ class UploadDataStreamTest : public PlatformTest { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } - void FileChangedHelper(const FilePath& file_path, + void FileChangedHelper(const base::FilePath& file_path, const base::Time& time, bool error_expected); @@ -162,7 +162,7 @@ TEST_F(UploadDataStreamTest, ConsumeAllBytes) { } TEST_F(UploadDataStreamTest, File) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -192,7 +192,7 @@ TEST_F(UploadDataStreamTest, File) { } TEST_F(UploadDataStreamTest, FileSmallerThanLength) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -306,7 +306,7 @@ TEST_F(UploadDataStreamTest, ReadErrorAsync) { } TEST_F(UploadDataStreamTest, FileAndBytes) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -506,7 +506,7 @@ TEST_F(UploadDataStreamTest, ReadAsync) { EXPECT_EQ(static_cast<int>(kTestDataSize*2), read_callback3.WaitForResult()); } -void UploadDataStreamTest::FileChangedHelper(const FilePath& file_path, +void UploadDataStreamTest::FileChangedHelper(const base::FilePath& file_path, const base::Time& time, bool error_expected) { // Don't use element_readers_ here, as this function is called twice, and @@ -526,7 +526,7 @@ void UploadDataStreamTest::FileChangedHelper(const FilePath& file_path, } TEST_F(UploadDataStreamTest, FileChanged) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -545,7 +545,7 @@ TEST_F(UploadDataStreamTest, FileChanged) { } TEST_F(UploadDataStreamTest, MultipleInit) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -586,7 +586,7 @@ TEST_F(UploadDataStreamTest, MultipleInit) { } TEST_F(UploadDataStreamTest, MultipleInitAsync) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -626,7 +626,7 @@ TEST_F(UploadDataStreamTest, MultipleInitAsync) { } TEST_F(UploadDataStreamTest, InitToReset) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -678,7 +678,7 @@ TEST_F(UploadDataStreamTest, InitToReset) { } TEST_F(UploadDataStreamTest, InitDuringAsyncInit) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), @@ -722,7 +722,7 @@ TEST_F(UploadDataStreamTest, InitDuringAsyncInit) { } TEST_F(UploadDataStreamTest, InitDuringAsyncRead) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file_path)); ASSERT_EQ(static_cast<int>(kTestDataSize), diff --git a/net/base/upload_element.h b/net/base/upload_element.h index 1e7a7fd..fceb747 100644 --- a/net/base/upload_element.h +++ b/net/base/upload_element.h @@ -29,7 +29,7 @@ class NET_EXPORT UploadElement { const char* bytes() const { return bytes_start_ ? bytes_start_ : &buf_[0]; } uint64 bytes_length() const { return buf_.size() + bytes_length_; } - const FilePath& file_path() const { return file_path_; } + const base::FilePath& file_path() const { return file_path_; } uint64 file_range_offset() const { return file_range_offset_; } uint64 file_range_length() const { return file_range_length_; } // If NULL time is returned, we do not do the check. @@ -51,14 +51,14 @@ class NET_EXPORT UploadElement { bytes_length_ = bytes_len; } - void SetToFilePath(const FilePath& path) { + void SetToFilePath(const base::FilePath& path) { SetToFilePathRange(path, 0, kuint64max, base::Time()); } // If expected_modification_time is NULL, we do not check for the file // change. Also note that the granularity for comparison is time_t, not // the full precision. - void SetToFilePathRange(const FilePath& path, + void SetToFilePathRange(const base::FilePath& path, uint64 offset, uint64 length, const base::Time& expected_modification_time) { type_ = TYPE_FILE; @@ -73,7 +73,7 @@ class NET_EXPORT UploadElement { std::vector<char> buf_; const char* bytes_start_; uint64 bytes_length_; - FilePath file_path_; + base::FilePath file_path_; uint64 file_range_offset_; uint64 file_range_length_; base::Time expected_file_modification_time_; diff --git a/net/base/upload_file_element_reader.cc b/net/base/upload_file_element_reader.cc index 0d2cff4..5bc3533 100644 --- a/net/base/upload_file_element_reader.cc +++ b/net/base/upload_file_element_reader.cc @@ -22,7 +22,7 @@ uint64 overriding_content_length = 0; // This function is used to implement Init(). template<typename FileStreamDeleter> -int InitInternal(const FilePath& path, +int InitInternal(const base::FilePath& path, uint64 range_offset, uint64 range_length, const base::Time& expected_modification_time, @@ -110,7 +110,7 @@ void UploadFileElementReader::FileStreamDeleter::operator() ( UploadFileElementReader::UploadFileElementReader( base::TaskRunner* task_runner, - const FilePath& path, + const base::FilePath& path, uint64 range_offset, uint64 range_length, const base::Time& expected_modification_time) @@ -240,7 +240,7 @@ UploadFileElementReader::ScopedOverridingContentLengthForTests:: } UploadFileElementReaderSync::UploadFileElementReaderSync( - const FilePath& path, + const base::FilePath& path, uint64 range_offset, uint64 range_length, const base::Time& expected_modification_time) diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h index ad16bb2..392cf7c 100644 --- a/net/base/upload_file_element_reader.h +++ b/net/base/upload_file_element_reader.h @@ -27,13 +27,13 @@ class NET_EXPORT UploadFileElementReader : public UploadElementReader { public: // |task_runner| is used to perform file operations. It must not be NULL. UploadFileElementReader(base::TaskRunner* task_runner, - const FilePath& path, + const base::FilePath& path, uint64 range_offset, uint64 range_length, const base::Time& expected_modification_time); virtual ~UploadFileElementReader(); - const FilePath& path() const { return path_; } + const base::FilePath& path() const { return path_; } uint64 range_offset() const { return range_offset_; } uint64 range_length() const { return range_length_; } const base::Time& expected_modification_time() const { @@ -94,7 +94,7 @@ class NET_EXPORT UploadFileElementReader : public UploadElementReader { }; scoped_refptr<base::TaskRunner> task_runner_; - const FilePath path_; + const base::FilePath path_; const uint64 range_offset_; const uint64 range_length_; const base::Time expected_modification_time_; @@ -111,7 +111,7 @@ class NET_EXPORT UploadFileElementReader : public UploadElementReader { // Use this class only if the thread is IO allowed. class NET_EXPORT UploadFileElementReaderSync : public UploadElementReader { public: - UploadFileElementReaderSync(const FilePath& path, + UploadFileElementReaderSync(const base::FilePath& path, uint64 range_offset, uint64 range_length, const base::Time& expected_modification_time); @@ -126,7 +126,7 @@ class NET_EXPORT UploadFileElementReaderSync : public UploadElementReader { const CompletionCallback& callback) OVERRIDE; private: - const FilePath path_; + const base::FilePath path_; const uint64 range_offset_; const uint64 range_length_; const base::Time expected_modification_time_; diff --git a/net/base/upload_file_element_reader_unittest.cc b/net/base/upload_file_element_reader_unittest.cc index 41e69fd..672ad54 100644 --- a/net/base/upload_file_element_reader_unittest.cc +++ b/net/base/upload_file_element_reader_unittest.cc @@ -44,7 +44,7 @@ class UploadFileElementReaderTest : public PlatformTest { std::vector<char> bytes_; scoped_ptr<UploadElementReader> reader_; base::ScopedTempDir temp_dir_; - FilePath temp_file_path_; + base::FilePath temp_file_path_; }; TEST_F(UploadFileElementReaderTest, ReadPartially) { @@ -196,7 +196,7 @@ TEST_F(UploadFileElementReaderTest, FileChanged) { } TEST_F(UploadFileElementReaderTest, WrongPath) { - const FilePath wrong_path(FILE_PATH_LITERAL("wrong_path")); + const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path")); reader_.reset(new UploadFileElementReader( base::MessageLoopProxy::current(), wrong_path, 0, kuint64max, base::Time())); @@ -234,7 +234,7 @@ class UploadFileElementReaderSyncTest : public PlatformTest { std::vector<char> bytes_; scoped_ptr<UploadElementReader> reader_; base::ScopedTempDir temp_dir_; - FilePath temp_file_path_; + base::FilePath temp_file_path_; }; TEST_F(UploadFileElementReaderSyncTest, ReadPartially) { @@ -327,7 +327,7 @@ TEST_F(UploadFileElementReaderSyncTest, FileChanged) { } TEST_F(UploadFileElementReaderSyncTest, WrongPath) { - const FilePath wrong_path(FILE_PATH_LITERAL("wrong_path")); + const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path")); reader_.reset(new UploadFileElementReaderSync( wrong_path, 0, kuint64max, base::Time())); ASSERT_EQ(OK, reader_->Init(CompletionCallback())); diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc index 5fc0bb3..a3d35fa 100644 --- a/net/base/x509_certificate_unittest.cc +++ b/net/base/x509_certificate_unittest.cc @@ -314,7 +314,7 @@ TEST(X509CertificateTest, ThawteCertParsing) { // one AVA per RDN, but some CAs place all AVAs within a single RDN. // This is a regression test for http://crbug.com/101009 TEST(X509CertificateTest, MultivalueRDN) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> multivalue_rdn_cert = ImportCertFromFile(certs_dir, "multivalue_rdn.pem"); @@ -338,7 +338,7 @@ TEST(X509CertificateTest, MultivalueRDN) { // such as '=' or '"', are not escaped when parsed as individual components. // This is a regression test for http://crbug.com/102839 TEST(X509CertificateTest, UnescapedSpecialCharacters) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> unescaped_cert = ImportCertFromFile(certs_dir, "unescaped.pem"); @@ -388,7 +388,7 @@ TEST(X509CertificateTest, SerialNumbers) { } TEST(X509CertificateTest, CAFingerprints) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "salesforce_com_test.pem"); @@ -442,7 +442,7 @@ TEST(X509CertificateTest, CAFingerprints) { } TEST(X509CertificateTest, ParseSubjectAltNames) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> san_cert = ImportCertFromFile(certs_dir, "subjectAltName_sanity_check.pem"); @@ -480,7 +480,7 @@ TEST(X509CertificateTest, ParseSubjectAltNames) { } TEST(X509CertificateTest, ExtractSPKIFromDERCert) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> cert = ImportCertFromFile(certs_dir, "nist.der"); ASSERT_NE(static_cast<X509Certificate*>(NULL), cert); @@ -500,7 +500,7 @@ TEST(X509CertificateTest, ExtractSPKIFromDERCert) { } TEST(X509CertificateTest, ExtractCRLURLsFromDERCert) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> cert = ImportCertFromFile(certs_dir, "nist.der"); ASSERT_NE(static_cast<X509Certificate*>(NULL), cert); @@ -682,7 +682,7 @@ TEST(X509CertificateTest, IntermediateCertificates) { } TEST(X509CertificateTest, IsIssuedByEncoded) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); // Test a client certificate from MIT. scoped_refptr<X509Certificate> mit_davidben_cert( @@ -724,7 +724,7 @@ TEST(X509CertificateTest, IsIssuedByEncoded) { } TEST(X509CertificateTest, IsIssuedByEncodedWithIntermediates) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert = ImportCertFromFile(certs_dir, "www_us_army_mil_cert.der"); @@ -921,7 +921,7 @@ class X509CertificateParseTest }; TEST_P(X509CertificateParseTest, CanParseFormat) { - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); CertificateList certs = CreateCertificateListFromFile( certs_dir, test_data_.file_name, test_data_.format); ASSERT_FALSE(certs.empty()); diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index e7fad5b..232b3f8 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -80,43 +80,45 @@ size_t GetIndexSize(int table_len) { // Returns a fully qualified name from path and name, using a given name prefix // and index number. For instance, if the arguments are "/foo", "bar" and 5, it // will return "/foo/old_bar_005". -FilePath GetPrefixedName(const FilePath& path, const std::string& name, - int index) { +base::FilePath GetPrefixedName(const base::FilePath& path, + const std::string& name, + int index) { std::string tmp = base::StringPrintf("%s%s_%03d", "old_", name.c_str(), index); return path.AppendASCII(tmp); } // This is a simple callback to cleanup old caches. -void CleanupCallback(const FilePath& path, const std::string& name) { +void CleanupCallback(const base::FilePath& path, const std::string& name) { for (int i = 0; i < kMaxOldFolders; i++) { - FilePath to_delete = GetPrefixedName(path, name, i); + base::FilePath to_delete = GetPrefixedName(path, name, i); disk_cache::DeleteCache(to_delete, true); } } // Returns a full path to rename the current cache, in order to delete it. path // is the current folder location, and name is the current folder name. -FilePath GetTempCacheName(const FilePath& path, const std::string& name) { +base::FilePath GetTempCacheName(const base::FilePath& path, + const std::string& name) { // We'll attempt to have up to kMaxOldFolders folders for deletion. for (int i = 0; i < kMaxOldFolders; i++) { - FilePath to_delete = GetPrefixedName(path, name, i); + base::FilePath to_delete = GetPrefixedName(path, name, i); if (!file_util::PathExists(to_delete)) return to_delete; } - return FilePath(); + return base::FilePath(); } // Moves the cache files to a new folder and creates a task to delete them. -bool DelayedCacheCleanup(const FilePath& full_path) { +bool DelayedCacheCleanup(const base::FilePath& full_path) { // GetTempCacheName() and MoveCache() use synchronous file // operations. base::ThreadRestrictions::ScopedAllowIO allow_io; - FilePath current_path = full_path.StripTrailingSeparators(); + base::FilePath current_path = full_path.StripTrailingSeparators(); - FilePath path = current_path.DirName(); - FilePath name = current_path.BaseName(); + base::FilePath path = current_path.DirName(); + base::FilePath name = current_path.BaseName(); #if defined(OS_POSIX) std::string name_str = name.value(); #elif defined(OS_WIN) @@ -124,7 +126,7 @@ bool DelayedCacheCleanup(const FilePath& full_path) { std::string name_str = WideToASCII(name.value()); #endif - FilePath to_delete = GetTempCacheName(path, name_str); + base::FilePath to_delete = GetTempCacheName(path, name_str); if (to_delete.empty()) { LOG(ERROR) << "Unable to get another cache folder"; return false; @@ -159,7 +161,7 @@ bool InitExperiment(disk_cache::IndexHeader* header) { // This class takes care of building an instance of the backend. class CacheCreator { public: - CacheCreator(const FilePath& path, bool force, int max_bytes, + CacheCreator(const base::FilePath& path, bool force, int max_bytes, net::CacheType type, uint32 flags, base::MessageLoopProxy* thread, net::NetLog* net_log, disk_cache::Backend** backend, @@ -187,7 +189,7 @@ class CacheCreator { // Callback implementation. void OnIOComplete(int result); - const FilePath& path_; + const base::FilePath& path_; bool force_; bool retry_; int max_bytes_; @@ -255,7 +257,8 @@ void FinalCleanupCallback(disk_cache::BackendImpl* backend) { namespace disk_cache { -int CreateCacheBackend(net::CacheType type, const FilePath& path, int max_bytes, +int CreateCacheBackend(net::CacheType type, const base::FilePath& path, + int max_bytes, bool force, base::MessageLoopProxy* thread, net::NetLog* net_log, Backend** backend, const net::CompletionCallback& callback) { @@ -301,7 +304,7 @@ int PreferedCacheSize(int64 available) { // ------------------------------------------------------------------------ -BackendImpl::BackendImpl(const FilePath& path, +BackendImpl::BackendImpl(const base::FilePath& path, base::MessageLoopProxy* cache_thread, net::NetLog* net_log) : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), @@ -326,7 +329,7 @@ BackendImpl::BackendImpl(const FilePath& path, ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { } -BackendImpl::BackendImpl(const FilePath& path, +BackendImpl::BackendImpl(const base::FilePath& path, uint32 mask, base::MessageLoopProxy* cache_thread, net::NetLog* net_log) @@ -385,7 +388,7 @@ BackendImpl::~BackendImpl() { // desired path) cannot be created. // // Static. -int BackendImpl::CreateBackend(const FilePath& full_path, bool force, +int BackendImpl::CreateBackend(const base::FilePath& full_path, bool force, int max_bytes, net::CacheType type, uint32 flags, base::MessageLoopProxy* thread, net::NetLog* net_log, Backend** backend, @@ -847,10 +850,10 @@ void BackendImpl::SetType(net::CacheType type) { cache_type_ = type; } -FilePath BackendImpl::GetFileName(Addr address) const { +base::FilePath BackendImpl::GetFileName(Addr address) const { if (!address.is_separate_file() || !address.is_initialized()) { NOTREACHED(); - return FilePath(); + return base::FilePath(); } std::string tmp = base::StringPrintf("f_%06x", address.FileNumber()); @@ -876,7 +879,7 @@ bool BackendImpl::CreateExternalFile(Addr* address) { file_number = 1; continue; } - FilePath name = GetFileName(file_address); + base::FilePath name = GetFileName(file_address); int flags = base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_CREATE | @@ -1462,7 +1465,7 @@ bool BackendImpl::InitBackingStore(bool* file_created) { if (!file_util::CreateDirectory(path_)) return false; - FilePath index_name = path_.AppendASCII(kIndexName); + base::FilePath index_name = path_.AppendASCII(kIndexName); int flags = base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index ad6f8ff..91faa83 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -42,16 +42,16 @@ enum BackendFlags { class NET_EXPORT_PRIVATE BackendImpl : public Backend { friend class Eviction; public: - BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread, + BackendImpl(const base::FilePath& path, base::MessageLoopProxy* cache_thread, net::NetLog* net_log); // mask can be used to limit the usable size of the hash table, for testing. - BackendImpl(const FilePath& path, uint32 mask, + BackendImpl(const base::FilePath& path, uint32 mask, base::MessageLoopProxy* cache_thread, net::NetLog* net_log); virtual ~BackendImpl(); // Returns a new backend with the desired flags. See the declaration of // CreateCacheBackend(). - static int CreateBackend(const FilePath& full_path, bool force, + static int CreateBackend(const base::FilePath& full_path, bool force, int max_bytes, net::CacheType type, uint32 flags, base::MessageLoopProxy* thread, net::NetLog* net_log, Backend** backend, @@ -94,7 +94,7 @@ class NET_EXPORT_PRIVATE BackendImpl : public Backend { void SetType(net::CacheType type); // Returns the full name for an external storage file. - FilePath GetFileName(Addr address) const; + base::FilePath GetFileName(Addr address) const; // Returns the actual file used to store a given (non-external) address. MappedFile* File(Addr address); @@ -357,7 +357,7 @@ class NET_EXPORT_PRIVATE BackendImpl : public Backend { InFlightBackendIO background_queue_; // The controller of pending operations. scoped_refptr<MappedFile> index_; // The main cache index. - FilePath path_; // Path to the folder used as backing storage. + base::FilePath path_; // Path to the folder used as backing storage. Index* data_; // Pointer to the index data. BlockFiles block_files_; // Set of files used to store all data. Rankings rankings_; // Rankings to be able to trim the cache. diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 2ec657e..65cd3837 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -230,8 +230,9 @@ TEST_F(DiskCacheTest, CreateBackend) { delete cache; cache = NULL; - rv = disk_cache::CreateCacheBackend(net::MEMORY_CACHE, FilePath(), 0, false, - NULL, NULL, &cache, cb.callback()); + rv = disk_cache::CreateCacheBackend(net::MEMORY_CACHE, base::FilePath(), 0, + false, NULL, NULL, &cache, + cb.callback()); ASSERT_EQ(net::OK, cb.GetResult(rv)); ASSERT_TRUE(cache); delete cache; @@ -243,7 +244,7 @@ TEST_F(DiskCacheTest, CreateBackend) { // Testst that re-creating the cache performs the expected cleanup. TEST_F(DiskCacheBackendTest, CreateBackend_MissingFile) { ASSERT_TRUE(CopyTestCache("bad_entry")); - FilePath filename = cache_path_.AppendASCII("data_1"); + base::FilePath filename = cache_path_.AppendASCII("data_1"); file_util::Delete(filename, false); DisableFirstCleanup(); SetForceCreation(); @@ -256,7 +257,7 @@ TEST_F(DiskCacheBackendTest, CreateBackend_MissingFile) { TEST_F(DiskCacheBackendTest, ExternalFiles) { InitCache(); // First, let's create a file on the folder. - FilePath filename = cache_path_.AppendASCII("f_000001"); + base::FilePath filename = cache_path_.AppendASCII("f_000001"); const int kSize = 50; scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize)); @@ -441,7 +442,7 @@ TEST_F(DiskCacheBackendTest, ShutdownWithPendingCreate_Fast) { TEST_F(DiskCacheTest, TruncatedIndex) { ASSERT_TRUE(CleanupCacheDir()); - FilePath index = cache_path_.AppendASCII("index"); + base::FilePath index = cache_path_.AppendASCII("index"); ASSERT_EQ(5, file_util::WriteFile(index, "hello", 5)); base::Thread cache_thread("CacheThread"); @@ -2520,7 +2521,7 @@ TEST_F(DiskCacheBackendTest, FileSharing) { disk_cache::Addr address(0x80000001); ASSERT_TRUE(cache_impl_->CreateExternalFile(&address)); - FilePath name = cache_impl_->GetFileName(address); + base::FilePath name = cache_impl_->GetFileName(address); scoped_refptr<disk_cache::File> file(new disk_cache::File(false)); file->Init(name); diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index 0f7b729..8cab6da 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -218,7 +218,7 @@ bool ValidateCounters(const disk_cache::BlockFileHeader* header) { namespace disk_cache { -BlockFiles::BlockFiles(const FilePath& path) +BlockFiles::BlockFiles(const base::FilePath& path) : init_(false), zero_buffer_(NULL), path_(path) { } @@ -403,7 +403,7 @@ bool BlockFiles::IsValid(Addr address) { } bool BlockFiles::CreateBlockFile(int index, FileType file_type, bool force) { - FilePath name = Name(index); + base::FilePath name = Name(index); int flags = force ? base::PLATFORM_FILE_CREATE_ALWAYS : base::PLATFORM_FILE_CREATE; flags |= base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_WRITE; @@ -428,7 +428,7 @@ bool BlockFiles::OpenBlockFile(int index) { block_files_.resize(block_files_.size() + to_add); } - FilePath name = Name(index); + base::FilePath name = Name(index); scoped_refptr<MappedFile> file(new MappedFile()); if (!file->Init(name, kBlockHeaderSize)) { @@ -585,7 +585,7 @@ bool BlockFiles::RemoveEmptyFile(FileType block_type) { // We get a new handle to the file and release the old one so that the // file gets unmmaped... so we can delete it. - FilePath name = Name(file_index); + base::FilePath name = Name(file_index); scoped_refptr<File> this_file(new File(false)); this_file->Init(name); block_files_[file_index]->Release(); @@ -677,7 +677,7 @@ void BlockFiles::GetFileStats(int index, int* used_count, int* load) { *load = *used_count * 100 / max_blocks; } -FilePath BlockFiles::Name(int index) { +base::FilePath BlockFiles::Name(int index) { // The file format allows for 256 files. DCHECK(index < 256 || index >= 0); std::string tmp = base::StringPrintf("%s%d", kBlockName, index); diff --git a/net/disk_cache/block_files.h b/net/disk_cache/block_files.h index 88db317..cb0cf6d 100644 --- a/net/disk_cache/block_files.h +++ b/net/disk_cache/block_files.h @@ -25,7 +25,7 @@ namespace disk_cache { // This class handles the set of block-files open by the disk cache. class NET_EXPORT_PRIVATE BlockFiles { public: - explicit BlockFiles(const FilePath& path); + explicit BlockFiles(const base::FilePath& path); ~BlockFiles(); // Performs the object initialization. create_files indicates if the backing @@ -83,11 +83,11 @@ class NET_EXPORT_PRIVATE BlockFiles { void GetFileStats(int index, int* used_count, int* load); // Returns the filename for a given file index. - FilePath Name(int index); + base::FilePath Name(int index); bool init_; char* zero_buffer_; // Buffer to speed-up cleaning deleted entries. - FilePath path_; // Path to the backing folder. + base::FilePath path_; // Path to the backing folder. std::vector<MappedFile*> block_files_; // The actual files. scoped_ptr<base::ThreadChecker> thread_checker_; diff --git a/net/disk_cache/block_files_unittest.cc b/net/disk_cache/block_files_unittest.cc index ebdae82..781c69b 100644 --- a/net/disk_cache/block_files_unittest.cc +++ b/net/disk_cache/block_files_unittest.cc @@ -14,10 +14,11 @@ using base::Time; namespace { // Returns the number of files in this folder. -int NumberOfFiles(const FilePath& path) { +int NumberOfFiles(const base::FilePath& path) { file_util::FileEnumerator iter(path, false, file_util::FileEnumerator::FILES); int count = 0; - for (FilePath file = iter.Next(); !file.value().empty(); file = iter.Next()) { + for (base::FilePath file = iter.Next(); !file.value().empty(); + file = iter.Next()) { count++; } return count; @@ -160,7 +161,7 @@ TEST_F(DiskCacheTest, BlockFiles_ZeroSizeFile) { BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); - FilePath filename = files.Name(0); + base::FilePath filename = files.Name(0); files.CloseFiles(); // Truncate one of the files. { @@ -183,7 +184,7 @@ TEST_F(DiskCacheTest, BlockFiles_TruncatedFile) { Addr address; EXPECT_TRUE(files.CreateBlock(RANKINGS, 2, &address)); - FilePath filename = files.Name(0); + base::FilePath filename = files.Name(0); files.CloseFiles(); // Truncate one of the files. { @@ -264,7 +265,7 @@ TEST_F(DiskCacheTest, BlockFiles_InvalidFile) { EXPECT_TRUE(NULL == files.GetFile(addr)); // Let's create an invalid file. - FilePath filename(files.Name(5)); + base::FilePath filename(files.Name(5)); char header[kBlockHeaderSize]; memset(header, 'a', kBlockHeaderSize); EXPECT_EQ(kBlockHeaderSize, diff --git a/net/disk_cache/cache_util_posix.cc b/net/disk_cache/cache_util_posix.cc index 9c2cf12..3cc9f3b 100644 --- a/net/disk_cache/cache_util_posix.cc +++ b/net/disk_cache/cache_util_posix.cc @@ -10,7 +10,7 @@ namespace disk_cache { -bool MoveCache(const FilePath& from_path, const FilePath& to_path) { +bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) { #if defined(OS_CHROMEOS) // For ChromeOS, we don't actually want to rename the cache // directory, because if we do, then it'll get recreated through the @@ -25,8 +25,9 @@ bool MoveCache(const FilePath& from_path, const FilePath& to_path) { file_util::FileEnumerator iter(from_path, false /* not recursive */, file_util::FileEnumerator::DIRECTORIES | file_util::FileEnumerator::FILES); - for (FilePath name = iter.Next(); !name.value().empty(); name = iter.Next()) { - FilePath destination = to_path.Append(name.BaseName()); + for (base::FilePath name = iter.Next(); !name.value().empty(); + name = iter.Next()) { + base::FilePath destination = to_path.Append(name.BaseName()); if (!file_util::Move(name, destination)) { LOG(ERROR) << "Unable to move cache item."; return false; @@ -38,11 +39,12 @@ bool MoveCache(const FilePath& from_path, const FilePath& to_path) { #endif } -void DeleteCache(const FilePath& path, bool remove_folder) { +void DeleteCache(const base::FilePath& path, bool remove_folder) { file_util::FileEnumerator iter(path, /* recursive */ false, file_util::FileEnumerator::FILES); - for (FilePath file = iter.Next(); !file.value().empty(); file = iter.Next()) { + for (base::FilePath file = iter.Next(); !file.value().empty(); + file = iter.Next()) { if (!file_util::Delete(file, /* recursive */ false)) { LOG(WARNING) << "Unable to delete cache."; return; @@ -57,7 +59,7 @@ void DeleteCache(const FilePath& path, bool remove_folder) { } } -bool DeleteCacheFile(const FilePath& name) { +bool DeleteCacheFile(const base::FilePath& name) { return file_util::Delete(name, false); } diff --git a/net/disk_cache/cache_util_unittest.cc b/net/disk_cache/cache_util_unittest.cc index 07f0ac0..4485204 100644 --- a/net/disk_cache/cache_util_unittest.cc +++ b/net/disk_cache/cache_util_unittest.cc @@ -16,9 +16,9 @@ class CacheUtilTest : public PlatformTest { PlatformTest::SetUp(); ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); cache_dir_ = tmp_dir_.path().Append(FILE_PATH_LITERAL("Cache")); - file1_ = FilePath(cache_dir_.Append(FILE_PATH_LITERAL("file01"))); - file2_ = FilePath(cache_dir_.Append(FILE_PATH_LITERAL(".file02"))); - dir1_ = FilePath(cache_dir_.Append(FILE_PATH_LITERAL("dir01"))); + file1_ = base::FilePath(cache_dir_.Append(FILE_PATH_LITERAL("file01"))); + file2_ = base::FilePath(cache_dir_.Append(FILE_PATH_LITERAL(".file02"))); + dir1_ = base::FilePath(cache_dir_.Append(FILE_PATH_LITERAL("dir01"))); ASSERT_TRUE(file_util::CreateDirectory(cache_dir_)); FILE *fp = file_util::OpenFile(file1_, "w"); ASSERT_TRUE(fp != NULL); @@ -28,21 +28,22 @@ class CacheUtilTest : public PlatformTest { file_util::CloseFile(fp); ASSERT_TRUE(file_util::CreateDirectory(dir1_)); dest_dir_ = tmp_dir_.path().Append(FILE_PATH_LITERAL("old_Cache_001")); - dest_file1_ = FilePath(dest_dir_.Append(FILE_PATH_LITERAL("file01"))); - dest_file2_ = FilePath(dest_dir_.Append(FILE_PATH_LITERAL(".file02"))); - dest_dir1_ = FilePath(dest_dir_.Append(FILE_PATH_LITERAL("dir01"))); + dest_file1_ = base::FilePath(dest_dir_.Append(FILE_PATH_LITERAL("file01"))); + dest_file2_ = + base::FilePath(dest_dir_.Append(FILE_PATH_LITERAL(".file02"))); + dest_dir1_ = base::FilePath(dest_dir_.Append(FILE_PATH_LITERAL("dir01"))); } protected: base::ScopedTempDir tmp_dir_; - FilePath cache_dir_; - FilePath file1_; - FilePath file2_; - FilePath dir1_; - FilePath dest_dir_; - FilePath dest_file1_; - FilePath dest_file2_; - FilePath dest_dir1_; + base::FilePath cache_dir_; + base::FilePath file1_; + base::FilePath file2_; + base::FilePath dir1_; + base::FilePath dest_dir_; + base::FilePath dest_file1_; + base::FilePath dest_file2_; + base::FilePath dest_dir1_; }; TEST_F(CacheUtilTest, MoveCache) { diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc index 6adc456..02f7365 100644 --- a/net/disk_cache/cache_util_win.cc +++ b/net/disk_cache/cache_util_win.cc @@ -14,8 +14,8 @@ namespace { // Deletes all the files on path that match search_name pattern. -void DeleteFiles(const FilePath& path, const wchar_t* search_name) { - FilePath name(path.Append(search_name)); +void DeleteFiles(const base::FilePath& path, const wchar_t* search_name) { + base::FilePath name(path.Append(search_name)); WIN32_FIND_DATA data; HANDLE handle = FindFirstFile(name.value().c_str(), &data); @@ -36,7 +36,7 @@ void DeleteFiles(const FilePath& path, const wchar_t* search_name) { namespace disk_cache { -bool MoveCache(const FilePath& from_path, const FilePath& to_path) { +bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) { // I don't want to use the shell version of move because if something goes // wrong, that version will attempt to move file by file and fail at the end. if (!MoveFileEx(from_path.value().c_str(), to_path.value().c_str(), 0)) { @@ -46,13 +46,13 @@ bool MoveCache(const FilePath& from_path, const FilePath& to_path) { return true; } -void DeleteCache(const FilePath& path, bool remove_folder) { +void DeleteCache(const base::FilePath& path, bool remove_folder) { DeleteFiles(path, L"*"); if (remove_folder) RemoveDirectory(path.value().c_str()); } -bool DeleteCacheFile(const FilePath& name) { +bool DeleteCacheFile(const base::FilePath& name) { // We do a simple delete, without ever falling back to SHFileOperation, as the // version from base does. if (!DeleteFile(name.value().c_str())) { diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc index 76470a0..296713d 100644 --- a/net/disk_cache/disk_cache_test_base.cc +++ b/net/disk_cache/disk_cache_test_base.cc @@ -24,7 +24,7 @@ DiskCacheTest::~DiskCacheTest() { } bool DiskCacheTest::CopyTestCache(const std::string& name) { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.AppendASCII("net"); path = path.AppendASCII("data"); diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h index c5442a4..8540af2 100644 --- a/net/disk_cache/disk_cache_test_base.h +++ b/net/disk_cache/disk_cache_test_base.h @@ -46,7 +46,7 @@ class DiskCacheTest : public PlatformTest { virtual void TearDown() OVERRIDE; - FilePath cache_path_; + base::FilePath cache_path_; private: base::ScopedTempDir temp_dir_; diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index dce005e..8307954 100644 --- a/net/disk_cache/disk_cache_test_util.cc +++ b/net/disk_cache/disk_cache_test_util.cc @@ -41,7 +41,7 @@ void CacheTestFillBuffer(char* buffer, size_t len, bool no_nulls) { buffer[0] = 'g'; } -bool CreateCacheTestFile(const FilePath& name) { +bool CreateCacheTestFile(const base::FilePath& name) { int flags = base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE; @@ -55,12 +55,13 @@ bool CreateCacheTestFile(const FilePath& name) { return true; } -bool DeleteCache(const FilePath& path) { +bool DeleteCache(const base::FilePath& path) { disk_cache::DeleteCache(path, false); return true; } -bool CheckCacheIntegrity(const FilePath& path, bool new_eviction, uint32 mask) { +bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction, + uint32 mask) { scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl( path, mask, base::MessageLoopProxy::current(), NULL)); if (!cache.get()) diff --git a/net/disk_cache/disk_cache_test_util.h b/net/disk_cache/disk_cache_test_util.h index 80c8a7e..2e8f8b4 100644 --- a/net/disk_cache/disk_cache_test_util.h +++ b/net/disk_cache/disk_cache_test_util.h @@ -14,10 +14,10 @@ #include "build/build_config.h" // Re-creates a given test file inside the cache test folder. -bool CreateCacheTestFile(const FilePath& name); +bool CreateCacheTestFile(const base::FilePath& name); // Deletes all file son the cache. -bool DeleteCache(const FilePath& path); +bool DeleteCache(const base::FilePath& path); // Fills buffer with random values (may contain nulls unless no_nulls is true). void CacheTestFillBuffer(char* buffer, size_t len, bool no_nulls); @@ -26,7 +26,8 @@ void CacheTestFillBuffer(char* buffer, size_t len, bool no_nulls); std::string GenerateKey(bool same_length); // Returns true if the cache is not corrupt. -bool CheckCacheIntegrity(const FilePath& path, bool new_eviction, uint32 mask); +bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction, + uint32 mask); // ----------------------------------------------------------------------- diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index 6438f2e..6e68034 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc @@ -1379,7 +1379,7 @@ TEST_F(DiskCacheEntryTest, MissingData) { FlushQueueForTest(); disk_cache::Addr address(0x80000001); - FilePath name = cache_impl_->GetFileName(address); + base::FilePath name = cache_impl_->GetFileName(address); EXPECT_TRUE(file_util::Delete(name, false)); // Attempt to read the data. diff --git a/net/disk_cache/file.h b/net/disk_cache/file.h index 3f17ea0..3038d88 100644 --- a/net/disk_cache/file.h +++ b/net/disk_cache/file.h @@ -43,7 +43,7 @@ class NET_EXPORT_PRIVATE File : public base::RefCounted<File> { // Initializes the object to point to a given file. The file must aready exist // on disk, and allow shared read and write. - bool Init(const FilePath& name); + bool Init(const base::FilePath& name); // Returns the handle or file descriptor. base::PlatformFile platform_file() const; diff --git a/net/disk_cache/file_posix.cc b/net/disk_cache/file_posix.cc index c334f28..0295c0d 100644 --- a/net/disk_cache/file_posix.cc +++ b/net/disk_cache/file_posix.cc @@ -175,7 +175,7 @@ File::File(base::PlatformFile file) sync_platform_file_(base::kInvalidPlatformFileValue) { } -bool File::Init(const FilePath& name) { +bool File::Init(const base::FilePath& name) { if (init_) return false; diff --git a/net/disk_cache/file_win.cc b/net/disk_cache/file_win.cc index 071b4ef..6679a0f 100644 --- a/net/disk_cache/file_win.cc +++ b/net/disk_cache/file_win.cc @@ -71,7 +71,7 @@ File::File(base::PlatformFile file) sync_platform_file_(file) { } -bool File::Init(const FilePath& name) { +bool File::Init(const base::FilePath& name) { DCHECK(!init_); if (init_) return false; diff --git a/net/disk_cache/flash/flash_cache_test_base.cc b/net/disk_cache/flash/flash_cache_test_base.cc index 368eb91..a5c7678 100644 --- a/net/disk_cache/flash/flash_cache_test_base.cc +++ b/net/disk_cache/flash/flash_cache_test_base.cc @@ -14,7 +14,7 @@ namespace { const int32 kSegmentCount = 10; -const FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache"); +const base::FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache"); } // namespace @@ -28,7 +28,7 @@ FlashCacheTest::~FlashCacheTest() { void FlashCacheTest::SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - const FilePath path(temp_dir_.path().Append(kCachePath)); + const base::FilePath path(temp_dir_.path().Append(kCachePath)); int32 storage_size = num_segments_in_storage_ * disk_cache::kFlashSegmentSize; storage_.reset(new disk_cache::Storage(path, storage_size)); diff --git a/net/disk_cache/flash/storage.cc b/net/disk_cache/flash/storage.cc index b6af0fe..c7136ef 100644 --- a/net/disk_cache/flash/storage.cc +++ b/net/disk_cache/flash/storage.cc @@ -13,7 +13,9 @@ namespace disk_cache { -Storage::Storage(const FilePath& path, int32 size) : path_(path), size_(size) { +Storage::Storage(const base::FilePath& path, + int32 size) + : path_(path), size_(size) { COMPILE_ASSERT(kFlashPageSize % 2 == 0, invalid_page_size); COMPILE_ASSERT(kFlashBlockSize % kFlashPageSize == 0, invalid_block_size); DCHECK(size_ % kFlashBlockSize == 0); diff --git a/net/disk_cache/flash/storage.h b/net/disk_cache/flash/storage.h index 756014f..38c4a4e 100644 --- a/net/disk_cache/flash/storage.h +++ b/net/disk_cache/flash/storage.h @@ -13,7 +13,7 @@ namespace disk_cache { class NET_EXPORT_PRIVATE Storage { public: - Storage(const FilePath& path, int32 size); + Storage(const base::FilePath& path, int32 size); bool Init(); ~Storage(); @@ -23,7 +23,7 @@ class NET_EXPORT_PRIVATE Storage { bool Write(const void* buffer, int32 size, int32 offset); private: - FilePath path_; + base::FilePath path_; int32 size_; base::PlatformFile file_; diff --git a/net/disk_cache/mapped_file_avoid_mmap_posix.cc b/net/disk_cache/mapped_file_avoid_mmap_posix.cc index 0fd6d2b..061d106 100644 --- a/net/disk_cache/mapped_file_avoid_mmap_posix.cc +++ b/net/disk_cache/mapped_file_avoid_mmap_posix.cc @@ -11,7 +11,7 @@ namespace disk_cache { -void* MappedFile::Init(const FilePath& name, size_t size) { +void* MappedFile::Init(const base::FilePath& name, size_t size) { DCHECK(!init_); if (init_ || !File::Init(name)) return NULL; diff --git a/net/disk_cache/mapped_file_posix.cc b/net/disk_cache/mapped_file_posix.cc index 2dfa7ae..cc5f23e 100644 --- a/net/disk_cache/mapped_file_posix.cc +++ b/net/disk_cache/mapped_file_posix.cc @@ -13,7 +13,7 @@ namespace disk_cache { -void* MappedFile::Init(const FilePath& name, size_t size) { +void* MappedFile::Init(const base::FilePath& name, size_t size) { DCHECK(!init_); if (init_ || !File::Init(name)) return NULL; diff --git a/net/disk_cache/mapped_file_unittest.cc b/net/disk_cache/mapped_file_unittest.cc index 297de33..06f8760 100644 --- a/net/disk_cache/mapped_file_unittest.cc +++ b/net/disk_cache/mapped_file_unittest.cc @@ -42,7 +42,7 @@ void FileCallbackTest::OnFileIOComplete(int bytes_copied) { } // namespace TEST_F(DiskCacheTest, MappedFile_SyncIO) { - FilePath filename = cache_path_.AppendASCII("a_test"); + base::FilePath filename = cache_path_.AppendASCII("a_test"); scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile); ASSERT_TRUE(CreateCacheTestFile(filename)); ASSERT_TRUE(file->Init(filename, 8192)); @@ -57,7 +57,7 @@ TEST_F(DiskCacheTest, MappedFile_SyncIO) { } TEST_F(DiskCacheTest, MappedFile_AsyncIO) { - FilePath filename = cache_path_.AppendASCII("a_test"); + base::FilePath filename = cache_path_.AppendASCII("a_test"); scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile); ASSERT_TRUE(CreateCacheTestFile(filename)); ASSERT_TRUE(file->Init(filename, 8192)); diff --git a/net/disk_cache/mapped_file_win.cc b/net/disk_cache/mapped_file_win.cc index f7575ef..7db2ba5 100644 --- a/net/disk_cache/mapped_file_win.cc +++ b/net/disk_cache/mapped_file_win.cc @@ -11,7 +11,7 @@ namespace disk_cache { -void* MappedFile::Init(const FilePath& name, size_t size) { +void* MappedFile::Init(const base::FilePath& name, size_t size) { DCHECK(!init_); if (init_ || !File::Init(name)) return NULL; diff --git a/net/disk_cache/storage_block_unittest.cc b/net/disk_cache/storage_block_unittest.cc index 1a3ec29..99232d4 100644 --- a/net/disk_cache/storage_block_unittest.cc +++ b/net/disk_cache/storage_block_unittest.cc @@ -10,7 +10,7 @@ #include "testing/gtest/include/gtest/gtest.h" TEST_F(DiskCacheTest, StorageBlock_LoadStore) { - FilePath filename = cache_path_.AppendASCII("a_test"); + base::FilePath filename = cache_path_.AppendASCII("a_test"); scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile); ASSERT_TRUE(CreateCacheTestFile(filename)); ASSERT_TRUE(file->Init(filename, 8192)); @@ -30,7 +30,7 @@ TEST_F(DiskCacheTest, StorageBlock_LoadStore) { } TEST_F(DiskCacheTest, StorageBlock_SetData) { - FilePath filename = cache_path_.AppendASCII("a_test"); + base::FilePath filename = cache_path_.AppendASCII("a_test"); scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile); ASSERT_TRUE(CreateCacheTestFile(filename)); ASSERT_TRUE(file->Init(filename, 8192)); @@ -50,7 +50,7 @@ TEST_F(DiskCacheTest, StorageBlock_SetData) { } TEST_F(DiskCacheTest, StorageBlock_SetModified) { - FilePath filename = cache_path_.AppendASCII("a_test"); + base::FilePath filename = cache_path_.AppendASCII("a_test"); scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile); ASSERT_TRUE(CreateCacheTestFile(filename)); ASSERT_TRUE(file->Init(filename, 8192)); diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc index cb63557..04d6f97 100644 --- a/net/disk_cache/stress_cache.cc +++ b/net/disk_cache/stress_cache.cc @@ -51,7 +51,7 @@ const int kExpectedCrash = 100; // Starts a new process. int RunSlave(int iteration) { - FilePath exe; + base::FilePath exe; PathService::Get(base::FILE_EXE, &exe); CommandLine cmdline(exe); @@ -102,7 +102,7 @@ void StressTheCache(int iteration) { int cache_size = 0x2000000; // 32MB. uint32 mask = 0xfff; // 4096 entries. - FilePath path; + base::FilePath path; PathService::Get(base::DIR_TEMP, &path); path = path.AppendASCII("cache_test_stress"); diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc index 051a81f..5d8aeb1 100644 --- a/net/dns/dns_config_service_posix.cc +++ b/net/dns/dns_config_service_posix.cc @@ -28,7 +28,8 @@ namespace internal { namespace { -const FilePath::CharType* kFilePathHosts = FILE_PATH_LITERAL("/etc/hosts"); +const base::FilePath::CharType* kFilePathHosts = + FILE_PATH_LITERAL("/etc/hosts"); #if defined(OS_MACOSX) // From 10.7.3 configd-395.10/dnsinfo/dnsinfo.h @@ -50,7 +51,7 @@ class ConfigWatcher { #define _PATH_RESCONF "/etc/resolv.conf" #endif -static const FilePath::CharType* kFilePathConfig = +static const base::FilePath::CharType* kFilePathConfig = FILE_PATH_LITERAL(_PATH_RESCONF); class ConfigWatcher { @@ -59,13 +60,13 @@ class ConfigWatcher { bool Watch(const CallbackType& callback) { callback_ = callback; - return watcher_.Watch(FilePath(kFilePathConfig), false, + return watcher_.Watch(base::FilePath(kFilePathConfig), false, base::Bind(&ConfigWatcher::OnCallback, base::Unretained(this))); } private: - void OnCallback(const FilePath& path, bool error) { + void OnCallback(const base::FilePath& path, bool error) { callback_.Run(!error); } @@ -120,7 +121,7 @@ class DnsConfigServicePosix::Watcher { LOG(ERROR) << "DNS config watch failed to start."; success = false; } - if (!hosts_watcher_.Watch(FilePath(kFilePathHosts), false, + if (!hosts_watcher_.Watch(base::FilePath(kFilePathHosts), false, base::Bind(&Watcher::OnHostsChanged, base::Unretained(this)))) { LOG(ERROR) << "DNS hosts watch failed to start."; @@ -130,7 +131,7 @@ class DnsConfigServicePosix::Watcher { } private: - void OnHostsChanged(const FilePath& path, bool error) { + void OnHostsChanged(const base::FilePath& path, bool error) { service_->OnHostsChanged(!error); } @@ -205,7 +206,7 @@ class DnsConfigServicePosix::HostsReader : public SerialWorker { } DnsConfigServicePosix* service_; - const FilePath path_; + const base::FilePath path_; const CallbackType callback_; // Written in DoWork, read in OnWorkFinished, no locking necessary. DnsHosts hosts_; diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc index b8fd8ce..7cdedc1 100644 --- a/net/dns/dns_config_service_win.cc +++ b/net/dns/dns_config_service_win.cc @@ -332,11 +332,12 @@ bool IsStatelessDiscoveryAddress(const IPAddressNumber& address) { } // namespace -FilePath GetHostsPath() { +base::FilePath GetHostsPath() { TCHAR buffer[MAX_PATH]; UINT rc = GetSystemDirectory(buffer, MAX_PATH); DCHECK(0 < rc && rc < MAX_PATH); - return FilePath(buffer).Append(FILE_PATH_LITERAL("drivers\\etc\\hosts")); + return base::FilePath(buffer).Append( + FILE_PATH_LITERAL("drivers\\etc\\hosts")); } bool ParseSearchList(const string16& value, std::vector<std::string>* output) { @@ -558,7 +559,7 @@ class DnsConfigServiceWin::Watcher } private: - void OnHostsChanged(const FilePath& path, bool error) { + void OnHostsChanged(const base::FilePath& path, bool error) { if (error) NetworkChangeNotifier::RemoveIPAddressObserver(this); service_->OnHostsChanged(!error); @@ -662,7 +663,7 @@ class DnsConfigServiceWin::HostsReader : public SerialWorker { } } - const FilePath path_; + const base::FilePath path_; DnsConfigServiceWin* service_; // Written in DoWork, read in OnWorkFinished, no locking necessary. DnsHosts hosts_; diff --git a/net/dns/dns_config_service_win.h b/net/dns/dns_config_service_win.h index e036e44..bd04aaf 100644 --- a/net/dns/dns_config_service_win.h +++ b/net/dns/dns_config_service_win.h @@ -45,7 +45,7 @@ const wchar_t* const kPolicyPath = L"SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient"; // Returns the path to the HOSTS file. -FilePath GetHostsPath(); +base::FilePath GetHostsPath(); // Parses |value| as search list (comma-delimited list of domain names) from // a registry key and stores it in |out|. Returns true on success. Empty diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc index 82f4243..01fb208 100644 --- a/net/dns/dns_hosts.cc +++ b/net/dns/dns_hosts.cc @@ -48,7 +48,7 @@ void ParseHosts(const std::string& contents, DnsHosts* dns_hosts) { } } -bool ParseHostsFile(const FilePath& path, DnsHosts* dns_hosts) { +bool ParseHostsFile(const base::FilePath& path, DnsHosts* dns_hosts) { dns_hosts->clear(); // Missing file indicates empty HOSTS. if (!file_util::PathExists(path)) diff --git a/net/dns/dns_hosts.h b/net/dns/dns_hosts.h index d6e6b47..4068c6c 100644 --- a/net/dns/dns_hosts.h +++ b/net/dns/dns_hosts.h @@ -36,7 +36,7 @@ void NET_EXPORT_PRIVATE ParseHosts(const std::string& contents, DnsHosts* dns_hosts); // As above but reads the file pointed to by |path|. -bool NET_EXPORT_PRIVATE ParseHostsFile(const FilePath& path, +bool NET_EXPORT_PRIVATE ParseHostsFile(const base::FilePath& path, DnsHosts* dns_hosts); diff --git a/net/ftp/ftp_directory_listing_parser_unittest.cc b/net/ftp/ftp_directory_listing_parser_unittest.cc index 069acd9..3644484c 100644 --- a/net/ftp/ftp_directory_listing_parser_unittest.cc +++ b/net/ftp/ftp_directory_listing_parser_unittest.cc @@ -24,7 +24,7 @@ class FtpDirectoryListingParserTest }; TEST_P(FtpDirectoryListingParserTest, Parse) { - FilePath test_dir; + base::FilePath test_dir; PathService::Get(base::DIR_SOURCE_ROOT, &test_dir); test_dir = test_dir.AppendASCII("net"); test_dir = test_dir.AppendASCII("data"); diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc index f79d1c8..2534322 100644 --- a/net/http/http_auth_gssapi_posix.cc +++ b/net/http/http_auth_gssapi_posix.cc @@ -445,7 +445,7 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLibrary() { for (size_t i = 0; i < num_lib_names; ++i) { const char* library_name = library_names[i]; - FilePath file_path(library_name); + base::FilePath file_path(library_name); // TODO(asanka): Move library loading to a separate thread. // http://crbug.com/66702 diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index d746119..f031121 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -41,7 +41,7 @@ namespace net { HttpCache::DefaultBackend::DefaultBackend(CacheType type, - const FilePath& path, + const base::FilePath& path, int max_bytes, base::MessageLoopProxy* thread) : type_(type), @@ -54,7 +54,7 @@ HttpCache::DefaultBackend::~DefaultBackend() {} // static HttpCache::BackendFactory* HttpCache::DefaultBackend::InMemory(int max_bytes) { - return new DefaultBackend(MEMORY_CACHE, FilePath(), max_bytes, NULL); + return new DefaultBackend(MEMORY_CACHE, base::FilePath(), max_bytes, NULL); } int HttpCache::DefaultBackend::CreateBackend( @@ -388,7 +388,7 @@ void HttpCache::OnExternalCacheHit(const GURL& url, disk_cache_->OnExternalCacheHit(key); } -void HttpCache::InitializeInfiniteCache(const FilePath& path) { +void HttpCache::InitializeInfiniteCache(const base::FilePath& path) { if (base::FieldTrialList::FindFullName("InfiniteCache") != "Yes") return; // To be enabled after everything is fully wired. diff --git a/net/http/http_cache.h b/net/http/http_cache.h index e1180a9..77edff4 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -99,7 +99,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // |path| is the destination for any files used by the backend, and // |cache_thread| is the thread where disk operations should take place. If // |max_bytes| is zero, a default value will be calculated automatically. - DefaultBackend(CacheType type, const FilePath& path, int max_bytes, + DefaultBackend(CacheType type, const base::FilePath& path, int max_bytes, base::MessageLoopProxy* thread); virtual ~DefaultBackend(); @@ -113,7 +113,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, private: CacheType type_; - const FilePath path_; + const base::FilePath path_; int max_bytes_; scoped_refptr<base::MessageLoopProxy> thread_; }; @@ -182,7 +182,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, void OnExternalCacheHit(const GURL& url, const std::string& http_method); // Initializes the Infinite Cache, if selected by the field trial. - void InitializeInfiniteCache(const FilePath& path); + void InitializeInfiniteCache(const base::FilePath& path); // Returns a pointer to the Infinite Cache. InfiniteCache* infinite_cache() { return &infinite_cache_; } diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc index 3172a92..02aa3d3 100644 --- a/net/http/http_network_transaction_spdy2_unittest.cc +++ b/net/http/http_network_transaction_spdy2_unittest.cc @@ -7451,7 +7451,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, LargeContentLengthThenClose) { } TEST_F(HttpNetworkTransactionSpdy2Test, UploadFileSmallerThanLength) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file_path)); const uint64 kFakeSize = 100000; // file is actually blank UploadFileElementReader::ScopedOverridingContentLengthForTests @@ -7504,7 +7504,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UploadFileSmallerThanLength) { } TEST_F(HttpNetworkTransactionSpdy2Test, UploadUnreadableFile) { - FilePath temp_file; + base::FilePath temp_file; ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file)); std::string temp_file_content("Unreadable file."); ASSERT_TRUE(file_util::WriteFile(temp_file, temp_file_content.c_str(), @@ -7561,7 +7561,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UploadUnreadableFile) { } TEST_F(HttpNetworkTransactionSpdy2Test, UnreadableUploadFileAfterAuthRestart) { - FilePath temp_file; + base::FilePath temp_file; ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file)); std::string temp_file_contents("Unreadable file."); std::string unreadable_contents(temp_file_contents.length(), '\0'); @@ -11101,7 +11101,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionIfCertDoesNotMatch) { // be valid for proxy because the MockSSLClientSocket does // not actually verify it. But SpdySession will use this // to see if it is valid for the new origin - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert( ImportCertFromFile(certs_dir, "ok_cert.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), server_cert); diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc index 7d9b2df..e576181 100644 --- a/net/http/http_network_transaction_spdy3_unittest.cc +++ b/net/http/http_network_transaction_spdy3_unittest.cc @@ -7432,7 +7432,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, LargeContentLengthThenClose) { } TEST_F(HttpNetworkTransactionSpdy3Test, UploadFileSmallerThanLength) { - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file_path)); const uint64 kFakeSize = 100000; // file is actually blank UploadFileElementReader::ScopedOverridingContentLengthForTests @@ -7485,7 +7485,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UploadFileSmallerThanLength) { } TEST_F(HttpNetworkTransactionSpdy3Test, UploadUnreadableFile) { - FilePath temp_file; + base::FilePath temp_file; ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file)); std::string temp_file_content("Unreadable file."); ASSERT_TRUE(file_util::WriteFile(temp_file, temp_file_content.c_str(), @@ -7542,7 +7542,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UploadUnreadableFile) { } TEST_F(HttpNetworkTransactionSpdy3Test, UnreadableUploadFileAfterAuthRestart) { - FilePath temp_file; + base::FilePath temp_file; ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file)); std::string temp_file_contents("Unreadable file."); std::string unreadable_contents(temp_file_contents.length(), '\0'); @@ -11044,7 +11044,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionIfCertDoesNotMatch) { // be valid for proxy because the MockSSLClientSocket does // not actually verify it. But SpdySession will use this // to see if it is valid for the new origin - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> server_cert( ImportCertFromFile(certs_dir, "ok_cert.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), server_cert); diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc index 191a8a8..45d172b 100644 --- a/net/http/http_stream_parser_unittest.cc +++ b/net/http/http_stream_parser_unittest.cc @@ -121,7 +121,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_FileBody) { // Create an empty temporary file. base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - FilePath temp_file_path; + base::FilePath temp_file_path; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &temp_file_path)); diff --git a/net/http/infinite_cache.cc b/net/http/infinite_cache.cc index b1010c6..cfbeed0 100644 --- a/net/http/infinite_cache.cc +++ b/net/http/infinite_cache.cc @@ -379,7 +379,7 @@ class InfiniteCache::Worker : public base::RefCountedThreadSafe<Worker> { Worker() : init_(false), flushed_(false) {} // Construction and destruction helpers. - void Init(const FilePath& path); + void Init(const base::FilePath& path); void Cleanup(); // Deletes all tracked data. @@ -462,12 +462,12 @@ class InfiniteCache::Worker : public base::RefCountedThreadSafe<Worker> { bool init_; bool flushed_; scoped_ptr<Header> header_; - FilePath path_; + base::FilePath path_; DISALLOW_COPY_AND_ASSIGN(Worker); }; -void InfiniteCache::Worker::Init(const FilePath& path) { +void InfiniteCache::Worker::Init(const base::FilePath& path) { path_ = path; LoadData(); UMA_HISTOGRAM_BOOLEAN("InfiniteCache.NewSession", true); @@ -620,7 +620,7 @@ void InfiniteCache::Worker::StoreData() { header_->header_hash = base::Hash( reinterpret_cast<char*>(header_.get()), offsetof(Header, header_hash)); - FilePath temp_file = path_.ReplaceExtension(FILE_PATH_LITERAL("tmp")); + base::FilePath temp_file = path_.ReplaceExtension(FILE_PATH_LITERAL("tmp")); PlatformFile file = base::CreatePlatformFile( temp_file, base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_WRITE, NULL, NULL); @@ -1104,7 +1104,7 @@ InfiniteCache::~InfiniteCache() { worker_ = NULL; } -void InfiniteCache::Init(const FilePath& path) { +void InfiniteCache::Init(const base::FilePath& path) { worker_pool_ = new base::SequencedWorkerPool(1, "Infinite cache thread"); task_runner_ = worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior( worker_pool_->GetSequenceToken(), diff --git a/net/http/infinite_cache_unittest.cc b/net/http/infinite_cache_unittest.cc index 2c10284..24d2ccc 100644 --- a/net/http/infinite_cache_unittest.cc +++ b/net/http/infinite_cache_unittest.cc @@ -71,7 +71,7 @@ void ProcessRequestWithTime(const MockTransaction& http_transaction, TEST(InfiniteCache, Basics) { InfiniteCache cache; - cache.Init(FilePath()); + cache.Init(base::FilePath()); scoped_ptr<InfiniteCacheTransaction> transaction (cache.CreateInfiniteCacheTransaction()); @@ -116,7 +116,7 @@ TEST(InfiniteCache, Basics) { TEST(InfiniteCache, Save_Restore) { base::ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); + base::FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); scoped_ptr<InfiniteCache> cache(new InfiniteCache); cache->Init(path); @@ -141,7 +141,7 @@ TEST(InfiniteCache, Save_Restore) { TEST(InfiniteCache, DoomMethod) { InfiniteCache cache; - cache.Init(FilePath()); + cache.Init(base::FilePath()); ProcessRequest(kTypicalGET_Transaction, &cache); ProcessRequest(kSimpleGET_Transaction, &cache); @@ -168,7 +168,7 @@ TEST(InfiniteCache, DoomMethod) { TEST(InfiniteCache, Delete) { base::ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); + base::FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); scoped_ptr<InfiniteCache> cache(new InfiniteCache); cache->Init(path); @@ -194,7 +194,7 @@ TEST(InfiniteCache, DeleteBetween) { #if !defined(OS_ANDROID) base::ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); + base::FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); scoped_ptr<InfiniteCache> cache(new InfiniteCache); cache->Init(path); @@ -252,7 +252,7 @@ TEST(InfiniteCache, DeleteBetween) { TEST(InfiniteCache, FillUp) { base::ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); + base::FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); scoped_ptr<InfiniteCache> cache(new InfiniteCache); cache->Init(path); diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc index 480f2f6..b7dbe7c 100644 --- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc +++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc @@ -272,7 +272,8 @@ TEST(DhcpProxyScriptAdapterFetcher, MockDhcpRealFetch) { TestServer test_server( TestServer::TYPE_HTTP, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("net/data/proxy_script_fetcher_unittest"))); + base::FilePath( + FILE_PATH_LITERAL("net/data/proxy_script_fetcher_unittest"))); ASSERT_TRUE(test_server.Start()); GURL configured_url = test_server.GetURL("files/downloadable.pac"); diff --git a/net/proxy/network_delegate_error_observer_unittest.cc b/net/proxy/network_delegate_error_observer_unittest.cc index 8b2b51c..b144f1e 100644 --- a/net/proxy/network_delegate_error_observer_unittest.cc +++ b/net/proxy/network_delegate_error_observer_unittest.cc @@ -73,7 +73,7 @@ class TestNetworkDelegate : public net::NetworkDelegate { return true; } virtual bool OnCanAccessFile(const net::URLRequest& request, - const FilePath& path) const OVERRIDE { + const base::FilePath& path) const OVERRIDE { return true; } virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE { diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index db4b738..4a91d51 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -824,7 +824,7 @@ bool SettingGetterImplGSettings::LoadAndCheckVersion( std::vector<std::string> paths; Tokenize(path, ":", &paths); for (size_t i = 0; i < paths.size(); ++i) { - FilePath file(paths[i]); + base::FilePath file(paths[i]); if (file_util::PathExists(file.Append("gnome-network-properties"))) { VLOG(1) << "Found gnome-network-properties. Will fall back to gconf."; return false; @@ -854,7 +854,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, std::string home; if (env_var_getter->GetVar("KDEHOME", &home) && !home.empty()) { // $KDEHOME is set. Use it unconditionally. - kde_config_dir_ = KDEHomeToConfigPath(FilePath(home)); + kde_config_dir_ = KDEHomeToConfigPath(base::FilePath(home)); } else { // $KDEHOME is unset. Try to figure out what to use. This seems to be // the common case on most distributions. @@ -864,7 +864,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, if (base::nix::GetDesktopEnvironment(env_var_getter) == base::nix::DESKTOP_ENVIRONMENT_KDE3) { // KDE3 always uses .kde for its configuration. - FilePath kde_path = FilePath(home).Append(".kde"); + base::FilePath kde_path = base::FilePath(home).Append(".kde"); kde_config_dir_ = KDEHomeToConfigPath(kde_path); } else { // Some distributions patch KDE4 to use .kde4 instead of .kde, so that @@ -877,10 +877,10 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, // settings (a gconf restriction). As noted below, the initial read of // the proxy settings will be done in this thread anyway, so we check // for .kde4 here in this thread as well. - FilePath kde3_path = FilePath(home).Append(".kde"); - FilePath kde3_config = KDEHomeToConfigPath(kde3_path); - FilePath kde4_path = FilePath(home).Append(".kde4"); - FilePath kde4_config = KDEHomeToConfigPath(kde4_path); + base::FilePath kde3_path = base::FilePath(home).Append(".kde"); + base::FilePath kde3_config = KDEHomeToConfigPath(kde3_path); + base::FilePath kde4_path = base::FilePath(home).Append(".kde4"); + base::FilePath kde4_config = KDEHomeToConfigPath(kde4_path); bool use_kde4 = false; if (file_util::DirectoryExists(kde4_path)) { base::PlatformFileInfo kde3_info; @@ -1028,7 +1028,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, reversed_bypass_list_ = false; } - FilePath KDEHomeToConfigPath(const FilePath& kde_home) { + base::FilePath KDEHomeToConfigPath(const base::FilePath& kde_home) { return kde_home.Append("share").Append("config"); } @@ -1166,7 +1166,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, // Reads kioslaverc one line at a time and calls AddKDESetting() to add // each relevant name-value pair to the appropriate value table. void UpdateCachedSettings() { - FilePath kioslaverc = kde_config_dir_.Append("kioslaverc"); + base::FilePath kioslaverc = kde_config_dir_.Append("kioslaverc"); file_util::ScopedFILE input(file_util::OpenFile(kioslaverc, "r")); if (!input.get()) return; @@ -1312,7 +1312,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, base::MessagePumpLibevent::FileDescriptorWatcher inotify_watcher_; ProxyConfigServiceLinux::Delegate* notify_delegate_; base::OneShotTimer<SettingGetterImplKDE> debounce_timer_; - FilePath kde_config_dir_; + base::FilePath kde_config_dir_; bool indirect_manual_; bool auto_no_pac_; bool reversed_bypass_list_; diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc index 7862141..f10aa78 100644 --- a/net/proxy/proxy_config_service_linux_unittest.cc +++ b/net/proxy/proxy_config_service_linux_unittest.cc @@ -357,7 +357,7 @@ class ProxyConfigServiceLinuxTest : public PlatformTest { std::string prefix("ProxyConfigServiceLinuxTest_user_home"); file_util::CreateNewTempDirectory(prefix, &user_home_); kde_home_ = user_home_.Append(FILE_PATH_LITERAL(".kde")); - FilePath path = kde_home_.Append(FILE_PATH_LITERAL("share")); + base::FilePath path = kde_home_.Append(FILE_PATH_LITERAL("share")); path = path.Append(FILE_PATH_LITERAL("config")); file_util::CreateDirectory(path); kioslaverc_ = path.Append(FILE_PATH_LITERAL("kioslaverc")); @@ -374,14 +374,14 @@ class ProxyConfigServiceLinuxTest : public PlatformTest { PlatformTest::TearDown(); } - FilePath user_home_; + base::FilePath user_home_; // KDE3 paths. - FilePath kde_home_; - FilePath kioslaverc_; + base::FilePath kde_home_; + base::FilePath kioslaverc_; // KDE4 paths. - FilePath kde4_home_; - FilePath kde4_config_; - FilePath kioslaverc4_; + base::FilePath kde4_home_; + base::FilePath kde4_config_; + base::FilePath kioslaverc4_; }; // Builds an identifier for each test in an array. diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc index baa305f..561efb51 100644 --- a/net/proxy/proxy_resolver_perftest.cc +++ b/net/proxy/proxy_resolver_perftest.cc @@ -88,7 +88,8 @@ class PacPerfSuiteRunner { test_server_( net::TestServer::TYPE_HTTP, net::TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("net/data/proxy_resolver_perftest"))) { + base::FilePath( + FILE_PATH_LITERAL("net/data/proxy_resolver_perftest"))) { } void RunAllTests() { @@ -153,7 +154,7 @@ class PacPerfSuiteRunner { // Read the PAC script from disk and initialize the proxy resolver with it. void LoadPacScriptIntoResolver(const std::string& script_name) { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.AppendASCII("net"); path = path.AppendASCII("data"); diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc index 954eeb1..9342d05 100644 --- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc +++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc @@ -40,7 +40,7 @@ class ProxyResolverV8TracingTest : public testing::Test { }; scoped_refptr<ProxyResolverScriptData> LoadScriptData(const char* filename) { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.AppendASCII("net"); path = path.AppendASCII("data"); diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc index 41683a2..eb8876c 100644 --- a/net/proxy/proxy_resolver_v8_unittest.cc +++ b/net/proxy/proxy_resolver_v8_unittest.cc @@ -100,7 +100,7 @@ class ProxyResolverV8WithMockBindings : public ProxyResolverV8 { // Initialize with the PAC script data at |filename|. int SetPacScriptFromDisk(const char* filename) { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.AppendASCII("net"); path = path.AppendASCII("data"); diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc index f7ca2b4..c9604f9 100644 --- a/net/proxy/proxy_script_fetcher_impl_unittest.cc +++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc @@ -36,7 +36,7 @@ namespace net { namespace { -const FilePath::CharType kDocRoot[] = +const base::FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("net/data/proxy_script_fetcher_unittest"); struct FetchResult { @@ -78,7 +78,7 @@ class RequestContext : public URLRequestContext { // Get a file:// url relative to net/data/proxy/proxy_script_fetcher_unittest. GURL GetTestFileUrl(const std::string& relpath) { - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.AppendASCII("net"); path = path.AppendASCII("data"); @@ -157,7 +157,7 @@ class BasicNetworkDelegate : public NetworkDelegate { } virtual bool OnCanAccessFile(const net::URLRequest& request, - const FilePath& path) const OVERRIDE { + const base::FilePath& path) const OVERRIDE { return true; } virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE { @@ -184,7 +184,7 @@ class ProxyScriptFetcherImplTest : public PlatformTest { ProxyScriptFetcherImplTest() : test_server_(TestServer::TYPE_HTTP, net::TestServer::kLocalhost, - FilePath(kDocRoot)) { + base::FilePath(kDocRoot)) { context_.set_network_delegate(&network_delegate_); } diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc index ab6b306..89356bfa 100644 --- a/net/socket/ssl_client_socket_unittest.cc +++ b/net/socket/ssl_client_socket_unittest.cc @@ -74,7 +74,7 @@ static bool LogContainsSSLConnectEndEvent( TEST_F(SSLClientSocketTest, Connect) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -117,7 +117,7 @@ TEST_F(SSLClientSocketTest, ConnectExpired) { net::TestServer::SSLOptions::CERT_EXPIRED); net::TestServer test_server(net::TestServer::TYPE_HTTPS, ssl_options, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); cert_verifier_->set_default_result(net::ERR_CERT_DATE_INVALID); @@ -164,7 +164,7 @@ TEST_F(SSLClientSocketTest, ConnectMismatched) { net::TestServer::SSLOptions::CERT_MISMATCHED_NAME); net::TestServer test_server(net::TestServer::TYPE_HTTPS, ssl_options, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); cert_verifier_->set_default_result(net::ERR_CERT_COMMON_NAME_INVALID); @@ -213,7 +213,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthCertRequested) { ssl_options.request_client_certificate = true; net::TestServer test_server(net::TestServer::TYPE_HTTPS, ssl_options, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -275,7 +275,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthSendNullCert) { ssl_options.request_client_certificate = true; net::TestServer test_server(net::TestServer::TYPE_HTTPS, ssl_options, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -335,7 +335,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthSendNullCert) { TEST_F(SSLClientSocketTest, Read) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -391,7 +391,7 @@ TEST_F(SSLClientSocketTest, Read) { TEST_F(SSLClientSocketTest, Read_FullDuplex) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -449,7 +449,7 @@ TEST_F(SSLClientSocketTest, Read_FullDuplex) { TEST_F(SSLClientSocketTest, Read_SmallChunks) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -502,7 +502,7 @@ TEST_F(SSLClientSocketTest, Read_SmallChunks) { TEST_F(SSLClientSocketTest, Read_Interrupted) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -552,7 +552,7 @@ TEST_F(SSLClientSocketTest, Read_Interrupted) { TEST_F(SSLClientSocketTest, Read_FullLogging) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -620,7 +620,7 @@ TEST_F(SSLClientSocketTest, Read_FullLogging) { TEST_F(SSLClientSocketTest, PrematureApplicationData) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -684,7 +684,7 @@ TEST_F(SSLClientSocketTest, CipherSuiteDisables) { net::TestServer::SSLOptions::BULK_CIPHER_RC4; net::TestServer test_server(net::TestServer::TYPE_HTTPS, ssl_options, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -755,7 +755,7 @@ TEST_F(SSLClientSocketTest, CipherSuiteDisables) { TEST_F(SSLClientSocketTest, ClientSocketHandleNotFromPool) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -789,7 +789,7 @@ TEST_F(SSLClientSocketTest, ClientSocketHandleNotFromPool) { TEST_F(SSLClientSocketTest, ExportKeyingMaterial) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, net::TestServer::kLocalhost, - FilePath()); + base::FilePath()); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -884,9 +884,9 @@ TEST_F(SSLClientSocketTest, VerifyReturnChainProperlyOrdered) { // Set up a test server with CERT_CHAIN_WRONG_ROOT. net::TestServer::SSLOptions ssl_options( net::TestServer::SSLOptions::CERT_CHAIN_WRONG_ROOT); - net::TestServer test_server(net::TestServer::TYPE_HTTPS, - ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + net::TestServer test_server( + net::TestServer::TYPE_HTTPS, ssl_options, + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); net::AddressList addr; @@ -947,7 +947,7 @@ class SSLClientSocketCertRequestInfoTest : public SSLClientSocketTest { net::TestServer::SSLOptions ssl_options) { net::TestServer test_server(net::TestServer::TYPE_HTTPS, ssl_options, - FilePath()); + base::FilePath()); if (!test_server.Start()) return NULL; @@ -985,7 +985,7 @@ class SSLClientSocketCertRequestInfoTest : public SSLClientSocketTest { // |client_authorities| in server SSLOptions. Current implementation of // RemoteTestServer (used on Android) expects relative paths, as opposed to // LocalTestServer, which expects absolute paths (what to fix?). - FilePath CertDirectory() { + base::FilePath CertDirectory() { #ifdef OS_ANDROID return net::GetTestCertsDirectoryRelative(); #else @@ -1004,7 +1004,7 @@ TEST_F(SSLClientSocketCertRequestInfoTest, NoAuthorities) { } TEST_F(SSLClientSocketCertRequestInfoTest, TwoAuthorities) { - const FilePath::CharType kThawteFile[] = + const base::FilePath::CharType kThawteFile[] = FILE_PATH_LITERAL("thawte.single.pem"); const unsigned char kThawteDN[] = { 0x30, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, @@ -1017,7 +1017,7 @@ TEST_F(SSLClientSocketCertRequestInfoTest, TwoAuthorities) { }; const size_t kThawteLen = sizeof(kThawteDN); - const FilePath::CharType kDiginotarFile[] = + const base::FilePath::CharType kDiginotarFile[] = FILE_PATH_LITERAL("diginotar_root_ca.pem"); const unsigned char kDiginotarDN[] = { 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc index 8d7adc1..b7a3dd8 100644 --- a/net/socket/ssl_server_socket_unittest.cc +++ b/net/socket/ssl_server_socket_unittest.cc @@ -311,16 +311,16 @@ class SSLServerSocketTest : public PlatformTest { FakeSocket* fake_client_socket = new FakeSocket(&channel_1_, &channel_2_); FakeSocket* fake_server_socket = new FakeSocket(&channel_2_, &channel_1_); - FilePath certs_dir(GetTestCertsDirectory()); + base::FilePath certs_dir(GetTestCertsDirectory()); - FilePath cert_path = certs_dir.AppendASCII("unittest.selfsigned.der"); + base::FilePath cert_path = certs_dir.AppendASCII("unittest.selfsigned.der"); std::string cert_der; ASSERT_TRUE(file_util::ReadFileToString(cert_path, &cert_der)); scoped_refptr<net::X509Certificate> cert = X509Certificate::CreateFromBytes(cert_der.data(), cert_der.size()); - FilePath key_path = certs_dir.AppendASCII("unittest.key.bin"); + base::FilePath key_path = certs_dir.AppendASCII("unittest.key.bin"); std::string key_string; ASSERT_TRUE(file_util::ReadFileToString(key_path, &key_string)); std::vector<uint8> key_vector( diff --git a/net/spdy/spdy_network_transaction_spdy2_unittest.cc b/net/spdy/spdy_network_transaction_spdy2_unittest.cc index 1f07cf8..b6568e2 100644 --- a/net/spdy/spdy_network_transaction_spdy2_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy2_unittest.cc @@ -383,7 +383,7 @@ class SpdyNetworkTransactionSpdy2Test const HttpRequestInfo& CreateFilePostRequest() { if (!google_post_request_initialized_) { - FilePath file_path; + base::FilePath file_path; CHECK(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &file_path)); CHECK_EQ(static_cast<int>(kUploadDataSize), file_util::WriteFile(file_path, kUploadData, kUploadDataSize)); @@ -408,7 +408,7 @@ class SpdyNetworkTransactionSpdy2Test const int kFileRangeLength = 3; CHECK_LT(kFileRangeOffset + kFileRangeLength, kUploadDataSize); - FilePath file_path; + base::FilePath file_path; CHECK(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &file_path)); CHECK_EQ(static_cast<int>(kUploadDataSize), file_util::WriteFile(file_path, kUploadData, kUploadDataSize)); diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc index f81876e..7761e6f 100644 --- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc @@ -384,7 +384,7 @@ class SpdyNetworkTransactionSpdy3Test const HttpRequestInfo& CreateFilePostRequest() { if (!google_post_request_initialized_) { - FilePath file_path; + base::FilePath file_path; CHECK(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &file_path)); CHECK_EQ(static_cast<int>(kUploadDataSize), file_util::WriteFile(file_path, kUploadData, kUploadDataSize)); @@ -409,7 +409,7 @@ class SpdyNetworkTransactionSpdy3Test const int kFileRangeLength = 3; CHECK_LT(kFileRangeOffset + kFileRangeLength, kUploadDataSize); - FilePath file_path; + base::FilePath file_path; CHECK(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &file_path)); CHECK_EQ(static_cast<int>(kUploadDataSize), file_util::WriteFile(file_path, kUploadData, kUploadDataSize)); diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc index 145229f..79c36a6 100644 --- a/net/spdy/spdy_session_spdy2_unittest.cc +++ b/net/spdy/spdy_session_spdy2_unittest.cc @@ -1246,7 +1246,7 @@ TEST_F(SpdySessionSpdy2Test, VerifyDomainAuthentication) { // www.example.org // mail.example.org // www.example.com - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "spdy_pooling.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); @@ -1314,7 +1314,7 @@ TEST_F(SpdySessionSpdy2Test, ConnectionPooledWithTlsChannelId) { // www.example.org // mail.example.org // www.example.com - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "spdy_pooling.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc index 293c655..0e52570 100644 --- a/net/spdy/spdy_session_spdy3_unittest.cc +++ b/net/spdy/spdy_session_spdy3_unittest.cc @@ -1258,7 +1258,7 @@ TEST_F(SpdySessionSpdy3Test, VerifyDomainAuthentication) { // www.example.org // mail.example.org // www.example.com - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "spdy_pooling.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); @@ -1326,7 +1326,7 @@ TEST_F(SpdySessionSpdy3Test, ConnectionPooledWithTlsChannelId) { // www.example.org // mail.example.org // www.example.com - FilePath certs_dir = GetTestCertsDirectory(); + base::FilePath certs_dir = GetTestCertsDirectory(); scoped_refptr<X509Certificate> test_cert( ImportCertFromFile(certs_dir, "spdy_pooling.pem")); ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); diff --git a/net/test/base_test_server.cc b/net/test/base_test_server.cc index 7cd2469..5babc9f 100644 --- a/net/test/base_test_server.cc +++ b/net/test/base_test_server.cc @@ -71,23 +71,23 @@ BaseTestServer::SSLOptions::SSLOptions( BaseTestServer::SSLOptions::~SSLOptions() {} -FilePath BaseTestServer::SSLOptions::GetCertificateFile() const { +base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const { switch (server_certificate) { case CERT_OK: case CERT_MISMATCHED_NAME: - return FilePath(FILE_PATH_LITERAL("ok_cert.pem")); + return base::FilePath(FILE_PATH_LITERAL("ok_cert.pem")); case CERT_EXPIRED: - return FilePath(FILE_PATH_LITERAL("expired_cert.pem")); + return base::FilePath(FILE_PATH_LITERAL("expired_cert.pem")); case CERT_CHAIN_WRONG_ROOT: // This chain uses its own dedicated test root certificate to avoid // side-effects that may affect testing. - return FilePath(FILE_PATH_LITERAL("redundant-server-chain.pem")); + return base::FilePath(FILE_PATH_LITERAL("redundant-server-chain.pem")); case CERT_AUTO: - return FilePath(); + return base::FilePath(); default: NOTREACHED(); } - return FilePath(); + return base::FilePath(); } std::string BaseTestServer::SSLOptions::GetOCSPArgument() const { @@ -247,8 +247,8 @@ void BaseTestServer::Init(const std::string& host) { log_to_console_ = true; } -void BaseTestServer::SetResourcePath(const FilePath& document_root, - const FilePath& certificates_dir) { +void BaseTestServer::SetResourcePath(const base::FilePath& document_root, + const base::FilePath& certificates_dir) { // This method shouldn't get called twice. DCHECK(certificates_dir_.empty()); document_root_ = document_root; @@ -287,9 +287,9 @@ bool BaseTestServer::LoadTestRootCert() const { return false; // Should always use absolute path to load the root certificate. - FilePath root_certificate_path = certificates_dir_; + base::FilePath root_certificate_path = certificates_dir_; if (!certificates_dir_.IsAbsolute()) { - FilePath src_dir; + base::FilePath src_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)) return false; root_certificate_path = src_dir.Append(certificates_dir_); @@ -335,8 +335,8 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const { if (UsingSSL(type_)) { // Check the certificate arguments of the HTTPS server. - FilePath certificate_path(certificates_dir_); - FilePath certificate_file(ssl_options_.GetCertificateFile()); + base::FilePath certificate_path(certificates_dir_); + base::FilePath certificate_file(ssl_options_.GetCertificateFile()); if (!certificate_file.value().empty()) { certificate_path = certificate_path.Append(certificate_file); if (certificate_path.IsAbsolute() && @@ -353,7 +353,7 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const { arguments->Set("ssl-client-auth", base::Value::CreateNullValue()); scoped_ptr<base::ListValue> ssl_client_certs(new base::ListValue()); - std::vector<FilePath>::const_iterator it; + std::vector<base::FilePath>::const_iterator it; for (it = ssl_options_.client_authorities.begin(); it != ssl_options_.client_authorities.end(); ++it) { if (it->IsAbsolute() && !file_util::PathExists(*it)) { diff --git a/net/test/base_test_server.h b/net/test/base_test_server.h index 973bfb1..de4fe1d 100644 --- a/net/test/base_test_server.h +++ b/net/test/base_test_server.h @@ -107,7 +107,7 @@ class BaseTestServer { // Returns the relative filename of the file that contains the // |server_certificate|. - FilePath GetCertificateFile() const; + base::FilePath GetCertificateFile() const; // GetOCSPArgument returns the value of any OCSP argument to testserver or // the empty string if there is none. @@ -128,7 +128,7 @@ class BaseTestServer { // each containing a single, PEM-encoded X.509 certificates. The subject // from each certificate will be added to the certificate_authorities // field of the CertificateRequest. - std::vector<FilePath> client_authorities; + std::vector<base::FilePath> client_authorities; // A bitwise-OR of BulkCipher that should be used by the // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented @@ -158,7 +158,7 @@ class BaseTestServer { // if the server is started. const HostPortPair& host_port_pair() const; - const FilePath& document_root() const { return document_root_; } + const base::FilePath& document_root() const { return document_root_; } const base::DictionaryValue& server_data() const; std::string GetScheme() const; bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT; @@ -200,8 +200,8 @@ class BaseTestServer { void CleanUpWhenStoppingServer(); // Set path of test resources. - void SetResourcePath(const FilePath& document_root, - const FilePath& certificates_dir); + void SetResourcePath(const base::FilePath& document_root, + const base::FilePath& certificates_dir); // Parses the server data read from the test server. Returns true // on success. @@ -225,10 +225,10 @@ class BaseTestServer { bool LoadTestRootCert() const WARN_UNUSED_RESULT; // Document root of the test server. - FilePath document_root_; + base::FilePath document_root_; // Directory that contains the SSL certificates. - FilePath certificates_dir_; + base::FilePath certificates_dir_; // Address the test server listens on. HostPortPair host_port_pair_; diff --git a/net/test/local_test_server.cc b/net/test/local_test_server.cc index a24d6bb..e2d334f 100644 --- a/net/test/local_test_server.cc +++ b/net/test/local_test_server.cc @@ -59,7 +59,7 @@ bool AppendArgumentFromJSONValue(const std::string& key, LocalTestServer::LocalTestServer(Type type, const std::string& host, - const FilePath& document_root) + const base::FilePath& document_root) : BaseTestServer(type, host) { if (!Init(document_root)) NOTREACHED(); @@ -67,7 +67,7 @@ LocalTestServer::LocalTestServer(Type type, LocalTestServer::LocalTestServer(Type type, const SSLOptions& ssl_options, - const FilePath& document_root) + const base::FilePath& document_root) : BaseTestServer(type, ssl_options) { if (!Init(document_root)) NOTREACHED(); @@ -77,8 +77,8 @@ LocalTestServer::~LocalTestServer() { Stop(); } -bool LocalTestServer::GetTestServerPath(FilePath* testserver_path) const { - FilePath testserver_dir; +bool LocalTestServer::GetTestServerPath(base::FilePath* testserver_path) const { + base::FilePath testserver_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_dir)) { LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT"; return false; @@ -96,7 +96,7 @@ bool LocalTestServer::Start() { bool LocalTestServer::StartInBackground() { // Get path to Python server script. - FilePath testserver_path; + base::FilePath testserver_path; if (!GetTestServerPath(&testserver_path)) return false; @@ -139,7 +139,7 @@ bool LocalTestServer::Stop() { return ret; } -bool LocalTestServer::Init(const FilePath& document_root) { +bool LocalTestServer::Init(const base::FilePath& document_root) { if (document_root.IsAbsolute()) return false; @@ -150,7 +150,7 @@ bool LocalTestServer::Init(const FilePath& document_root) { DCHECK(!GetPort()); process_handle_ = base::kNullProcessHandle; - FilePath src_dir; + base::FilePath src_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)) return false; SetResourcePath(src_dir.Append(document_root), @@ -162,7 +162,7 @@ bool LocalTestServer::Init(const FilePath& document_root) { } bool LocalTestServer::SetPythonPath() const { - FilePath third_party_dir; + base::FilePath third_party_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &third_party_dir)) { LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT"; return false; @@ -181,7 +181,7 @@ bool LocalTestServer::SetPythonPath() const { third_party_dir.AppendASCII("pywebsocket").AppendASCII("src")); // Locate the Python code generated by the protocol buffers compiler. - FilePath pyproto_dir; + base::FilePath pyproto_dir; if (!GetPyProtoPath(&pyproto_dir)) { LOG(WARNING) << "Cannot find pyproto dir for generated code. " << "Testserver features that rely on it will not work"; diff --git a/net/test/local_test_server.h b/net/test/local_test_server.h index 14b291d..fcc7ebf 100644 --- a/net/test/local_test_server.h +++ b/net/test/local_test_server.h @@ -27,13 +27,13 @@ class LocalTestServer : public BaseTestServer { // |document_root| must be a relative path under the root tree. LocalTestServer(Type type, const std::string& host, - const FilePath& document_root); + const base::FilePath& document_root); // Initialize a TestServer with a specific set of SSLOptions. // |document_root| must be a relative path under the root tree. LocalTestServer(Type type, const SSLOptions& ssl_options, - const FilePath& document_root); + const base::FilePath& document_root); virtual ~LocalTestServer(); @@ -66,9 +66,9 @@ class LocalTestServer : public BaseTestServer { // Modify PYTHONPATH to contain libraries we need. virtual bool SetPythonPath() const WARN_UNUSED_RESULT; - // Returns true if the FilePath for the testserver python script is + // Returns true if the base::FilePath for the testserver python script is // successfully stored in |*testserver_path|. - virtual bool GetTestServerPath(FilePath* testserver_path) const + virtual bool GetTestServerPath(base::FilePath* testserver_path) const WARN_UNUSED_RESULT; // Adds the command line arguments for the Python test server to @@ -78,13 +78,13 @@ class LocalTestServer : public BaseTestServer { // Returns the actual path of document root for test cases. This function // should be called by test cases to retrieve the actual document root path. - FilePath GetDocumentRoot() const { return document_root(); }; + base::FilePath GetDocumentRoot() const { return document_root(); }; private: - bool Init(const FilePath& document_root); + bool Init(const base::FilePath& document_root); // Launches the Python test server. Returns true on success. - bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; + bool LaunchPython(const base::FilePath& testserver_path) WARN_UNUSED_RESULT; // Waits for the server to start. Returns true on success. bool WaitToStart() WARN_UNUSED_RESULT; diff --git a/net/test/local_test_server_posix.cc b/net/test/local_test_server_posix.cc index 760a915..48af349 100644 --- a/net/test/local_test_server_posix.cc +++ b/net/test/local_test_server_posix.cc @@ -98,7 +98,7 @@ bool ReadData(int fd, ssize_t bytes_max, uint8* buffer, namespace net { -bool LocalTestServer::LaunchPython(const FilePath& testserver_path) { +bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { // Log is useful in the event you want to run a nearby script (e.g. a test) in // the same environment as the TestServer. VLOG(1) << "LaunchPython called with PYTHONPATH = " << getenv(kPythonPathEnv); diff --git a/net/test/local_test_server_win.cc b/net/test/local_test_server_win.cc index ba2a8cd..9562360 100644 --- a/net/test/local_test_server_win.cc +++ b/net/test/local_test_server_win.cc @@ -85,7 +85,7 @@ bool ReadData(HANDLE read_fd, HANDLE write_fd, namespace net { -bool LocalTestServer::LaunchPython(const FilePath& testserver_path) { +bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { CommandLine python_command(CommandLine::NO_PROGRAM); if (!GetPythonCommand(&python_command)) return false; diff --git a/net/test/python_utils.cc b/net/test/python_utils.cc index be9facf..349a360 100644 --- a/net/test/python_utils.cc +++ b/net/test/python_utils.cc @@ -16,7 +16,7 @@ const char kPythonPathEnv[] = "PYTHONPATH"; -void AppendToPythonPath(const FilePath& dir) { +void AppendToPythonPath(const base::FilePath& dir) { scoped_ptr<base::Environment> env(base::Environment::Create()); std::string old_path; std::string dir_path; @@ -44,12 +44,12 @@ namespace { // Search for |to_try|, rolling up the directory tree from // |start_dir|. If found, return true and put the path to |to_try| in // |out_dir|. If not, return false and leave |out_dir| untouched. -bool TryRelativeToDir(const FilePath& start_dir, - const FilePath& to_try, - FilePath* out_dir) { - FilePath dir(start_dir); +bool TryRelativeToDir(const base::FilePath& start_dir, + const base::FilePath& to_try, + base::FilePath* out_dir) { + base::FilePath dir(start_dir); while (!file_util::DirectoryExists(dir.Append(to_try))) { - FilePath parent = dir.DirName(); + base::FilePath parent = dir.DirName(); if (parent == dir) { // We hit the root directory. return false; @@ -62,18 +62,18 @@ bool TryRelativeToDir(const FilePath& start_dir, } // namespace -bool GetPyProtoPath(FilePath* dir) { +bool GetPyProtoPath(base::FilePath* dir) { // Locate the Python code generated by the protocol buffers compiler. - FilePath generated_code_dir; + base::FilePath generated_code_dir; if (!PathService::Get(base::DIR_EXE, &generated_code_dir)) { LOG(ERROR) << "Can't find " << generated_code_dir.value(); return false; } - const FilePath kPyProto(FILE_PATH_LITERAL("pyproto")); + const base::FilePath kPyProto(FILE_PATH_LITERAL("pyproto")); #if defined(OS_MACOSX) || defined(OS_CHROMEOS) - FilePath source_dir; + base::FilePath source_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &source_dir)) { LOG(ERROR) << "Can't find " << source_dir.value(); return false; @@ -106,7 +106,7 @@ bool GetPyProtoPath(FilePath* dir) { bool GetPythonCommand(CommandLine* python_cmd) { DCHECK(python_cmd); - FilePath dir; + base::FilePath dir; #if defined(OS_WIN) if (!PathService::Get(base::DIR_SOURCE_ROOT, &dir)) return false; @@ -114,7 +114,7 @@ bool GetPythonCommand(CommandLine* python_cmd) { .Append(FILE_PATH_LITERAL("python_26")) .Append(FILE_PATH_LITERAL("python.exe")); #elif defined(OS_POSIX) - dir = FilePath("python"); + dir = base::FilePath("python"); #endif python_cmd->SetProgram(dir); diff --git a/net/test/python_utils_unittest.cc b/net/test/python_utils_unittest.cc index f81a440..1c7a3c3 100644 --- a/net/test/python_utils_unittest.cc +++ b/net/test/python_utils_unittest.cc @@ -15,16 +15,16 @@ #include "testing/gtest/include/gtest/gtest.h" TEST(PythonUtils, Append) { - const FilePath::CharType kAppendDir1[] = + const base::FilePath::CharType kAppendDir1[] = FILE_PATH_LITERAL("test/path_append1"); - const FilePath::CharType kAppendDir2[] = + const base::FilePath::CharType kAppendDir2[] = FILE_PATH_LITERAL("test/path_append2"); scoped_ptr<base::Environment> env(base::Environment::Create()); std::string python_path; - FilePath append_path1(kAppendDir1); - FilePath append_path2(kAppendDir2); + base::FilePath append_path1(kAppendDir1); + base::FilePath append_path2(kAppendDir2); // Get a clean start env->UnSetVar(kPythonPathEnv); diff --git a/net/test/remote_test_server.cc b/net/test/remote_test_server.cc index 3421fa5..a4eab05 100644 --- a/net/test/remote_test_server.cc +++ b/net/test/remote_test_server.cc @@ -31,11 +31,11 @@ namespace { // to a single testing device. // The mapping between the test server spawner and the individual Python test // servers is written to a file on the device prior to executing any tests. -FilePath GetTestServerPortInfoFile() { +base::FilePath GetTestServerPortInfoFile() { #if !defined(OS_ANDROID) - return FilePath("/tmp/net-test-server-ports"); + return base::FilePath("/tmp/net-test-server-ports"); #else - FilePath test_data_dir; + base::FilePath test_data_dir; PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &test_data_dir); return test_data_dir.Append("net-test-server-ports"); #endif @@ -66,7 +66,7 @@ std::string GetServerTypeString(BaseTestServer::Type type) { RemoteTestServer::RemoteTestServer(Type type, const std::string& host, - const FilePath& document_root) + const base::FilePath& document_root) : BaseTestServer(type, host), spawner_server_port_(0) { if (!Init(document_root)) @@ -75,7 +75,7 @@ RemoteTestServer::RemoteTestServer(Type type, RemoteTestServer::RemoteTestServer(Type type, const SSLOptions& ssl_options, - const FilePath& document_root) + const base::FilePath& document_root) : BaseTestServer(type, ssl_options), spawner_server_port_(0) { if (!Init(document_root)) @@ -154,13 +154,13 @@ bool RemoteTestServer::Stop() { // root in the host machine where the test server is launched. So prepend // DIR_SOURCE_ROOT here to get the actual path of document root on the Android // device. -FilePath RemoteTestServer::GetDocumentRoot() const { - FilePath src_dir; +base::FilePath RemoteTestServer::GetDocumentRoot() const { + base::FilePath src_dir; PathService::Get(base::DIR_SOURCE_ROOT, &src_dir); return src_dir.Append(document_root()); } -bool RemoteTestServer::Init(const FilePath& document_root) { +bool RemoteTestServer::Init(const base::FilePath& document_root) { if (document_root.IsAbsolute()) return false; @@ -193,7 +193,7 @@ bool RemoteTestServer::Init(const FilePath& document_root) { return false; SetPort(test_server_port); - SetResourcePath(document_root, FilePath().AppendASCII("net") + SetResourcePath(document_root, base::FilePath().AppendASCII("net") .AppendASCII("data") .AppendASCII("ssl") .AppendASCII("certificates")); diff --git a/net/test/remote_test_server.h b/net/test/remote_test_server.h index 9c3fcfc..5d8e2b6 100644 --- a/net/test/remote_test_server.h +++ b/net/test/remote_test_server.h @@ -21,13 +21,13 @@ class RemoteTestServer : public BaseTestServer { // |document_root| must be a relative path under the root tree. RemoteTestServer(Type type, const std::string& host, - const FilePath& document_root); + const base::FilePath& document_root); // Initialize a TestServer with a specific set of SSLOptions. // |document_root| must be a relative path under the root tree. RemoteTestServer(Type type, const SSLOptions& ssl_options, - const FilePath& document_root); + const base::FilePath& document_root); virtual ~RemoteTestServer(); @@ -47,10 +47,10 @@ class RemoteTestServer : public BaseTestServer { // should be called by test cases to retrieve the actual document root path // on the Android device, otherwise document_root() function is used to get // the document root. - FilePath GetDocumentRoot() const; + base::FilePath GetDocumentRoot() const; private: - bool Init(const FilePath& document_root); + bool Init(const base::FilePath& document_root); // The local port used to communicate with the TestServer spawner. This is // used to control the startup and shutdown of the Python TestServer running diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc index d616446..39f9d10 100644 --- a/net/tools/crash_cache/crash_cache.cc +++ b/net/tools/crash_cache/crash_cache.cc @@ -42,7 +42,7 @@ using disk_cache::RankCrashes; // Starts a new process, to generate the files. int RunSlave(RankCrashes action) { - FilePath exe; + base::FilePath exe; PathService::Get(base::FILE_EXE, &exe); CommandLine cmdline(exe); @@ -86,8 +86,8 @@ NET_EXPORT_PRIVATE extern RankCrashes g_rankings_crash; const char* kCrashEntryName = "the first key"; // Creates the destinaton folder for this run, and returns it on full_path. -bool CreateTargetFolder(const FilePath& path, RankCrashes action, - FilePath* full_path) { +bool CreateTargetFolder(const base::FilePath& path, RankCrashes action, + base::FilePath* full_path) { const char* folders[] = { "", "insert_empty1", @@ -133,7 +133,7 @@ void FlushQueue(disk_cache::Backend* cache) { cb.GetResult(rv); // Ignore the result; } -bool CreateCache(const FilePath& path, +bool CreateCache(const base::FilePath& path, base::Thread* thread, disk_cache::Backend** cache, net::TestCompletionCallback* cb) { @@ -146,7 +146,7 @@ bool CreateCache(const FilePath& path, } // Generates the files for an empty and one item cache. -int SimpleInsert(const FilePath& path, RankCrashes action, +int SimpleInsert(const base::FilePath& path, RankCrashes action, base::Thread* cache_thread) { net::TestCompletionCallback cb; disk_cache::Backend* cache; @@ -180,7 +180,7 @@ int SimpleInsert(const FilePath& path, RankCrashes action, } // Generates the files for a one item cache, and removing the head. -int SimpleRemove(const FilePath& path, RankCrashes action, +int SimpleRemove(const base::FilePath& path, RankCrashes action, base::Thread* cache_thread) { DCHECK(action >= disk_cache::REMOVE_ONE_1); DCHECK(action <= disk_cache::REMOVE_TAIL_3); @@ -219,7 +219,7 @@ int SimpleRemove(const FilePath& path, RankCrashes action, return NOT_REACHED; } -int HeadRemove(const FilePath& path, RankCrashes action, +int HeadRemove(const base::FilePath& path, RankCrashes action, base::Thread* cache_thread) { DCHECK(action >= disk_cache::REMOVE_HEAD_1); DCHECK(action <= disk_cache::REMOVE_HEAD_4); @@ -256,7 +256,7 @@ int HeadRemove(const FilePath& path, RankCrashes action, } // Generates the files for insertion and removals on heavy loaded caches. -int LoadOperations(const FilePath& path, RankCrashes action, +int LoadOperations(const base::FilePath& path, RankCrashes action, base::Thread* cache_thread) { DCHECK(action >= disk_cache::INSERT_LOAD_1); @@ -315,10 +315,10 @@ int LoadOperations(const FilePath& path, RankCrashes action, } // Main function on the child process. -int SlaveCode(const FilePath& path, RankCrashes action) { +int SlaveCode(const base::FilePath& path, RankCrashes action) { MessageLoopForIO message_loop; - FilePath full_path; + base::FilePath full_path; if (!CreateTargetFolder(path, action, &full_path)) { printf("Destination folder found, please remove it.\n"); return CRASH_OVERWRITE; @@ -366,7 +366,7 @@ int main(int argc, const char* argv[]) { return INVALID_ARGUMENT; } - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.AppendASCII("net"); path = path.AppendASCII("data"); diff --git a/net/tools/crl_set_dump/crl_set_dump.cc b/net/tools/crl_set_dump/crl_set_dump.cc index 9ecf199..c13940c 100644 --- a/net/tools/crl_set_dump/crl_set_dump.cc +++ b/net/tools/crl_set_dump/crl_set_dump.cc @@ -26,16 +26,16 @@ static int Usage(const char* argv0) { int main(int argc, char** argv) { base::AtExitManager at_exit_manager; - FilePath crl_set_filename, delta_filename, output_filename; + base::FilePath crl_set_filename, delta_filename, output_filename; if (argc < 2 || argc > 4) return Usage(argv[0]); - crl_set_filename = FilePath::FromUTF8Unsafe(argv[1]); + crl_set_filename = base::FilePath::FromUTF8Unsafe(argv[1]); if (argc >= 3) - delta_filename = FilePath::FromUTF8Unsafe(argv[2]); + delta_filename = base::FilePath::FromUTF8Unsafe(argv[2]); if (argc >= 4) - output_filename = FilePath::FromUTF8Unsafe(argv[3]); + output_filename = base::FilePath::FromUTF8Unsafe(argv[3]); std::string crl_set_bytes, delta_bytes; if (!file_util::ReadFileToString(crl_set_filename, &crl_set_bytes)) diff --git a/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc b/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc index 9884ded..83e76e3 100644 --- a/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc +++ b/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc @@ -50,7 +50,7 @@ bool ReadTestCase(const char* filename, uint16* id, std::string* qname, uint16* qtype, std::vector<char>* resp_buf, bool* crash_test) { - FilePath filepath = FilePath::FromUTF8Unsafe(filename); + base::FilePath filepath = base::FilePath::FromUTF8Unsafe(filename); std::string json; if (!file_util::ReadFileToString(filepath, &json)) { diff --git a/net/tools/dump_cache/cache_dumper.cc b/net/tools/dump_cache/cache_dumper.cc index 7f2292b..3c71a92 100644 --- a/net/tools/dump_cache/cache_dumper.cc +++ b/net/tools/dump_cache/cache_dumper.cc @@ -40,7 +40,7 @@ void CacheDumper::CloseEntry(disk_cache::Entry* entry, base::Time last_used, // A version of CreateDirectory which supports lengthy filenames. // Returns true on success, false on failure. -bool SafeCreateDirectory(const FilePath& path) { +bool SafeCreateDirectory(const base::FilePath& path) { #ifdef WIN32_LARGE_FILENAME_SUPPORT // Due to large paths on windows, it can't simply do a // CreateDirectory("a/b/c"). Instead, create each subdirectory manually. @@ -56,7 +56,7 @@ bool SafeCreateDirectory(const FilePath& path) { // Create the subdirectories individually while ((pos = path.value().find(backslash, pos)) != std::wstring::npos) { - FilePath::StringType subdir = path.value().substr(0, pos); + base::FilePath::StringType subdir = path.value().substr(0, pos); CreateDirectoryW(subdir.c_str(), NULL); // we keep going even if directory creation failed. pos++; @@ -68,7 +68,7 @@ bool SafeCreateDirectory(const FilePath& path) { #endif } -DiskDumper::DiskDumper(const FilePath& path) +DiskDumper::DiskDumper(const base::FilePath& path) : path_(path), entry_(NULL) { file_util::CreateDirectory(path); } @@ -82,7 +82,7 @@ int DiskDumper::CreateEntry(const std::string& key, std::string base_path = path_.MaybeAsASCII(); std::string new_path = net::UrlToFilenameEncoder::Encode(url, base_path, false); - entry_path_ = FilePath::FromUTF8Unsafe(new_path); + entry_path_ = base::FilePath::FromUTF8Unsafe(new_path); #ifdef WIN32_LARGE_FILENAME_SUPPORT // In order for long filenames to work, we'll need to prepend @@ -92,14 +92,14 @@ int DiskDumper::CreateEntry(const std::string& key, // to convert to a wstring to do this. std::wstring name = kLongFilenamePrefix; name.append(entry_path_.value()); - entry_path_ = FilePath(name); + entry_path_ = base::FilePath(name); #endif entry_url_ = key; SafeCreateDirectory(entry_path_.DirName()); - FilePath::StringType file = entry_path_.value(); + base::FilePath::StringType file = entry_path_.value(); #ifdef WIN32_LARGE_FILENAME_SUPPORT entry_ = CreateFileW(file.c_str(), GENERIC_WRITE|GENERIC_READ, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); diff --git a/net/tools/dump_cache/cache_dumper.h b/net/tools/dump_cache/cache_dumper.h index daca8fe..261c2b2 100644 --- a/net/tools/dump_cache/cache_dumper.h +++ b/net/tools/dump_cache/cache_dumper.h @@ -63,7 +63,7 @@ class CacheDumper : public CacheDumpWriter { // Writes data to a disk. class DiskDumper : public CacheDumpWriter { public: - explicit DiskDumper(const FilePath& path); + explicit DiskDumper(const base::FilePath& path); virtual int CreateEntry(const std::string& key, disk_cache::Entry** entry, const net::CompletionCallback& callback) OVERRIDE; @@ -74,11 +74,11 @@ class DiskDumper : public CacheDumpWriter { base::Time last_modified) OVERRIDE; private: - FilePath path_; + base::FilePath path_; // This is a bit of a hack. As we get a CreateEntry, we coin the current // entry_path_ where we write that entry to disk. Subsequent calls to // WriteEntry() utilize this path for writing to disk. - FilePath entry_path_; + base::FilePath entry_path_; std::string entry_url_; #ifdef WIN32_LARGE_FILENAME_SUPPORT HANDLE entry_; diff --git a/net/tools/dump_cache/dump_cache.cc b/net/tools/dump_cache/dump_cache.cc index d68469b..f5194ac 100644 --- a/net/tools/dump_cache/dump_cache.cc +++ b/net/tools/dump_cache/dump_cache.cc @@ -80,7 +80,8 @@ int LaunchSlave(CommandLine command_line, bool do_convert_to_text = command_line.HasSwitch(kDumpToFiles); if (do_upgrade) { - FilePath program(base::StringPrintf(L"%ls%d", L"dump_cache", version)); + base::FilePath program( + base::StringPrintf(L"%ls%d", L"dump_cache", version)); command_line.SetProgram(program); } @@ -108,14 +109,14 @@ int main(int argc, const char* argv[]) { CommandLine::Init(argc, argv); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - FilePath input_path = command_line.GetSwitchValuePath(kInputPath); + base::FilePath input_path = command_line.GetSwitchValuePath(kInputPath); if (input_path.empty()) return Help(); bool dump_to_files = command_line.HasSwitch(kDumpToFiles); bool upgrade = command_line.HasSwitch(kUpgrade); - FilePath output_path = command_line.GetSwitchValuePath(kOutputPath); + base::FilePath output_path = command_line.GetSwitchValuePath(kOutputPath); if ((dump_to_files || upgrade) && output_path.empty()) return Help(); diff --git a/net/tools/dump_cache/dump_files.cc b/net/tools/dump_cache/dump_files.cc index f181e7a..b43ca04 100644 --- a/net/tools/dump_cache/dump_files.cc +++ b/net/tools/dump_cache/dump_files.cc @@ -26,10 +26,10 @@ namespace { -const FilePath::CharType kIndexName[] = FILE_PATH_LITERAL("index"); +const base::FilePath::CharType kIndexName[] = FILE_PATH_LITERAL("index"); // Reads the |header_size| bytes from the beginning of file |name|. -bool ReadHeader(const FilePath& name, char* header, int header_size) { +bool ReadHeader(const base::FilePath& name, char* header, int header_size) { net::FileStream file(NULL); file.OpenSync(name, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ); if (!file.IsOpen()) { @@ -45,7 +45,7 @@ bool ReadHeader(const FilePath& name, char* header, int header_size) { return true; } -int GetMajorVersionFromFile(const FilePath& name) { +int GetMajorVersionFromFile(const base::FilePath& name) { disk_cache::IndexHeader header; if (!ReadHeader(name, reinterpret_cast<char*>(&header), sizeof(header))) return 0; @@ -54,7 +54,7 @@ int GetMajorVersionFromFile(const FilePath& name) { } // Dumps the contents of the Stats record. -void DumpStats(const FilePath& path, disk_cache::CacheAddr addr) { +void DumpStats(const base::FilePath& path, disk_cache::CacheAddr addr) { // We need a message loop, although we really don't run any task. MessageLoop loop(MessageLoop::TYPE_IO); @@ -92,7 +92,8 @@ void DumpStats(const FilePath& path, disk_cache::CacheAddr addr) { } // Dumps the contents of the Index-file header. -void DumpIndexHeader(const FilePath& name, disk_cache::CacheAddr* stats_addr) { +void DumpIndexHeader(const base::FilePath& name, + disk_cache::CacheAddr* stats_addr) { disk_cache::IndexHeader header; if (!ReadHeader(name, reinterpret_cast<char*>(&header), sizeof(header))) return; @@ -122,7 +123,7 @@ void DumpIndexHeader(const FilePath& name, disk_cache::CacheAddr* stats_addr) { } // Dumps the contents of a block-file header. -void DumpBlockHeader(const FilePath& name) { +void DumpBlockHeader(const base::FilePath& name) { disk_cache::BlockFileHeader header; if (!ReadHeader(name, reinterpret_cast<char*>(&header), sizeof(header))) return; @@ -150,7 +151,7 @@ void DumpBlockHeader(const FilePath& name) { // Simple class that interacts with the set of cache files. class CacheDumper { public: - explicit CacheDumper(const FilePath& path) + explicit CacheDumper(const base::FilePath& path) : path_(path), block_files_(path), index_(NULL), @@ -170,7 +171,7 @@ class CacheDumper { disk_cache::RankingsNode* rankings); private: - FilePath path_; + base::FilePath path_; disk_cache::BlockFiles block_files_; scoped_refptr<disk_cache::MappedFile> index_file_; disk_cache::Index* index_; @@ -186,7 +187,7 @@ bool CacheDumper::Init() { return false; } - FilePath index_name(path_.Append(kIndexName)); + base::FilePath index_name(path_.Append(kIndexName)); index_file_ = new disk_cache::MappedFile; index_ = reinterpret_cast<disk_cache::Index*>( index_file_->Init(index_name, 0)); @@ -306,14 +307,14 @@ void DumpRankings(const disk_cache::RankingsNode& rankings) { // ----------------------------------------------------------------------- -int GetMajorVersion(const FilePath& input_path) { - FilePath index_name(input_path.Append(kIndexName)); +int GetMajorVersion(const base::FilePath& input_path) { + base::FilePath index_name(input_path.Append(kIndexName)); int version = GetMajorVersionFromFile(index_name); if (!version) return 0; - FilePath data_name(input_path.Append(FILE_PATH_LITERAL("data_0"))); + base::FilePath data_name(input_path.Append(FILE_PATH_LITERAL("data_0"))); if (version != GetMajorVersionFromFile(data_name)) return 0; @@ -333,15 +334,15 @@ int GetMajorVersion(const FilePath& input_path) { } // Dumps the headers of all files. -int DumpHeaders(const FilePath& input_path) { - FilePath index_name(input_path.Append(kIndexName)); +int DumpHeaders(const base::FilePath& input_path) { + base::FilePath index_name(input_path.Append(kIndexName)); disk_cache::CacheAddr stats_addr = 0; DumpIndexHeader(index_name, &stats_addr); file_util::FileEnumerator iter(input_path, false, file_util::FileEnumerator::FILES, FILE_PATH_LITERAL("data_*")); - for (FilePath file = iter.Next(); !file.empty(); file = iter.Next()) + for (base::FilePath file = iter.Next(); !file.empty(); file = iter.Next()) DumpBlockHeader(file); DumpStats(input_path, stats_addr); @@ -349,7 +350,7 @@ int DumpHeaders(const FilePath& input_path) { } // Dumps all entries from the cache. -int DumpContents(const FilePath& input_path) { +int DumpContents(const base::FilePath& input_path) { DumpHeaders(input_path); // We need a message loop, although we really don't run any task. diff --git a/net/tools/dump_cache/dump_files.h b/net/tools/dump_cache/dump_files.h index abc8b5b..a3a67a6 100644 --- a/net/tools/dump_cache/dump_files.h +++ b/net/tools/dump_cache/dump_files.h @@ -12,12 +12,12 @@ #include "base/file_path.h" // Returns the major version of the specified cache. -int GetMajorVersion(const FilePath& input_path); +int GetMajorVersion(const base::FilePath& input_path); // Dumps all entries from the cache. -int DumpContents(const FilePath& input_path); +int DumpContents(const base::FilePath& input_path); // Dumps the headers of all files. -int DumpHeaders(const FilePath& input_path); +int DumpHeaders(const base::FilePath& input_path); #endif // NET_TOOLS_DUMP_CACHE_DUMP_FILES_H_ diff --git a/net/tools/dump_cache/simple_cache_dumper.cc b/net/tools/dump_cache/simple_cache_dumper.cc index 73c3cd0..cb2bc47 100644 --- a/net/tools/dump_cache/simple_cache_dumper.cc +++ b/net/tools/dump_cache/simple_cache_dumper.cc @@ -18,7 +18,8 @@ namespace net { -SimpleCacheDumper::SimpleCacheDumper(FilePath input_path, FilePath output_path) +SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path, + base::FilePath output_path) : state_(STATE_NONE), input_path_(input_path), output_path_(output_path), diff --git a/net/tools/dump_cache/simple_cache_dumper.h b/net/tools/dump_cache/simple_cache_dumper.h index 4a76529..1b28629 100644 --- a/net/tools/dump_cache/simple_cache_dumper.h +++ b/net/tools/dump_cache/simple_cache_dumper.h @@ -26,7 +26,7 @@ class IOBufferWithSize; // response body, as if the HTTP response were written directly to disk. class SimpleCacheDumper { public: - SimpleCacheDumper(FilePath input_path, FilePath output_path); + SimpleCacheDumper(base::FilePath input_path, base::FilePath output_path); ~SimpleCacheDumper(); // Dumps the cache to disk. Returns OK if the operation was successful, @@ -74,8 +74,8 @@ class SimpleCacheDumper { void OnIOComplete(int rv); State state_; - FilePath input_path_; - FilePath output_path_; + base::FilePath input_path_; + base::FilePath output_path_; disk_cache::Backend* cache_; scoped_ptr<DiskDumper> writer_; base::Thread* cache_thread_; diff --git a/net/tools/dump_cache/upgrade_win.cc b/net/tools/dump_cache/upgrade_win.cc index c0e628a..be8a29c 100644 --- a/net/tools/dump_cache/upgrade_win.cc +++ b/net/tools/dump_cache/upgrade_win.cc @@ -214,7 +214,7 @@ bool BaseSM::IsPending() { class MasterSM : public BaseSM { public: - MasterSM(const FilePath& path, HANDLE channel) + MasterSM(const base::FilePath& path, HANDLE channel) : BaseSM(channel), path_(path) { } @@ -264,7 +264,7 @@ class MasterSM : public BaseSM { int read_size_; scoped_ptr<disk_cache::Backend> cache_; CacheDumpWriter* writer_; - const FilePath path_; + const base::FilePath path_; }; void MasterSM::OnIOCompleted(MessageLoopForIO::IOContext* context, @@ -552,7 +552,7 @@ void MasterSM::Fail() { class SlaveSM : public BaseSM { public: - SlaveSM(const FilePath& path, HANDLE channel); + SlaveSM(const base::FilePath& path, HANDLE channel); virtual ~SlaveSM(); bool DoInit(); @@ -585,7 +585,7 @@ class SlaveSM : public BaseSM { scoped_ptr<disk_cache::BackendImpl> cache_; }; -SlaveSM::SlaveSM(const FilePath& path, HANDLE channel) +SlaveSM::SlaveSM(const base::FilePath& path, HANDLE channel) : BaseSM(channel), iterator_(NULL) { disk_cache::Backend* cache; net::TestCompletionCallback cb; @@ -881,7 +881,7 @@ HANDLE CreateServer(string16* pipe_number) { } // This is the controller process for an upgrade operation. -int UpgradeCache(const FilePath& output_path, HANDLE pipe) { +int UpgradeCache(const base::FilePath& output_path, HANDLE pipe) { MessageLoop loop(MessageLoop::TYPE_IO); MasterSM master(output_path, pipe); @@ -895,7 +895,7 @@ int UpgradeCache(const FilePath& output_path, HANDLE pipe) { } // This process will only execute commands from the controller. -int RunSlave(const FilePath& input_path, const string16& pipe_number) { +int RunSlave(const base::FilePath& input_path, const string16& pipe_number) { MessageLoop loop(MessageLoop::TYPE_IO); base::win::ScopedHandle pipe(OpenServer(pipe_number)); diff --git a/net/tools/dump_cache/upgrade_win.h b/net/tools/dump_cache/upgrade_win.h index a2b1d72..79ea50e 100644 --- a/net/tools/dump_cache/upgrade_win.h +++ b/net/tools/dump_cache/upgrade_win.h @@ -13,7 +13,7 @@ HANDLE CreateServer(string16* pipe_number); // Runs a loop to write a new cache with all the data available from a slave // process connected through the provided |pipe|. -int UpgradeCache(const FilePath& output_path, HANDLE pipe); +int UpgradeCache(const base::FilePath& output_path, HANDLE pipe); // This process will only execute commands from the controller. -int RunSlave(const FilePath& input_path, const string16& pipe_number); +int RunSlave(const base::FilePath& input_path, const string16& pipe_number); diff --git a/net/tools/testserver/run_testserver.cc b/net/tools/testserver/run_testserver.cc index 4e4220a..85af4d5 100644 --- a/net/tools/testserver/run_testserver.cc +++ b/net/tools/testserver/run_testserver.cc @@ -89,7 +89,7 @@ int main(int argc, const char* argv[]) { } } - FilePath doc_root = command_line->GetSwitchValuePath("doc-root"); + base::FilePath doc_root = command_line->GetSwitchValuePath("doc-root"); if (doc_root.empty()) { printf("Error: --doc-root must be specified\n"); PrintUsage(); diff --git a/net/tools/tld_cleanup/tld_cleanup.cc b/net/tools/tld_cleanup/tld_cleanup.cc index 6774cc4..db66c4c 100644 --- a/net/tools/tld_cleanup/tld_cleanup.cc +++ b/net/tools/tld_cleanup/tld_cleanup.cc @@ -58,7 +58,7 @@ const char kEndPrivateDomainsComment[] = "// ===END PRIVATE DOMAINS==="; // Writes the list of domain rules contained in the 'rules' set to the // 'outfile', with each rule terminated by a LF. The file must already have // been created with write access. -bool WriteRules(const RuleMap& rules, const FilePath& outfile) { +bool WriteRules(const RuleMap& rules, const base::FilePath& outfile) { std::string data; data.append( "%{\n" @@ -166,8 +166,8 @@ NormalizeResult NormalizeRule(std::string* domain, Rule* rule) { // Loads the file described by 'in_filename', converts it to the desired format // (see the file comments above), and saves it into 'out_filename'. Returns // the most severe of the result codes encountered when normalizing the rules. -NormalizeResult NormalizeFile(const FilePath& in_filename, - const FilePath& out_filename) { +NormalizeResult NormalizeFile(const base::FilePath& in_filename, + const base::FilePath& out_filename) { std::string data; if (!file_util::ReadFileToString(in_filename, &data)) { LOG(ERROR) << "Unable to read file"; @@ -280,7 +280,7 @@ int main(int argc, const char* argv[]) { CommandLine::Init(argc, argv); - FilePath log_filename; + base::FilePath log_filename; PathService::Get(base::DIR_EXE, &log_filename); log_filename = log_filename.AppendASCII("tld_cleanup.log"); logging::InitLogging( @@ -292,14 +292,14 @@ int main(int argc, const char* argv[]) { icu_util::Initialize(); - FilePath input_file; + base::FilePath input_file; PathService::Get(base::DIR_SOURCE_ROOT, &input_file); input_file = input_file.Append(FILE_PATH_LITERAL("net")) .Append(FILE_PATH_LITERAL("base")) .Append(FILE_PATH_LITERAL( "registry_controlled_domains")) .Append(FILE_PATH_LITERAL("effective_tld_names.dat")); - FilePath output_file; + base::FilePath output_file; PathService::Get(base::DIR_SOURCE_ROOT, &output_file); output_file = output_file.Append(FILE_PATH_LITERAL("net")) .Append(FILE_PATH_LITERAL("base")) diff --git a/net/url_request/file_protocol_handler.cc b/net/url_request/file_protocol_handler.cc index 0f9f73c..13a772e 100644 --- a/net/url_request/file_protocol_handler.cc +++ b/net/url_request/file_protocol_handler.cc @@ -18,7 +18,7 @@ FileProtocolHandler::FileProtocolHandler() { } URLRequestJob* FileProtocolHandler::MaybeCreateJob( URLRequest* request, NetworkDelegate* network_delegate) const { - FilePath file_path; + base::FilePath file_path; const bool is_file = FileURLToFilePath(request->url(), &file_path); // Check file access permissions. diff --git a/net/url_request/test_url_fetcher_factory.cc b/net/url_request/test_url_fetcher_factory.cc index e645329..44f7d93 100644 --- a/net/url_request/test_url_fetcher_factory.cc +++ b/net/url_request/test_url_fetcher_factory.cc @@ -137,7 +137,7 @@ void TestURLFetcher::SetAutomaticallyRetryOnNetworkChanges(int max_retries) { } void TestURLFetcher::SaveResponseToFileAtPath( - const FilePath& file_path, + const base::FilePath& file_path, scoped_refptr<base::TaskRunner> file_task_runner) { } @@ -203,7 +203,7 @@ bool TestURLFetcher::GetResponseAsString( } bool TestURLFetcher::GetResponseAsFilePath( - bool take_ownership, FilePath* out_response_path) const { + bool take_ownership, base::FilePath* out_response_path) const { if (fake_response_destination_ != TEMP_FILE) return false; @@ -237,7 +237,7 @@ void TestURLFetcher::SetResponseString(const std::string& response) { fake_response_string_ = response; } -void TestURLFetcher::SetResponseFilePath(const FilePath& path) { +void TestURLFetcher::SetResponseFilePath(const base::FilePath& path) { fake_response_destination_ = TEMP_FILE; fake_response_file_path_ = path; } diff --git a/net/url_request/test_url_fetcher_factory.h b/net/url_request/test_url_fetcher_factory.h index d7f0d30..9fa42d8 100644 --- a/net/url_request/test_url_fetcher_factory.h +++ b/net/url_request/test_url_fetcher_factory.h @@ -114,7 +114,7 @@ class TestURLFetcher : public URLFetcher { virtual base::TimeDelta GetBackoffDelay() const OVERRIDE; virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) OVERRIDE; virtual void SaveResponseToFileAtPath( - const FilePath& file_path, + const base::FilePath& file_path, scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE; virtual void SaveResponseToTemporaryFile( scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE; @@ -138,7 +138,7 @@ class TestURLFetcher : public URLFetcher { virtual bool GetResponseAsString( std::string* out_response_string) const OVERRIDE; virtual bool GetResponseAsFilePath( - bool take_ownership, FilePath* out_response_path) const OVERRIDE; + bool take_ownership, base::FilePath* out_response_path) const OVERRIDE; // Sets owner of this class. Set it to a non-NULL value if you want // to automatically unregister this fetcher from the owning factory @@ -180,7 +180,7 @@ class TestURLFetcher : public URLFetcher { void SetResponseString(const std::string& response); // Set File data. - void SetResponseFilePath(const FilePath& path); + void SetResponseFilePath(const base::FilePath& path); private: enum ResponseDestinationType { @@ -209,7 +209,7 @@ class TestURLFetcher : public URLFetcher { ResponseCookies fake_cookies_; ResponseDestinationType fake_response_destination_; std::string fake_response_string_; - FilePath fake_response_file_path_; + base::FilePath fake_response_file_path_; bool fake_was_fetched_via_proxy_; scoped_refptr<HttpResponseHeaders> fake_response_headers_; HttpRequestHeaders fake_extra_request_headers_; diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc index c9933c7..bb3a19f 100644 --- a/net/url_request/url_fetcher_core.cc +++ b/net/url_request/url_fetcher_core.cc @@ -72,7 +72,7 @@ URLFetcherCore::FileWriter::~FileWriter() { } void URLFetcherCore::FileWriter::CreateFileAtPath( - const FilePath& file_path) { + const base::FilePath& file_path) { DCHECK(core_->network_task_runner_->BelongsToCurrentThread()); DCHECK(file_task_runner_.get()); base::FileUtilProxy::CreateOrOpen( @@ -203,7 +203,7 @@ void URLFetcherCore::FileWriter::DeleteFile( } void URLFetcherCore::FileWriter::DidCreateFile( - const FilePath& file_path, + const base::FilePath& file_path, base::PlatformFileError error_code, base::PassPlatformFile file_handle, bool created) { @@ -213,12 +213,12 @@ void URLFetcherCore::FileWriter::DidCreateFile( void URLFetcherCore::FileWriter::DidCreateTempFile( base::PlatformFileError error_code, base::PassPlatformFile file_handle, - const FilePath& file_path) { + const base::FilePath& file_path) { DidCreateFileInternal(file_path, error_code, file_handle); } void URLFetcherCore::FileWriter::DidCreateFileInternal( - const FilePath& file_path, + const base::FilePath& file_path, base::PlatformFileError error_code, base::PassPlatformFile file_handle) { DCHECK(core_->network_task_runner_->BelongsToCurrentThread()); @@ -456,7 +456,7 @@ void URLFetcherCore::SetAutomaticallyRetryOnNetworkChanges(int max_retries) { } void URLFetcherCore::SaveResponseToFileAtPath( - const FilePath& file_path, + const base::FilePath& file_path, scoped_refptr<base::TaskRunner> file_task_runner) { DCHECK(delegate_task_runner_->BelongsToCurrentThread()); file_task_runner_ = file_task_runner; @@ -542,7 +542,7 @@ bool URLFetcherCore::GetResponseAsString( } bool URLFetcherCore::GetResponseAsFilePath(bool take_ownership, - FilePath* out_response_path) { + base::FilePath* out_response_path) { DCHECK(delegate_task_runner_->BelongsToCurrentThread()); const bool destination_is_file = response_destination_ == URLFetcherCore::TEMP_FILE || diff --git a/net/url_request/url_fetcher_core.h b/net/url_request/url_fetcher_core.h index 346a929..ff8677c 100644 --- a/net/url_request/url_fetcher_core.h +++ b/net/url_request/url_fetcher_core.h @@ -93,7 +93,7 @@ class URLFetcherCore base::TimeDelta GetBackoffDelay() const; void SetAutomaticallyRetryOnNetworkChanges(int max_retries); void SaveResponseToFileAtPath( - const FilePath& file_path, + const base::FilePath& file_path, scoped_refptr<base::TaskRunner> file_task_runner); void SaveResponseToTemporaryFile( scoped_refptr<base::TaskRunner> file_task_runner); @@ -115,7 +115,7 @@ class URLFetcherCore void ReceivedContentWasMalformed(); bool GetResponseAsString(std::string* out_response_string) const; bool GetResponseAsFilePath(bool take_ownership, - FilePath* out_response_path); + base::FilePath* out_response_path); // Overridden from URLRequest::Delegate: virtual void OnReceivedRedirect(URLRequest* request, @@ -177,7 +177,7 @@ class URLFetcherCore scoped_refptr<base::TaskRunner> file_task_runner); ~FileWriter(); - void CreateFileAtPath(const FilePath& file_path); + void CreateFileAtPath(const base::FilePath& file_path); void CreateTempFile(); // Record |num_bytes_| response bytes in |core_->buffer_| to the file. @@ -197,22 +197,22 @@ class URLFetcherCore // Close the file if it is open and then delete it. void CloseAndDeleteFile(); - const FilePath& file_path() const { return file_path_; } + const base::FilePath& file_path() const { return file_path_; } int64 total_bytes_written() { return total_bytes_written_; } base::PlatformFileError error_code() const { return error_code_; } private: // Callback which gets the result of a permanent file creation. - void DidCreateFile(const FilePath& file_path, + void DidCreateFile(const base::FilePath& file_path, base::PlatformFileError error_code, base::PassPlatformFile file_handle, bool created); // Callback which gets the result of a temporary file creation. void DidCreateTempFile(base::PlatformFileError error_code, base::PassPlatformFile file_handle, - const FilePath& file_path); + const base::FilePath& file_path); // This method is used to implement DidCreateFile and DidCreateTempFile. - void DidCreateFileInternal(const FilePath& file_path, + void DidCreateFileInternal(const base::FilePath& file_path, base::PlatformFileError error_code, base::PassPlatformFile file_handle); @@ -237,7 +237,7 @@ class URLFetcherCore scoped_refptr<base::TaskRunner> file_task_runner_; // Path to the file. This path is empty when there is no file. - FilePath file_path_; + base::FilePath file_path_; // Handle to the file. base::PlatformFile file_handle_; @@ -370,7 +370,7 @@ class URLFetcherCore ResponseDestinationType response_destination_; // Path to the file where the response is written. - FilePath response_destination_file_path_; + base::FilePath response_destination_file_path_; // By default any server-initiated redirects are automatically followed. If // this flag is set to true, however, a redirect will halt the fetch and call diff --git a/net/url_request/url_fetcher_impl.cc b/net/url_request/url_fetcher_impl.cc index 5e4fbc3..9de7f89 100644 --- a/net/url_request/url_fetcher_impl.cc +++ b/net/url_request/url_fetcher_impl.cc @@ -114,7 +114,7 @@ void URLFetcherImpl::SetAutomaticallyRetryOnNetworkChanges(int max_retries) { } void URLFetcherImpl::SaveResponseToFileAtPath( - const FilePath& file_path, + const base::FilePath& file_path, scoped_refptr<base::TaskRunner> file_task_runner) { core_->SaveResponseToFileAtPath(file_path, file_task_runner); } @@ -176,7 +176,7 @@ bool URLFetcherImpl::GetResponseAsString( bool URLFetcherImpl::GetResponseAsFilePath( bool take_ownership, - FilePath* out_response_path) const { + base::FilePath* out_response_path) const { return core_->GetResponseAsFilePath(take_ownership, out_response_path); } diff --git a/net/url_request/url_fetcher_impl.h b/net/url_request/url_fetcher_impl.h index 72b944e..c8a8bce 100644 --- a/net/url_request/url_fetcher_impl.h +++ b/net/url_request/url_fetcher_impl.h @@ -66,7 +66,7 @@ class NET_EXPORT_PRIVATE URLFetcherImpl : public URLFetcher { virtual base::TimeDelta GetBackoffDelay() const OVERRIDE; virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) OVERRIDE; virtual void SaveResponseToFileAtPath( - const FilePath& file_path, + const base::FilePath& file_path, scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE; virtual void SaveResponseToTemporaryFile( scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE; @@ -86,7 +86,7 @@ class NET_EXPORT_PRIVATE URLFetcherImpl : public URLFetcher { std::string* out_response_string) const OVERRIDE; virtual bool GetResponseAsFilePath( bool take_ownership, - FilePath* out_response_path) const OVERRIDE; + base::FilePath* out_response_path) const OVERRIDE; static void CancelAll(); diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc index 0537ad1..d49d2c3 100644 --- a/net/url_request/url_fetcher_impl_unittest.cc +++ b/net/url_request/url_fetcher_impl_unittest.cc @@ -41,7 +41,8 @@ using base::TimeDelta; namespace { // TODO(akalin): Move all the test data to somewhere under net/. -const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); +const base::FilePath::CharType kDocRoot[] = + FILE_PATH_LITERAL("chrome/test/data"); const char kTestServerFilePrefix[] = "files/"; class ThrottlingTestURLRequestContext : public TestURLRequestContext { @@ -201,7 +202,7 @@ void URLFetcherMockDnsTest::SetUp() { test_server_.reset(new TestServer(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot))); + base::FilePath(kDocRoot))); ASSERT_TRUE(test_server_->Start()); // test_server_.GetURL() returns a URL with 127.0.0.1 (kLocalhost), that is @@ -251,7 +252,7 @@ class URLFetcherPostFileTest : public URLFetcherTest { virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; private: - FilePath path_; + base::FilePath path_; }; // Version of URLFetcherTest that does a POST instead with empty upload body @@ -389,7 +390,7 @@ class URLFetcherBadHTTPSTest : public URLFetcherTest { virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; private: - FilePath cert_dir_; + base::FilePath cert_dir_; }; // Version of URLFetcherTest that tests request cancellation on shutdown. @@ -485,15 +486,15 @@ class URLFetcherFileTest : public URLFetcherTest { URLFetcherFileTest() : take_ownership_of_file_(false), expected_file_error_(base::PLATFORM_FILE_OK) {} - void CreateFetcherForFile(const GURL& url, const FilePath& file_path); + void CreateFetcherForFile(const GURL& url, const base::FilePath& file_path); void CreateFetcherForTempFile(const GURL& url); // URLFetcherDelegate: virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; protected: - FilePath expected_file_; - FilePath file_path_; + base::FilePath expected_file_; + base::FilePath file_path_; // Set by the test. Used in OnURLFetchComplete() to decide if // the URLFetcher should own the temp file, so that we can test @@ -834,7 +835,7 @@ void URLFetcherMultipleAttemptTest::OnURLFetchComplete( } void URLFetcherFileTest::CreateFetcherForFile(const GURL& url, - const FilePath& file_path) { + const base::FilePath& file_path) { fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( io_message_loop_proxy(), request_context())); @@ -877,7 +878,7 @@ void URLFetcherFileTest::OnURLFetchComplete(const URLFetcher* source) { TEST_F(URLFetcherTest, SameThreadsTest) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Create the fetcher on the main thread. Since IO will happen on the main @@ -891,7 +892,7 @@ TEST_F(URLFetcherTest, SameThreadsTest) { TEST_F(URLFetcherTest, DifferentThreadsTest) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Create a separate thread that will create the URLFetcher. The current @@ -920,7 +921,7 @@ void CancelAllOnIO() { TEST_F(URLFetcherTest, CancelAll) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); EXPECT_EQ(0, GetNumFetcherCores()); @@ -1045,7 +1046,7 @@ TEST_F(URLFetcherMockDnsTest, RetryOnNetworkChangedAndSucceed) { TEST_F(URLFetcherPostTest, Basic) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); CreateFetcher(test_server.GetURL("echo")); @@ -1055,7 +1056,7 @@ TEST_F(URLFetcherPostTest, Basic) { TEST_F(URLFetcherPostFileTest, Basic) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); CreateFetcher(test_server.GetURL("echo")); @@ -1065,7 +1066,7 @@ TEST_F(URLFetcherPostFileTest, Basic) { TEST_F(URLFetcherEmptyPostTest, Basic) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); CreateFetcher(test_server.GetURL("echo")); @@ -1075,7 +1076,7 @@ TEST_F(URLFetcherEmptyPostTest, Basic) { TEST_F(URLFetcherUploadProgressTest, Basic) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); CreateFetcher(test_server.GetURL("echo")); @@ -1085,7 +1086,7 @@ TEST_F(URLFetcherUploadProgressTest, Basic) { TEST_F(URLFetcherDownloadProgressTest, Basic) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Get a file large enough to require more than one read into @@ -1106,7 +1107,7 @@ TEST_F(URLFetcherDownloadProgressTest, Basic) { TEST_F(URLFetcherDownloadProgressCancelTest, CancelWhileProgressReport) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Get a file large enough to require more than one read into @@ -1122,7 +1123,7 @@ TEST_F(URLFetcherHeadersTest, Headers) { TestServer test_server( TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); + base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); ASSERT_TRUE(test_server.Start()); CreateFetcher(test_server.GetURL("files/with-headers.html")); @@ -1134,7 +1135,7 @@ TEST_F(URLFetcherSocketAddressTest, SocketAddress) { TestServer test_server( TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); + base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); ASSERT_TRUE(test_server.Start()); expected_port_ = test_server.host_port_pair().port(); @@ -1147,7 +1148,7 @@ TEST_F(URLFetcherSocketAddressTest, SocketAddress) { TEST_F(URLFetcherStopOnRedirectTest, StopOnRedirect) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); CreateFetcher( @@ -1159,7 +1160,7 @@ TEST_F(URLFetcherStopOnRedirectTest, StopOnRedirect) { TEST_F(URLFetcherProtectTest, Overload) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); GURL url(test_server.GetURL("defaultresponse")); @@ -1180,7 +1181,7 @@ TEST_F(URLFetcherProtectTest, Overload) { TEST_F(URLFetcherProtectTest, ServerUnavailable) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); GURL url(test_server.GetURL("files/server-unavailable.html")); @@ -1203,7 +1204,7 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) { TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); GURL url(test_server.GetURL("files/server-unavailable.html")); @@ -1230,7 +1231,7 @@ TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) { TestServer::SSLOptions::CERT_EXPIRED); TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); CreateFetcher(test_server.GetURL("defaultresponse")); @@ -1240,7 +1241,7 @@ TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) { TEST_F(URLFetcherCancelTest, ReleasesContext) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); GURL url(test_server.GetURL("files/server-unavailable.html")); @@ -1263,7 +1264,7 @@ TEST_F(URLFetcherCancelTest, ReleasesContext) { TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); GURL url(test_server.GetURL("files/server-unavailable.html")); @@ -1295,7 +1296,7 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) { TEST_F(URLFetcherMultipleAttemptTest, SameData) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Create the fetcher on the main thread. Since IO will happen on the main @@ -1309,7 +1310,7 @@ TEST_F(URLFetcherMultipleAttemptTest, SameData) { TEST_F(URLFetcherFileTest, SmallGet) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); base::ScopedTempDir temp_dir; @@ -1331,7 +1332,7 @@ TEST_F(URLFetcherFileTest, SmallGet) { TEST_F(URLFetcherFileTest, LargeGet) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); base::ScopedTempDir temp_dir; @@ -1351,7 +1352,7 @@ TEST_F(URLFetcherFileTest, LargeGet) { TEST_F(URLFetcherFileTest, CanTakeOwnershipOfFile) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); base::ScopedTempDir temp_dir; @@ -1375,7 +1376,7 @@ TEST_F(URLFetcherFileTest, CanTakeOwnershipOfFile) { TEST_F(URLFetcherFileTest, OverwriteExistingFile) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); base::ScopedTempDir temp_dir; @@ -1402,7 +1403,7 @@ TEST_F(URLFetcherFileTest, OverwriteExistingFile) { TEST_F(URLFetcherFileTest, TryToOverwriteDirectory) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); base::ScopedTempDir temp_dir; @@ -1429,7 +1430,7 @@ TEST_F(URLFetcherFileTest, TryToOverwriteDirectory) { TEST_F(URLFetcherFileTest, SmallGetToTempFile) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Get a small file. @@ -1447,7 +1448,7 @@ TEST_F(URLFetcherFileTest, SmallGetToTempFile) { TEST_F(URLFetcherFileTest, LargeGetToTempFile) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Get a file large enough to require more than one read into @@ -1463,7 +1464,7 @@ TEST_F(URLFetcherFileTest, LargeGetToTempFile) { TEST_F(URLFetcherFileTest, CanTakeOwnershipOfTempFile) { TestServer test_server(TestServer::TYPE_HTTP, TestServer::kLocalhost, - FilePath(kDocRoot)); + base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); // Get a small file. diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc index f1cf1aa..28220ed 100644 --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc @@ -99,7 +99,7 @@ class BasicNetworkDelegate : public NetworkDelegate { } virtual bool OnCanAccessFile(const net::URLRequest& request, - const FilePath& path) const OVERRIDE { + const base::FilePath& path) const OVERRIDE { return true; } diff --git a/net/url_request/url_request_context_builder_unittest.cc b/net/url_request/url_request_context_builder_unittest.cc index bc93416..af53c87 100644 --- a/net/url_request/url_request_context_builder_unittest.cc +++ b/net/url_request/url_request_context_builder_unittest.cc @@ -25,21 +25,21 @@ namespace { // http://crbug.com/114369 class LocalHttpTestServer : public TestServer { public: - explicit LocalHttpTestServer(const FilePath& document_root) + explicit LocalHttpTestServer(const base::FilePath& document_root) : TestServer(TestServer::TYPE_HTTP, ScopedCustomUrlRequestTestHttpHost::value(), document_root) {} LocalHttpTestServer() : TestServer(TestServer::TYPE_HTTP, ScopedCustomUrlRequestTestHttpHost::value(), - FilePath()) {} + base::FilePath()) {} }; class URLRequestContextBuilderTest : public PlatformTest { protected: URLRequestContextBuilderTest() : test_server_( - FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))) { + base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))) { #if defined(OS_LINUX) || defined(OS_ANDROID) builder_.set_proxy_config_service( new ProxyConfigServiceFixed(ProxyConfig::CreateDirect())); diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc index 445c1eb..2285317 100644 --- a/net/url_request/url_request_file_dir_job.cc +++ b/net/url_request/url_request_file_dir_job.cc @@ -24,7 +24,7 @@ namespace net { URLRequestFileDirJob::URLRequestFileDirJob(URLRequest* request, NetworkDelegate* network_delegate, - const FilePath& dir_path) + const base::FilePath& dir_path) : URLRequestJob(request, network_delegate), ALLOW_THIS_IN_INITIALIZER_LIST(lister_(dir_path, this)), dir_path_(dir_path), diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h index bc6cccb..630c2d4 100644 --- a/net/url_request/url_request_file_dir_job.h +++ b/net/url_request/url_request_file_dir_job.h @@ -21,7 +21,7 @@ class URLRequestFileDirJob public: URLRequestFileDirJob(URLRequest* request, NetworkDelegate* network_delegate, - const FilePath& dir_path); + const base::FilePath& dir_path); bool list_complete() const { return list_complete_; } @@ -55,7 +55,7 @@ class URLRequestFileDirJob bool FillReadBuffer(char *buf, int buf_size, int *bytes_read); DirectoryLister lister_; - FilePath dir_path_; + base::FilePath dir_path_; std::string data_; bool canceled_; diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc index 0c703e1..6b2798b 100644 --- a/net/url_request/url_request_file_job.cc +++ b/net/url_request/url_request_file_job.cc @@ -54,7 +54,7 @@ URLRequestFileJob::FileMetaInfo::FileMetaInfo() URLRequestFileJob::URLRequestFileJob(URLRequest* request, NetworkDelegate* network_delegate, - const FilePath& file_path) + const base::FilePath& file_path) : URLRequestJob(request, network_delegate), file_path_(file_path), stream_(new FileStream(NULL)), @@ -66,7 +66,7 @@ URLRequestFileJob::URLRequestFileJob(URLRequest* request, URLRequestJob* URLRequestFileJob::Factory(URLRequest* request, NetworkDelegate* network_delegate, const std::string& scheme) { - FilePath file_path; + base::FilePath file_path; const bool is_file = FileURLToFilePath(request->url(), &file_path); // Check file access permissions. @@ -166,7 +166,7 @@ bool URLRequestFileJob::IsRedirectResponse(GURL* location, if (!LowerCaseEqualsASCII(file_path_.Extension(), ".lnk")) return false; - FilePath new_path = file_path_; + base::FilePath new_path = file_path_; bool resolved; resolved = base::win::ResolveShortcut(new_path, &new_path, NULL); @@ -221,7 +221,7 @@ void URLRequestFileJob::SetExtraRequestHeaders( URLRequestFileJob::~URLRequestFileJob() { } -void URLRequestFileJob::FetchMetaInfo(const FilePath& file_path, +void URLRequestFileJob::FetchMetaInfo(const base::FilePath& file_path, FileMetaInfo* meta_info) { base::PlatformFileInfo platform_info; meta_info->file_exists = file_util::GetFileInfo(file_path, &platform_info); diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h index 9c2199c..2343711 100644 --- a/net/url_request/url_request_file_job.h +++ b/net/url_request/url_request_file_job.h @@ -31,7 +31,7 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob { public: URLRequestFileJob(URLRequest* request, NetworkDelegate* network_delegate, - const FilePath& file_path); + const base::FilePath& file_path); static URLRequest::ProtocolFactory Factory; @@ -52,7 +52,7 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob { virtual ~URLRequestFileJob(); // The OS-specific full path name of the file - FilePath file_path_; + base::FilePath file_path_; private: // Meta information about the file. It's used as a member in the @@ -75,7 +75,7 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob { }; // Fetches file info on a background thread. - static void FetchMetaInfo(const FilePath& file_path, + static void FetchMetaInfo(const base::FilePath& file_path, FileMetaInfo* meta_info); // Callback after fetching file info on a background thread. diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc index 046d72f..5f81e447 100644 --- a/net/url_request/url_request_test_util.cc +++ b/net/url_request/url_request_test_util.cc @@ -537,7 +537,7 @@ bool TestNetworkDelegate::OnCanSetCookie(const URLRequest& request, } bool TestNetworkDelegate::OnCanAccessFile(const URLRequest& request, - const FilePath& path) const { + const base::FilePath& path) const { return true; } diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h index 6b9b71b..f13ca7c 100644 --- a/net/url_request/url_request_test_util.h +++ b/net/url_request/url_request_test_util.h @@ -261,7 +261,7 @@ class TestNetworkDelegate : public NetworkDelegate { const std::string& cookie_line, CookieOptions* options) OVERRIDE; virtual bool OnCanAccessFile(const URLRequest& request, - const FilePath& path) const OVERRIDE; + const base::FilePath& path) const OVERRIDE; virtual bool OnCanThrottleRequest( const URLRequest& request) const OVERRIDE; virtual int OnBeforeSocketStreamConnect( diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index e63b3fe..4f223e5 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -593,7 +593,7 @@ TEST_F(URLRequestTest, DataURLImageTest) { } TEST_F(URLRequestTest, FileTest) { - FilePath app_path; + base::FilePath app_path; PathService::Get(base::FILE_EXE, &app_path); GURL app_url = FilePathToFileURL(app_path); @@ -619,7 +619,7 @@ TEST_F(URLRequestTest, FileTest) { } TEST_F(URLRequestTest, FileTestCancel) { - FilePath app_path; + base::FilePath app_path; PathService::Get(base::FILE_EXE, &app_path); GURL app_url = FilePathToFileURL(app_path); @@ -641,7 +641,7 @@ TEST_F(URLRequestTest, FileTestFullSpecifiedRange) { scoped_array<char> buffer(new char[buffer_size]); FillBuffer(buffer.get(), buffer_size); - FilePath temp_path; + base::FilePath temp_path; EXPECT_TRUE(file_util::CreateTemporaryFile(&temp_path)); GURL temp_url = FilePathToFileURL(temp_path); EXPECT_TRUE(file_util::WriteFile(temp_path, buffer.get(), buffer_size)); @@ -685,7 +685,7 @@ TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) { scoped_array<char> buffer(new char[buffer_size]); FillBuffer(buffer.get(), buffer_size); - FilePath temp_path; + base::FilePath temp_path; EXPECT_TRUE(file_util::CreateTemporaryFile(&temp_path)); GURL temp_url = FilePathToFileURL(temp_path); EXPECT_TRUE(file_util::WriteFile(temp_path, buffer.get(), buffer_size)); @@ -728,7 +728,7 @@ TEST_F(URLRequestTest, FileTestMultipleRanges) { scoped_array<char> buffer(new char[buffer_size]); FillBuffer(buffer.get(), buffer_size); - FilePath temp_path; + base::FilePath temp_path; EXPECT_TRUE(file_util::CreateTemporaryFile(&temp_path)); GURL temp_url = FilePathToFileURL(temp_path); EXPECT_TRUE(file_util::WriteFile(temp_path, buffer.get(), buffer_size)); @@ -769,7 +769,7 @@ TEST_F(URLRequestTest, InvalidUrlTest) { #if defined(OS_WIN) TEST_F(URLRequestTest, ResolveShortcutTest) { - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("net"); app_path = app_path.AppendASCII("data"); @@ -798,7 +798,8 @@ TEST_F(URLRequestTest, ResolveShortcutTest) { TestDelegate d; { - URLRequest r(FilePathToFileURL(FilePath(lnk_path)), &d, &default_context_); + URLRequest r(FilePathToFileURL(base::FilePath(lnk_path)), &d, + &default_context_); r.Start(); EXPECT_TRUE(r.is_pending()); @@ -836,7 +837,7 @@ TEST_F(URLRequestTest, FileDirCancelTest) { TestDelegate d; { - FilePath file_path; + base::FilePath file_path; PathService::Get(base::DIR_SOURCE_ROOT, &file_path); file_path = file_path.Append(FILE_PATH_LITERAL("net")); file_path = file_path.Append(FILE_PATH_LITERAL("data")); @@ -859,7 +860,7 @@ TEST_F(URLRequestTest, FileDirRedirectNoCrash) { // directory and does not end with a slash. Ensure that following such // redirects does not crash. See http://crbug.com/18686. - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.Append(FILE_PATH_LITERAL("net")); path = path.Append(FILE_PATH_LITERAL("data")); @@ -1410,14 +1411,14 @@ TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) { // http://crbug.com/114369 class LocalHttpTestServer : public TestServer { public: - explicit LocalHttpTestServer(const FilePath& document_root) + explicit LocalHttpTestServer(const base::FilePath& document_root) : TestServer(TestServer::TYPE_HTTP, ScopedCustomUrlRequestTestHttpHost::value(), document_root) {} LocalHttpTestServer() : TestServer(TestServer::TYPE_HTTP, ScopedCustomUrlRequestTestHttpHost::value(), - FilePath()) {} + base::FilePath()) {} }; TEST_F(URLRequestTest, DelayedCookieCallback) { @@ -1962,7 +1963,7 @@ TEST_F(URLRequestTest, DoNotOverrideReferrer) { class URLRequestTestHTTP : public URLRequestTest { public: URLRequestTestHTTP() - : test_server_(FilePath(FILE_PATH_LITERAL( + : test_server_(base::FilePath(FILE_PATH_LITERAL( "net/data/url_request_unittest"))) { } @@ -2946,9 +2947,9 @@ TEST_F(URLRequestTestHTTP, GetZippedTest) { TEST_F(URLRequestTestHTTP, DISABLED_HTTPSToHTTPRedirectNoRefererTest) { ASSERT_TRUE(test_server_.Start()); - TestServer https_test_server(TestServer::TYPE_HTTPS, - TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + TestServer https_test_server( + TestServer::TYPE_HTTPS, TestServer::kLocalhost, + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(https_test_server.Start()); // An https server is sent a request with an https referer, @@ -3259,13 +3260,13 @@ TEST_F(URLRequestTestHTTP, PostFileTest) { URLRequest r(test_server_.GetURL("echo"), &d, &default_context_); r.set_method("POST"); - FilePath dir; + base::FilePath dir; PathService::Get(base::DIR_EXE, &dir); file_util::SetCurrentDirectory(dir); ScopedVector<UploadElementReader> element_readers; - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.Append(FILE_PATH_LITERAL("net")); path = path.Append(FILE_PATH_LITERAL("data")); @@ -3277,7 +3278,7 @@ TEST_F(URLRequestTestHTTP, PostFileTest) { // This file should just be ignored in the upload stream. element_readers.push_back(new UploadFileElementReader( base::MessageLoopProxy::current(), - FilePath(FILE_PATH_LITERAL( + base::FilePath(FILE_PATH_LITERAL( "c:\\path\\to\\non\\existant\\file.randomness.12345")), 0, kuint64max, base::Time())); r.set_upload(make_scoped_ptr(new UploadDataStream(&element_readers, 0))); @@ -3392,7 +3393,7 @@ TEST_F(URLRequestTestHTTP, ProcessSTS) { TestServer https_test_server( TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); + base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); ASSERT_TRUE(https_test_server.Start()); TestDelegate d; @@ -3419,7 +3420,7 @@ TEST_F(URLRequestTestHTTP, ProcessSTSOnce) { TestServer https_test_server( TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); + base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); ASSERT_TRUE(https_test_server.Start()); TestDelegate d; @@ -3538,7 +3539,7 @@ TEST_F(URLRequestTestHTTP, DeferredRedirect) { EXPECT_FALSE(d.received_data_before_response()); EXPECT_EQ(URLRequestStatus::SUCCESS, req.status().status()); - FilePath path; + base::FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); path = path.Append(FILE_PATH_LITERAL("net")); path = path.Append(FILE_PATH_LITERAL("data")); @@ -4145,7 +4146,7 @@ class HTTPSRequestTest : public testing::Test { TEST_F(HTTPSRequestTest, DISABLED_HTTPSGetTest) { TestServer test_server(TestServer::TYPE_HTTPS, TestServer::kLocalhost, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); TestDelegate d; @@ -4172,7 +4173,7 @@ TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) { TestServer::SSLOptions::CERT_MISMATCHED_NAME); TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); bool err_allowed = true; @@ -4205,7 +4206,7 @@ TEST_F(HTTPSRequestTest, HTTPSExpiredTest) { TestServer::SSLOptions::CERT_EXPIRED); TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); // Iterate from false to true, just so that we do the opposite of the @@ -4252,7 +4253,7 @@ TEST_F(HTTPSRequestTest, TLSv1Fallback) { TestServer::SSLOptions::TLS_INTOLERANT_TLS1_1; TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); TestDelegate d; @@ -4279,7 +4280,7 @@ TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { TestServer::SSLOptions::CERT_MISMATCHED_NAME); TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); // We require that the URL be www.google.com in order to pick up the @@ -4322,7 +4323,7 @@ TEST_F(HTTPSRequestTest, HTTPSErrorsNoClobberTSSTest) { TestServer::SSLOptions::CERT_MISMATCHED_NAME); TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); // We require that the URL be www.google.com in order to pick up the @@ -4381,7 +4382,7 @@ TEST_F(HTTPSRequestTest, HSTSPreservesPosts) { TestServer::SSLOptions ssl_options(TestServer::SSLOptions::CERT_OK); TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); @@ -4431,7 +4432,7 @@ TEST_F(HTTPSRequestTest, SSLv3Fallback) { ssl_options.tls_intolerant = TestServer::SSLOptions::TLS_INTOLERANT_ALL; TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); TestDelegate d; @@ -4481,7 +4482,7 @@ TEST_F(HTTPSRequestTest, ClientAuthTest) { ssl_options.request_client_certificate = true; TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); SSLClientAuthTestDelegate d; @@ -4517,7 +4518,7 @@ TEST_F(HTTPSRequestTest, ResumeTest) { ssl_options.record_resume = true; TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); SSLClientSocket::ClearSessionCache(); @@ -4585,7 +4586,7 @@ TEST_F(HTTPSRequestTest, SSLSessionCacheShardTest) { ssl_options.record_resume = true; TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); SSLClientSocket::ClearSessionCache(); @@ -4721,7 +4722,7 @@ class HTTPSOCSPTest : public HTTPSRequestTest { *out_cert_status = 0; TestServer test_server(TestServer::TYPE_HTTPS, ssl_options, - FilePath(FILE_PATH_LITERAL("net/data/ssl"))); + base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); ASSERT_TRUE(test_server.Start()); TestDelegate d; @@ -5014,7 +5015,8 @@ TEST_F(HTTPSCRLSetTest, ExpiredCRLSet) { class URLRequestTestFTP : public URLRequestTest { public: URLRequestTestFTP() - : test_server_(TestServer::TYPE_FTP, TestServer::kLocalhost, FilePath()) { + : test_server_(TestServer::TYPE_FTP, TestServer::kLocalhost, + base::FilePath()) { } protected: @@ -5078,7 +5080,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPDirectoryListing) { TEST_F(URLRequestTestFTP, DISABLED_FTPGetTestAnonymous) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; @@ -5107,7 +5109,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPGetTestAnonymous) { TEST_F(URLRequestTestFTP, DISABLED_FTPGetTest) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; @@ -5143,7 +5145,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPGetTest) { TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPassword) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; @@ -5173,7 +5175,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPassword) { TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPasswordRestart) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; @@ -5206,7 +5208,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPasswordRestart) { TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUser) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; @@ -5236,7 +5238,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUser) { TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUserRestart) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; @@ -5269,7 +5271,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUserRestart) { TEST_F(URLRequestTestFTP, DISABLED_FTPCacheURLCredentials) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); @@ -5319,7 +5321,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheURLCredentials) { TEST_F(URLRequestTestFTP, DISABLED_FTPCacheLoginBoxCredentials) { ASSERT_TRUE(test_server_.Start()); - FilePath app_path; + base::FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); app_path = app_path.AppendASCII("LICENSE"); |