Skip to content

Commit

Permalink
Cleanup: Remove unneeded base/file_util.h includes in base.
Browse files Browse the repository at this point in the history
Review URL: https://chromiumcodereview.appspot.com/15078003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199960 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed May 14, 2013
1 parent d61f1f3 commit 6d7f55f
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 40 deletions.
3 changes: 0 additions & 3 deletions base/base_paths_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


#include <windows.h>
#include <shlobj.h>

#include "base/base_paths.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/win/scoped_co_mem.h"
Expand Down Expand Up @@ -53,7 +51,6 @@ bool GetQuickLaunchPath(bool default_user, FilePath* result) {
namespace base {

bool PathProviderWin(int key, FilePath* result) {

// We need to go compute the value. It would be nice to support paths with
// names longer than MAX_PATH, but the system functions don't seem to be
// designed for it either, with the exception of GetTempPath (but other
Expand Down
6 changes: 3 additions & 3 deletions base/file_version_info_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/file_version_info.h"
#include "testing/gtest/include/gtest/gtest.h"

#if defined(OS_WIN)
Expand All @@ -27,7 +27,7 @@ FilePath GetTestDataPath() {
}
#endif

}
} // namespace

#if defined(OS_WIN)
TEST(FileVersionInfoTest, HardCodedProperties) {
Expand Down
17 changes: 8 additions & 9 deletions base/files/file_path_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down Expand Up @@ -1122,32 +1121,32 @@ TEST_F(FilePathTest, FromUTF8Unsafe_And_AsUTF8Unsafe) {

TEST_F(FilePathTest, ConstructWithNUL) {
// Assert FPS() works.
ASSERT_TRUE(FPS("a\0b").length() == 3);
ASSERT_EQ(3U, FPS("a\0b").length());

// Test constructor strips '\0'
FilePath path(FPS("a\0b"));
EXPECT_TRUE(path.value().length() == 1);
EXPECT_EQ(path.value(), FPL("a"));
EXPECT_EQ(1U, path.value().length());
EXPECT_EQ(FPL("a"), path.value());
}

TEST_F(FilePathTest, AppendWithNUL) {
// Assert FPS() works.
ASSERT_TRUE(FPS("b\0b").length() == 3);
ASSERT_EQ(3U, FPS("b\0b").length());

// Test Append() strips '\0'
FilePath path(FPL("a"));
path = path.Append(FPS("b\0b"));
EXPECT_TRUE(path.value().length() == 3);
EXPECT_EQ(3U, path.value().length());
#if defined(FILE_PATH_USES_WIN_SEPARATORS)
EXPECT_EQ(path.value(), FPL("a\\b"));
EXPECT_EQ(FPL("a\\b"), path.value());
#else
EXPECT_EQ(path.value(), FPL("a/b"));
EXPECT_EQ(FPL("a/b"), path.value());
#endif
}

TEST_F(FilePathTest, ReferencesParentWithNUL) {
// Assert FPS() works.
ASSERT_TRUE(FPS("..\0").length() == 3);
ASSERT_EQ(3U, FPS("..\0").length());

// Test ReferencesParent() doesn't break with "..\0"
FilePath path(FPS("..\0"));
Expand Down
2 changes: 1 addition & 1 deletion base/files/file_path_watcher_kqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int FilePathWatcherImpl::EventsForPath(FilePath path, EventVector* events) {
int last_existing_entry = 0;
FilePath built_path;
bool path_still_exists = true;
for(std::vector<FilePath::StringType>::iterator i = components.begin();
for (std::vector<FilePath::StringType>::iterator i = components.begin();
i != components.end(); ++i) {
if (i == components.begin()) {
built_path = FilePath(*i);
Expand Down
1 change: 0 additions & 1 deletion base/files/file_util_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "base/base_export.h"
#include "base/callback_forward.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/platform_file.h"
Expand Down
23 changes: 12 additions & 11 deletions base/files/file_util_proxy_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <map>

#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
Expand Down Expand Up @@ -194,17 +195,17 @@ TEST_F(FileUtilProxyTest, CreateTemporary) {

// The file should be writable.
#if defined(OS_WIN)
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
OVERLAPPED overlapped = {0};
overlapped.hEvent = hEvent;
DWORD bytes_written;
if (!::WriteFile(file_, "test", 4, &bytes_written, &overlapped)) {
// Temporary file is created with ASYNC flag, so WriteFile may return 0
// with ERROR_IO_PENDING.
EXPECT_EQ(ERROR_IO_PENDING, GetLastError());
GetOverlappedResult(file_, &overlapped, &bytes_written, TRUE);
}
EXPECT_EQ(4, bytes_written);
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
OVERLAPPED overlapped = {0};
overlapped.hEvent = hEvent;
DWORD bytes_written;
if (!::WriteFile(file_, "test", 4, &bytes_written, &overlapped)) {
// Temporary file is created with ASYNC flag, so WriteFile may return 0
// with ERROR_IO_PENDING.
EXPECT_EQ(ERROR_IO_PENDING, GetLastError());
GetOverlappedResult(file_, &overlapped, &bytes_written, TRUE);
}
EXPECT_EQ(4, bytes_written);
#else
// On POSIX ASYNC flag does not affect synchronous read/write behavior.
EXPECT_EQ(4, WritePlatformFile(file_, 0, "test", 4));
Expand Down
1 change: 0 additions & 1 deletion base/i18n/icu_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <string>

#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
Expand Down
1 change: 0 additions & 1 deletion base/memory/singleton_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include "base/at_exit.h"
#include "base/file_util.h"
#include "base/memory/singleton.h"
#include "base/path_service.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
7 changes: 3 additions & 4 deletions base/process_util_freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <time.h>
#include <unistd.h>

#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
Expand Down Expand Up @@ -65,7 +64,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)

do {
size_t len = 0;
if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) <0 ){
if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) < 0) {
LOG(ERROR) << "failed to get the size needed for the process list";
kinfo_procs_.resize(0);
done = true;
Expand Down Expand Up @@ -105,7 +104,7 @@ ProcessIterator::~ProcessIterator() {
bool ProcessIterator::CheckForNextProcess() {
std::string data;

for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++ index_of_kinfo_proc_) {
for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) {
size_t length;
struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_];
int mib[] = { CTL_KERN, KERN_PROC_ARGS, kinfo.ki_pid };
Expand Down Expand Up @@ -157,7 +156,7 @@ bool ProcessIterator::CheckForNextProcess() {
}

bool NamedProcessIterator::IncludeEntry() {
if(executable_name_ != entry().exe_file())
if (executable_name_ != entry().exe_file())
return false;

return ProcessIterator::IncludeEntry();
Expand Down
3 changes: 0 additions & 3 deletions base/process_util_openbsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <time.h>
#include <unistd.h>

#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
Expand Down Expand Up @@ -211,7 +210,6 @@ size_t ProcessMetrics::GetPagefileUsage() const {
}

size_t ProcessMetrics::GetPeakPagefileUsage() const {

return 0;
}

Expand All @@ -233,7 +231,6 @@ size_t ProcessMetrics::GetWorkingSetSize() const {
}

size_t ProcessMetrics::GetPeakWorkingSetSize() const {

return 0;
}

Expand Down
1 change: 0 additions & 1 deletion base/sync_socket_nacl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <stdio.h>
#include <sys/types.h>

#include "base/file_util.h"
#include "base/logging.h"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "chrome/browser/media_galleries/fileapi/native_media_file_util.h"

#include "base/file_util.h"
#include "base/memory/scoped_generic_obj.h"
#include "base/string_util.h"
#include "chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <string>

#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/format_macros.h"
#include "base/message_loop.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/nacl_host/nacl_browser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/nacl_host/nacl_browser.h"

#include "base/command_line.h"
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/nacl_host/nacl_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/base_switches.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
Expand Down Expand Up @@ -60,7 +61,6 @@
#elif defined(OS_WIN)
#include <windows.h>

#include "base/process_util.h"
#include "base/threading/thread.h"
#include "base/win/scoped_handle.h"
#include "chrome/browser/nacl_host/nacl_broker_service_win.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/fileapi/isolated_file_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>
#include <vector>

#include "base/file_util.h"
#include "webkit/blob/shareable_file_reference.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation_context.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/fileapi/local_file_system_operation_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "webkit/fileapi/local_file_system_operation.h"

#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/fileapi/local_file_system_quota_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// 3) the result of QuotaManager::GetUsageAndQuota.

#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/fileapi/local_file_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "webkit/fileapi/local_file_util.h"

#include "base/file_util.h"
#include "base/files/file_util_proxy.h"
#include "googleurl/src/gurl.h"
#include "webkit/fileapi/file_system_context.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/fileapi/local_file_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <string>

#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop.h"
Expand Down
3 changes: 2 additions & 1 deletion webkit/fileapi/native_file_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/platform_file.h"
Expand Down Expand Up @@ -106,7 +107,7 @@ TEST_F(NativeFileUtilTest, CreateAndDeleteDirectory) {
false /* recursive */));

ASSERT_EQ(base::PLATFORM_FILE_OK,
NativeFileUtil::DeleteDirectory (dir_name));
NativeFileUtil::DeleteDirectory(dir_name));
EXPECT_FALSE(file_util::DirectoryExists(dir_name));
EXPECT_FALSE(NativeFileUtil::DirectoryExists(dir_name));
}
Expand Down
1 change: 1 addition & 0 deletions webkit/fileapi/sandbox_mount_point_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "base/bind.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/plugins/ppapi/quota_file_io_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "base/basictypes.h"
#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
Expand Down

0 comments on commit 6d7f55f

Please sign in to comment.