summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-11 17:36:07 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-11 17:36:07 +0000
commit7567484144da059e2c2c2a818b06660a5459052f (patch)
treea4ceafc7e890051c25dbdd54b170d0f5794dd229 /net
parent8a25d54d6eb190a8b82479b5309a892c1080a372 (diff)
downloadchromium_src-7567484144da059e2c2c2a818b06660a5459052f.zip
chromium_src-7567484144da059e2c2c2a818b06660a5459052f.tar.gz
chromium_src-7567484144da059e2c2c2a818b06660a5459052f.tar.bz2
Move PathExists to base namespace.
BUG= TBR=jam@chromium.org Review URL: https://codereview.chromium.org/18286004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/disk_cache/backend_unittest.cc4
-rw-r--r--net/disk_cache/cache_util.cc2
-rw-r--r--net/disk_cache/cache_util_unittest.cc34
-rw-r--r--net/disk_cache/simple/simple_backend_impl.cc2
-rw-r--r--net/disk_cache/simple/simple_index_file.cc2
-rw-r--r--net/disk_cache/simple/simple_index_file_unittest.cc6
-rw-r--r--net/dns/dns_hosts.cc2
-rw-r--r--net/proxy/proxy_config_service_linux.cc2
-rw-r--r--net/proxy/proxy_config_service_linux_unittest.cc2
-rw-r--r--net/test/embedded_test_server/embedded_test_server.cc2
-rw-r--r--net/test/spawned_test_server/base_test_server.cc4
-rw-r--r--net/tools/crash_cache/crash_cache.cc2
-rw-r--r--net/url_request/url_fetcher_impl_unittest.cc12
13 files changed, 38 insertions, 38 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 5a61ca3..47e80d0 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -2950,7 +2950,7 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) {
// Delete one of the files in the entry.
base::FilePath to_delete_file = cache_path_.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, 0));
- EXPECT_TRUE(file_util::PathExists(to_delete_file));
+ EXPECT_TRUE(base::PathExists(to_delete_file));
EXPECT_TRUE(disk_cache::DeleteCacheFile(to_delete_file));
// Failing to open the entry should delete the rest of these files.
@@ -2961,7 +2961,7 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) {
base::FilePath
should_be_gone_file(cache_path_.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, i)));
- EXPECT_FALSE(file_util::PathExists(should_be_gone_file));
+ EXPECT_FALSE(base::PathExists(should_be_gone_file));
}
}
diff --git a/net/disk_cache/cache_util.cc b/net/disk_cache/cache_util.cc
index 0504559..2457553 100644
--- a/net/disk_cache/cache_util.cc
+++ b/net/disk_cache/cache_util.cc
@@ -41,7 +41,7 @@ base::FilePath GetTempCacheName(const base::FilePath& path,
// We'll attempt to have up to kMaxOldFolders folders for deletion.
for (int i = 0; i < kMaxOldFolders; i++) {
base::FilePath to_delete = GetPrefixedName(path, name, i);
- if (!file_util::PathExists(to_delete))
+ if (!base::PathExists(to_delete))
return to_delete;
}
return base::FilePath();
diff --git a/net/disk_cache/cache_util_unittest.cc b/net/disk_cache/cache_util_unittest.cc
index 74ae365..aebd268 100644
--- a/net/disk_cache/cache_util_unittest.cc
+++ b/net/disk_cache/cache_util_unittest.cc
@@ -48,18 +48,18 @@ class CacheUtilTest : public PlatformTest {
TEST_F(CacheUtilTest, MoveCache) {
EXPECT_TRUE(disk_cache::MoveCache(cache_dir_, dest_dir_));
- EXPECT_TRUE(file_util::PathExists(dest_dir_));
- EXPECT_TRUE(file_util::PathExists(dest_file1_));
- EXPECT_TRUE(file_util::PathExists(dest_file2_));
- EXPECT_TRUE(file_util::PathExists(dest_dir1_));
+ EXPECT_TRUE(base::PathExists(dest_dir_));
+ EXPECT_TRUE(base::PathExists(dest_file1_));
+ EXPECT_TRUE(base::PathExists(dest_file2_));
+ EXPECT_TRUE(base::PathExists(dest_dir1_));
#if defined(OS_CHROMEOS)
- EXPECT_TRUE(file_util::PathExists(cache_dir_)); // old cache dir stays
+ EXPECT_TRUE(base::PathExists(cache_dir_)); // old cache dir stays
#else
- EXPECT_FALSE(file_util::PathExists(cache_dir_)); // old cache is gone
+ EXPECT_FALSE(base::PathExists(cache_dir_)); // old cache is gone
#endif
- EXPECT_FALSE(file_util::PathExists(file1_));
- EXPECT_FALSE(file_util::PathExists(file2_));
- EXPECT_FALSE(file_util::PathExists(dir1_));
+ EXPECT_FALSE(base::PathExists(file1_));
+ EXPECT_FALSE(base::PathExists(file2_));
+ EXPECT_FALSE(base::PathExists(dir1_));
}
TEST_F(CacheUtilTest, DeleteCache) {
@@ -67,9 +67,9 @@ TEST_F(CacheUtilTest, DeleteCache) {
// one around.
base::Delete(dir1_, false);
disk_cache::DeleteCache(cache_dir_, false);
- EXPECT_TRUE(file_util::PathExists(cache_dir_)); // cache dir stays
- EXPECT_FALSE(file_util::PathExists(file1_));
- EXPECT_FALSE(file_util::PathExists(file2_));
+ EXPECT_TRUE(base::PathExists(cache_dir_)); // cache dir stays
+ EXPECT_FALSE(base::PathExists(file1_));
+ EXPECT_FALSE(base::PathExists(file2_));
}
TEST_F(CacheUtilTest, DeleteCacheAndDir) {
@@ -77,15 +77,15 @@ TEST_F(CacheUtilTest, DeleteCacheAndDir) {
// one around.
base::Delete(dir1_, false);
disk_cache::DeleteCache(cache_dir_, true);
- EXPECT_FALSE(file_util::PathExists(cache_dir_)); // cache dir is gone
- EXPECT_FALSE(file_util::PathExists(file1_));
- EXPECT_FALSE(file_util::PathExists(file2_));
+ EXPECT_FALSE(base::PathExists(cache_dir_)); // cache dir is gone
+ EXPECT_FALSE(base::PathExists(file1_));
+ EXPECT_FALSE(base::PathExists(file2_));
}
TEST_F(CacheUtilTest, DeleteCacheFile) {
EXPECT_TRUE(disk_cache::DeleteCacheFile(file1_));
- EXPECT_FALSE(file_util::PathExists(file1_));
- EXPECT_TRUE(file_util::PathExists(cache_dir_)); // cache dir stays
+ EXPECT_FALSE(base::PathExists(file1_));
+ EXPECT_TRUE(base::PathExists(cache_dir_)); // cache dir stays
}
} // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 16c77ed..1302054 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -94,7 +94,7 @@ void DeleteBackendImpl(disk_cache::Backend** backend,
// 2. The Simple Backend has pickled file format for the index making it hacky
// to have the magic in the right place.
bool FileStructureConsistent(const base::FilePath& path) {
- if (!file_util::PathExists(path) && !file_util::CreateDirectory(path)) {
+ if (!base::PathExists(path) && !file_util::CreateDirectory(path)) {
LOG(ERROR) << "Failed to create directory: " << path.LossyDisplayName();
return false;
}
diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc
index 067e9c6..e154553 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -165,7 +165,7 @@ void SimpleIndexFile::SyncLoadIndexEntries(
// TODO(felipeg): probably could load a stale index and use it for something.
scoped_ptr<SimpleIndex::EntrySet> index_file_entries;
- const bool index_file_exists = file_util::PathExists(index_file_path);
+ const bool index_file_exists = base::PathExists(index_file_path);
// Only load if the index is not stale.
const bool index_stale = IsIndexFileStale(index_file_path);
diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc
index 8e5b88d..e2493f9 100644
--- a/net/disk_cache/simple/simple_index_file_unittest.cc
+++ b/net/disk_cache/simple/simple_index_file_unittest.cc
@@ -196,7 +196,7 @@ TEST_F(SimpleIndexFileTest, WriteThenLoadIndex) {
simple_index_file.WriteToDisk(entries, kCacheSize,
base::TimeTicks(), false);
base::RunLoop().RunUntilIdle();
- EXPECT_TRUE(file_util::PathExists(index_path));
+ EXPECT_TRUE(base::PathExists(index_path));
}
WrappedSimpleIndexFile simple_index_file(temp_dir.path());
@@ -204,7 +204,7 @@ TEST_F(SimpleIndexFileTest, WriteThenLoadIndex) {
GetCallback());
base::RunLoop().RunUntilIdle();
- EXPECT_TRUE(file_util::PathExists(index_path));
+ EXPECT_TRUE(base::PathExists(index_path));
ASSERT_TRUE(callback_result());
EXPECT_FALSE(callback_result()->force_index_flush);
const SimpleIndex::EntrySet* read_entries =
@@ -235,7 +235,7 @@ TEST_F(SimpleIndexFileTest, LoadCorruptIndex) {
GetCallback());
base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(file_util::PathExists(index_path));
+ EXPECT_FALSE(base::PathExists(index_path));
ASSERT_TRUE(callback_result());
EXPECT_TRUE(callback_result()->force_index_flush);
EXPECT_TRUE(callback_result()->index_file_entries);
diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc
index 5aa4aaa..e0a40a1 100644
--- a/net/dns/dns_hosts.cc
+++ b/net/dns/dns_hosts.cc
@@ -139,7 +139,7 @@ void ParseHosts(const std::string& contents, 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))
+ if (!base::PathExists(path))
return true;
int64 size;
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index 7b8a408..a38a37a 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -826,7 +826,7 @@ bool SettingGetterImplGSettings::LoadAndCheckVersion(
Tokenize(path, ":", &paths);
for (size_t i = 0; i < paths.size(); ++i) {
base::FilePath file(paths[i]);
- if (file_util::PathExists(file.Append("gnome-network-properties"))) {
+ if (base::PathExists(file.Append("gnome-network-properties"))) {
VLOG(1) << "Found gnome-network-properties. Will fall back to gconf.";
return false;
}
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 45f6ae3..53419ab 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -1550,7 +1550,7 @@ TEST_F(ProxyConfigServiceLinuxTest, KDEHomePicker) {
// Note that its timestamp will be at least as new as the .kde one.
file_util::CreateDirectory(kde4_config_);
file_util::WriteFile(kioslaverc4_, slaverc4.c_str(), slaverc4.length());
- CHECK(file_util::PathExists(kioslaverc4_));
+ CHECK(base::PathExists(kioslaverc4_));
{ SCOPED_TRACE("KDE4, .kde4 directory present, use it");
MockEnvironment* env = new MockEnvironment;
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 9cdf21b..9175d6c 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -65,7 +65,7 @@ scoped_ptr<HttpResponse> HandleFileRequest(
base::FilePath headers_path(
file_path.AddExtension(FILE_PATH_LITERAL("mock-http-headers")));
- if (file_util::PathExists(headers_path)) {
+ if (base::PathExists(headers_path)) {
std::string headers_contents;
if (!file_util::ReadFileToString(headers_path, &headers_contents))
return scoped_ptr<HttpResponse>();
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index 4598128..4a276b6 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -340,7 +340,7 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
if (!certificate_file.value().empty()) {
certificate_path = certificate_path.Append(certificate_file);
if (certificate_path.IsAbsolute() &&
- !file_util::PathExists(certificate_path)) {
+ !base::PathExists(certificate_path)) {
LOG(ERROR) << "Certificate path " << certificate_path.value()
<< " doesn't exist. Can't launch https server.";
return false;
@@ -356,7 +356,7 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
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)) {
+ if (it->IsAbsolute() && !base::PathExists(*it)) {
LOG(ERROR) << "Client authority path " << it->value()
<< " doesn't exist. Can't launch https server.";
return false;
diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc
index 5613d0d..7072864 100644
--- a/net/tools/crash_cache/crash_cache.cc
+++ b/net/tools/crash_cache/crash_cache.cc
@@ -118,7 +118,7 @@ bool CreateTargetFolder(const base::FilePath& path, RankCrashes action,
*full_path = path.AppendASCII(folders[action]);
- if (file_util::PathExists(*full_path))
+ if (base::PathExists(*full_path))
return false;
return file_util::CreateDirectory(*full_path);
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc
index 4e42ed4..1a70ed4 100644
--- a/net/url_request/url_fetcher_impl_unittest.cc
+++ b/net/url_request/url_fetcher_impl_unittest.cc
@@ -1369,7 +1369,7 @@ TEST_F(URLFetcherFileTest, SmallGet) {
base::MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- ASSERT_FALSE(file_util::PathExists(file_path_))
+ ASSERT_FALSE(base::PathExists(file_path_))
<< file_path_.value() << " not removed.";
}
@@ -1417,7 +1417,7 @@ TEST_F(URLFetcherFileTest, SavedOutputFileOwnerhisp) {
base::MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
base::MessageLoop::current()->RunUntilIdle();
- ASSERT_EQ(kTake[i], file_util::PathExists(file_path_)) <<
+ ASSERT_EQ(kTake[i], base::PathExists(file_path_)) <<
"FilePath: " << file_path_.value();
}
}
@@ -1437,7 +1437,7 @@ TEST_F(URLFetcherFileTest, OverwriteExistingFile) {
file_path_ = temp_dir.path().AppendASCII(kFileToFetch);
ASSERT_EQ(static_cast<int>(data.size()),
file_util::WriteFile(file_path_, data.data(), data.size()));
- ASSERT_TRUE(file_util::PathExists(file_path_));
+ ASSERT_TRUE(base::PathExists(file_path_));
expected_file_ = test_server.GetDocumentRoot().AppendASCII(kFileToFetch);
ASSERT_FALSE(file_util::ContentsEqual(file_path_, expected_file_));
@@ -1462,7 +1462,7 @@ TEST_F(URLFetcherFileTest, TryToOverwriteDirectory) {
static const char kFileToFetch[] = "simple.html";
file_path_ = temp_dir.path().AppendASCII(kFileToFetch);
ASSERT_TRUE(file_util::CreateDirectory(file_path_));
- ASSERT_TRUE(file_util::PathExists(file_path_));
+ ASSERT_TRUE(base::PathExists(file_path_));
// Get a small file.
expected_file_error_ = ERR_ACCESS_DENIED;
@@ -1490,7 +1490,7 @@ TEST_F(URLFetcherFileTest, SmallGetToTempFile) {
base::MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- ASSERT_FALSE(file_util::PathExists(file_path_))
+ ASSERT_FALSE(base::PathExists(file_path_))
<< file_path_.value() << " not removed.";
}
@@ -1531,7 +1531,7 @@ TEST_F(URLFetcherFileTest, SavedOutputTempFileOwnerhisp) {
base::MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
base::MessageLoop::current()->RunUntilIdle();
- ASSERT_EQ(kTake[i], file_util::PathExists(file_path_)) <<
+ ASSERT_EQ(kTake[i], base::PathExists(file_path_)) <<
"FilePath: " << file_path_.value();
}
}