0

Add FilePath to base namespace.

This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes.
Review URL: https://codereview.chromium.org/12163003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
brettw@chromium.org
2013-02-02 05:12:33 +00:00
parent 8bc574c571
commit a3ef4830d5
636 changed files with 3754 additions and 3231 deletions
android_webview/browser/net
base
chrome
app
browser
automation
bookmarks
chromeos
component_updater
devtools
diagnostics
download
enumerate_modules_model_win.h
extensions
first_run
google_apis
history
icon_manager.hicon_manager_android.ccicon_manager_linux.cc
importer
jumplist_win.h
managed_mode
media_gallery
nacl_host
net
parsers
platform_util.hplatform_util_android.cc
plugins
prefs
printing
profiles
renderer_host
safe_browsing
sync_file_system
system_monitor
task_profiler
themes
ui
value_store
webdata
common
installer
renderer
service
cloud_print
test
tools
utility
chrome_frame
chromeos
cloud_print
content
crypto
gpu/tools/compositor_model_bench
ipc
media
net
printing
remoting/host
rlz/lib
sql
ui
webkit
appcache
base
blob
chromeos
database
dom_storage
fileapi
async_file_util.hasync_file_util_adapter.ccasync_file_util_adapter.hcross_operation_delegate.cccross_operation_delegate.hexternal_mount_points.ccexternal_mount_points.hexternal_mount_points_unittest.ccfile_system_callback_dispatcher.hfile_system_context.ccfile_system_context.hfile_system_context_unittest.ccfile_system_database_test_helper.ccfile_system_database_test_helper.hfile_system_dir_url_request_job.ccfile_system_dir_url_request_job_unittest.ccfile_system_directory_database.ccfile_system_directory_database.hfile_system_directory_database_unittest.ccfile_system_file_stream_reader.ccfile_system_file_stream_reader.hfile_system_file_stream_reader_unittest.ccfile_system_file_util.ccfile_system_file_util.hfile_system_file_util_proxy.ccfile_system_file_util_proxy.hfile_system_file_util_unittest.ccfile_system_mount_point_provider.hfile_system_mount_point_provider_unittest.ccfile_system_operation.hfile_system_origin_database.ccfile_system_origin_database.hfile_system_origin_database_unittest.ccfile_system_quota_client_unittest.ccfile_system_url.ccfile_system_url.hfile_system_url_request_job.ccfile_system_url_request_job.hfile_system_url_request_job_unittest.ccfile_system_url_unittest.ccfile_system_usage_cache.ccfile_system_usage_cache.hfile_system_usage_cache_unittest.ccfile_system_util.ccfile_system_util.hfile_system_util_unittest.ccfile_util_helper.ccfile_writer_delegate_unittest.ccisolated_context.ccisolated_context.hisolated_context_unittest.ccisolated_file_util.ccisolated_file_util.hisolated_file_util_unittest.ccisolated_mount_point_provider.ccisolated_mount_point_provider.hlocal_file_stream_writer.cclocal_file_stream_writer.hlocal_file_stream_writer_unittest.cclocal_file_system_operation.cclocal_file_system_operation.hlocal_file_system_operation_unittest.cclocal_file_system_operation_write_unittest.cclocal_file_system_quota_unittest.cclocal_file_system_test_helper.cclocal_file_system_test_helper.hlocal_file_util.cclocal_file_util.hlocal_file_util_unittest.cc
media
mount_points.ccmount_points.hnative_file_util.ccnative_file_util.hobfuscated_file_util.ccobfuscated_file_util.hobfuscated_file_util_unittest.ccremote_file_system_proxy.hsandbox_file_stream_writer.ccsandbox_file_stream_writer.hsandbox_mount_point_provider.ccsandbox_mount_point_provider.hsandbox_mount_point_provider_unittest.ccsandbox_quota_observer.ccsandbox_quota_observer.h
syncable
test_file_set.cctest_file_set.htest_mount_point_provider.cctest_mount_point_provider.hupload_file_system_file_element_reader_unittest.cc
glue
media
crypto
mocks
plugins
quota
support
tools
win8

@@ -87,7 +87,7 @@ bool AwNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
} }
bool AwNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, bool AwNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
const FilePath& path) const { const base::FilePath& path) const {
return true; return true;
} }

@@ -52,7 +52,7 @@ class AwNetworkDelegate : public net::NetworkDelegate {
const std::string& cookie_line, const std::string& cookie_line,
net::CookieOptions* options) OVERRIDE; net::CookieOptions* options) OVERRIDE;
virtual bool OnCanAccessFile(const net::URLRequest& request, virtual bool OnCanAccessFile(const net::URLRequest& request,
const FilePath& path) const OVERRIDE; const base::FilePath& path) const OVERRIDE;
virtual bool OnCanThrottleRequest( virtual bool OnCanThrottleRequest(
const net::URLRequest& request) const OVERRIDE; const net::URLRequest& request) const OVERRIDE;
virtual int OnBeforeSocketStreamConnect( virtual int OnBeforeSocketStreamConnect(

@@ -9,9 +9,10 @@
#include "base/base_export.h" #include "base/base_export.h"
namespace base {
class FilePath; class FilePath;
namespace base {
namespace android { namespace android {
// Retrieves the absolute path to the data directory of the current // Retrieves the absolute path to the data directory of the current

@@ -23,7 +23,9 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "build/build_config.h" #include "build/build_config.h"
namespace base {
class FilePath; class FilePath;
}
class BASE_EXPORT CommandLine { class BASE_EXPORT CommandLine {
public: public:
@@ -43,7 +45,7 @@ class BASE_EXPORT CommandLine {
explicit CommandLine(NoProgram no_program); explicit CommandLine(NoProgram no_program);
// Construct a new command line with |program| as argv[0]. // Construct a new command line with |program| as argv[0].
explicit CommandLine(const FilePath& program); explicit CommandLine(const base::FilePath& program);
// Construct a new command line from an argument list. // Construct a new command line from an argument list.
CommandLine(int argc, const CharType* const* argv); CommandLine(int argc, const CharType* const* argv);
@@ -92,8 +94,8 @@ class BASE_EXPORT CommandLine {
const StringVector& argv() const { return argv_; } const StringVector& argv() const { return argv_; }
// Get and Set the program part of the command line string (the first item). // Get and Set the program part of the command line string (the first item).
FilePath GetProgram() const; base::FilePath GetProgram() const;
void SetProgram(const FilePath& program); void SetProgram(const base::FilePath& program);
// Returns true if this command line contains the given switch. // Returns true if this command line contains the given switch.
// (Switch names are case-insensitive). // (Switch names are case-insensitive).
@@ -102,7 +104,7 @@ class BASE_EXPORT CommandLine {
// Returns the value associated with the given switch. If the switch has no // Returns the value associated with the given switch. If the switch has no
// value or isn't present, this method returns the empty string. // value or isn't present, this method returns the empty string.
std::string GetSwitchValueASCII(const std::string& switch_string) const; std::string GetSwitchValueASCII(const std::string& switch_string) const;
FilePath GetSwitchValuePath(const std::string& switch_string) const; base::FilePath GetSwitchValuePath(const std::string& switch_string) const;
StringType GetSwitchValueNative(const std::string& switch_string) const; StringType GetSwitchValueNative(const std::string& switch_string) const;
// Get a copy of all switches, along with their values. // Get a copy of all switches, along with their values.
@@ -111,7 +113,8 @@ class BASE_EXPORT CommandLine {
// Append a switch [with optional value] to the command line. // Append a switch [with optional value] to the command line.
// Note: Switches will precede arguments regardless of appending order. // Note: Switches will precede arguments regardless of appending order.
void AppendSwitch(const std::string& switch_string); void AppendSwitch(const std::string& switch_string);
void AppendSwitchPath(const std::string& switch_string, const FilePath& path); void AppendSwitchPath(const std::string& switch_string,
const base::FilePath& path);
void AppendSwitchNative(const std::string& switch_string, void AppendSwitchNative(const std::string& switch_string,
const StringType& value); const StringType& value);
void AppendSwitchASCII(const std::string& switch_string, void AppendSwitchASCII(const std::string& switch_string,
@@ -131,7 +134,7 @@ class BASE_EXPORT CommandLine {
// AppendArg is primarily for ASCII; non-ASCII input is interpreted as UTF-8. // AppendArg is primarily for ASCII; non-ASCII input is interpreted as UTF-8.
// Note: Switches will precede arguments regardless of appending order. // Note: Switches will precede arguments regardless of appending order.
void AppendArg(const std::string& value); void AppendArg(const std::string& value);
void AppendArgPath(const FilePath& value); void AppendArgPath(const base::FilePath& value);
void AppendArgNative(const StringType& value); void AppendArgNative(const StringType& value);
// Append the switches and arguments from another command line to this one. // Append the switches and arguments from another command line to this one.

@@ -15,10 +15,10 @@
#include <windows.h> #include <windows.h>
#endif #endif
class FilePath;
namespace base { namespace base {
class FilePath;
// A class for recording and playing back keyboard and mouse input events. // A class for recording and playing back keyboard and mouse input events.
// //
// Note - if you record events, and the playback with the windows in // Note - if you record events, and the playback with the windows in

@@ -125,6 +125,8 @@
class Pickle; class Pickle;
class PickleIterator; class PickleIterator;
namespace base {
// An abstraction to isolate users from the differences between native // An abstraction to isolate users from the differences between native
// pathnames on different platforms. // pathnames on different platforms.
class BASE_EXPORT FilePath { class BASE_EXPORT FilePath {
@@ -398,8 +400,13 @@ class BASE_EXPORT FilePath {
StringType path_; StringType path_;
}; };
} // namespace base
// TODO(brettw) remove this once callers properly use the base namespace.
using base::FilePath;
// This is required by googletest to print a readable output on test failures. // This is required by googletest to print a readable output on test failures.
BASE_EXPORT extern void PrintTo(const FilePath& path, std::ostream* out); BASE_EXPORT extern void PrintTo(const base::FilePath& path, std::ostream* out);
// Macros for string literal initialization of FilePath::CharType[], and for // Macros for string literal initialization of FilePath::CharType[], and for
// using a FilePath::CharType[] in a printf-style format string. // using a FilePath::CharType[] in a printf-style format string.
@@ -419,15 +426,15 @@ namespace BASE_HASH_NAMESPACE {
#if defined(COMPILER_GCC) #if defined(COMPILER_GCC)
template<> template<>
struct hash<FilePath> { struct hash<base::FilePath> {
size_t operator()(const FilePath& f) const { size_t operator()(const base::FilePath& f) const {
return hash<FilePath::StringType>()(f.value()); return hash<base::FilePath::StringType>()(f.value());
} }
}; };
#elif defined(COMPILER_MSVC) #elif defined(COMPILER_MSVC)
inline size_t hash_value(const FilePath& f) { inline size_t hash_value(const base::FilePath& f) {
return hash_value(f.value()); return hash_value(f.value());
} }

@@ -49,19 +49,20 @@ extern bool g_bug108724_debug;
// Functions that operate purely on a path string w/o touching the filesystem: // Functions that operate purely on a path string w/o touching the filesystem:
// Returns true if the given path ends with a path separator character. // Returns true if the given path ends with a path separator character.
BASE_EXPORT bool EndsWithSeparator(const FilePath& path); BASE_EXPORT bool EndsWithSeparator(const base::FilePath& path);
// Makes sure that |path| ends with a separator IFF path is a directory that // Makes sure that |path| ends with a separator IFF path is a directory that
// exists. Returns true if |path| is an existing directory, false otherwise. // exists. Returns true if |path| is an existing directory, false otherwise.
BASE_EXPORT bool EnsureEndsWithSeparator(FilePath* path); BASE_EXPORT bool EnsureEndsWithSeparator(base::FilePath* path);
// Convert provided relative path into an absolute path. Returns false on // Convert provided relative path into an absolute path. Returns false on
// error. On POSIX, this function fails if the path does not exist. // error. On POSIX, this function fails if the path does not exist.
BASE_EXPORT bool AbsolutePath(FilePath* path); BASE_EXPORT bool AbsolutePath(base::FilePath* path);
// Returns true if |parent| contains |child|. Both paths are converted to // Returns true if |parent| contains |child|. Both paths are converted to
// absolute paths before doing the comparison. // absolute paths before doing the comparison.
BASE_EXPORT bool ContainsPath(const FilePath& parent, const FilePath& child); BASE_EXPORT bool ContainsPath(const base::FilePath& parent,
const base::FilePath& child);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Functions that involve filesystem access or modification: // Functions that involve filesystem access or modification:
@@ -74,7 +75,7 @@ BASE_EXPORT bool ContainsPath(const FilePath& parent, const FilePath& child);
// timestmap of file creation time. If you need to avoid such // timestmap of file creation time. If you need to avoid such
// mis-detection perfectly, you should wait one second before // mis-detection perfectly, you should wait one second before
// obtaining |file_time|. // obtaining |file_time|.
BASE_EXPORT int CountFilesCreatedAfter(const FilePath& path, BASE_EXPORT int CountFilesCreatedAfter(const base::FilePath& path,
const base::Time& file_time); const base::Time& file_time);
// Returns the total number of bytes used by all the files under |root_path|. // Returns the total number of bytes used by all the files under |root_path|.
@@ -82,7 +83,7 @@ BASE_EXPORT int CountFilesCreatedAfter(const FilePath& path,
// //
// This function is implemented using the FileEnumerator class so it is not // This function is implemented using the FileEnumerator class so it is not
// particularly speedy in any platform. // particularly speedy in any platform.
BASE_EXPORT int64 ComputeDirectorySize(const FilePath& root_path); BASE_EXPORT int64 ComputeDirectorySize(const base::FilePath& root_path);
// Returns the total number of bytes used by all files matching the provided // Returns the total number of bytes used by all files matching the provided
// |pattern|, on this |directory| (without recursion). If the path does not // |pattern|, on this |directory| (without recursion). If the path does not
@@ -90,8 +91,8 @@ BASE_EXPORT int64 ComputeDirectorySize(const FilePath& root_path);
// //
// This function is implemented using the FileEnumerator class so it is not // This function is implemented using the FileEnumerator class so it is not
// particularly speedy in any platform. // particularly speedy in any platform.
BASE_EXPORT int64 ComputeFilesSize(const FilePath& directory, BASE_EXPORT int64 ComputeFilesSize(const base::FilePath& directory,
const FilePath::StringType& pattern); const base::FilePath::StringType& pattern);
// Deletes the given path, whether it's a file or a directory. // Deletes the given path, whether it's a file or a directory.
// If it's a directory, it's perfectly happy to delete all of the // If it's a directory, it's perfectly happy to delete all of the
@@ -104,7 +105,7 @@ BASE_EXPORT int64 ComputeFilesSize(const FilePath& directory,
// //
// WARNING: USING THIS WITH recursive==true IS EQUIVALENT // WARNING: USING THIS WITH recursive==true IS EQUIVALENT
// TO "rm -rf", SO USE WITH CAUTION. // TO "rm -rf", SO USE WITH CAUTION.
BASE_EXPORT bool Delete(const FilePath& path, bool recursive); BASE_EXPORT bool Delete(const base::FilePath& path, bool recursive);
#if defined(OS_WIN) #if defined(OS_WIN)
// Schedules to delete the given path, whether it's a file or a directory, until // Schedules to delete the given path, whether it's a file or a directory, until
@@ -112,25 +113,27 @@ BASE_EXPORT bool Delete(const FilePath& path, bool recursive);
// Note: // Note:
// 1) The file/directory to be deleted should exist in a temp folder. // 1) The file/directory to be deleted should exist in a temp folder.
// 2) The directory to be deleted must be empty. // 2) The directory to be deleted must be empty.
BASE_EXPORT bool DeleteAfterReboot(const FilePath& path); BASE_EXPORT bool DeleteAfterReboot(const base::FilePath& path);
#endif #endif
// Moves the given path, whether it's a file or a directory. // Moves the given path, whether it's a file or a directory.
// If a simple rename is not possible, such as in the case where the paths are // If a simple rename is not possible, such as in the case where the paths are
// on different volumes, this will attempt to copy and delete. Returns // on different volumes, this will attempt to copy and delete. Returns
// true for success. // true for success.
BASE_EXPORT bool Move(const FilePath& from_path, const FilePath& to_path); BASE_EXPORT bool Move(const base::FilePath& from_path,
const base::FilePath& to_path);
// Renames file |from_path| to |to_path|. Both paths must be on the same // Renames file |from_path| to |to_path|. Both paths must be on the same
// volume, or the function will fail. Destination file will be created // volume, or the function will fail. Destination file will be created
// if it doesn't exist. Prefer this function over Move when dealing with // if it doesn't exist. Prefer this function over Move when dealing with
// temporary files. On Windows it preserves attributes of the target file. // temporary files. On Windows it preserves attributes of the target file.
// Returns true on success. // Returns true on success.
BASE_EXPORT bool ReplaceFile(const FilePath& from_path, BASE_EXPORT bool ReplaceFile(const base::FilePath& from_path,
const FilePath& to_path); const base::FilePath& to_path);
// Copies a single file. Use CopyDirectory to copy directories. // Copies a single file. Use CopyDirectory to copy directories.
BASE_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path); BASE_EXPORT bool CopyFile(const base::FilePath& from_path,
const base::FilePath& to_path);
// Copies the given path, and optionally all subdirectories and their contents // Copies the given path, and optionally all subdirectories and their contents
// as well. // as well.
@@ -139,36 +142,37 @@ BASE_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path);
// Don't use wildcards on the names, it may stop working without notice. // Don't use wildcards on the names, it may stop working without notice.
// //
// If you only need to copy a file use CopyFile, it's faster. // If you only need to copy a file use CopyFile, it's faster.
BASE_EXPORT bool CopyDirectory(const FilePath& from_path, BASE_EXPORT bool CopyDirectory(const base::FilePath& from_path,
const FilePath& to_path, const base::FilePath& to_path,
bool recursive); bool recursive);
// Returns true if the given path exists on the local filesystem, // Returns true if the given path exists on the local filesystem,
// false otherwise. // false otherwise.
BASE_EXPORT bool PathExists(const FilePath& path); BASE_EXPORT bool PathExists(const base::FilePath& path);
// Returns true if the given path is writable by the user, false otherwise. // Returns true if the given path is writable by the user, false otherwise.
BASE_EXPORT bool PathIsWritable(const FilePath& path); BASE_EXPORT bool PathIsWritable(const base::FilePath& path);
// Returns true if the given path exists and is a directory, false otherwise. // Returns true if the given path exists and is a directory, false otherwise.
BASE_EXPORT bool DirectoryExists(const FilePath& path); BASE_EXPORT bool DirectoryExists(const base::FilePath& path);
// Returns true if the contents of the two files given are equal, false // Returns true if the contents of the two files given are equal, false
// otherwise. If either file can't be read, returns false. // otherwise. If either file can't be read, returns false.
BASE_EXPORT bool ContentsEqual(const FilePath& filename1, BASE_EXPORT bool ContentsEqual(const base::FilePath& filename1,
const FilePath& filename2); const base::FilePath& filename2);
// Returns true if the contents of the two text files given are equal, false // Returns true if the contents of the two text files given are equal, false
// otherwise. This routine treats "\r\n" and "\n" as equivalent. // otherwise. This routine treats "\r\n" and "\n" as equivalent.
BASE_EXPORT bool TextContentsEqual(const FilePath& filename1, BASE_EXPORT bool TextContentsEqual(const base::FilePath& filename1,
const FilePath& filename2); const base::FilePath& filename2);
// Read the file at |path| into |contents|, returning true on success. // Read the file at |path| into |contents|, returning true on success.
// This function fails if the |path| contains path traversal components ('..'). // This function fails if the |path| contains path traversal components ('..').
// |contents| may be NULL, in which case this function is useful for its // |contents| may be NULL, in which case this function is useful for its
// side effect of priming the disk cache. // side effect of priming the disk cache.
// Useful for unit tests. // Useful for unit tests.
BASE_EXPORT bool ReadFileToString(const FilePath& path, std::string* contents); BASE_EXPORT bool ReadFileToString(const base::FilePath& path,
std::string* contents);
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Read exactly |bytes| bytes from file descriptor |fd|, storing the result // Read exactly |bytes| bytes from file descriptor |fd|, storing the result
@@ -178,12 +182,13 @@ BASE_EXPORT bool ReadFromFD(int fd, char* buffer, size_t bytes);
// Creates a symbolic link at |symlink| pointing to |target|. Returns // Creates a symbolic link at |symlink| pointing to |target|. Returns
// false on failure. // false on failure.
BASE_EXPORT bool CreateSymbolicLink(const FilePath& target, BASE_EXPORT bool CreateSymbolicLink(const base::FilePath& target,
const FilePath& symlink); const base::FilePath& symlink);
// Reads the given |symlink| and returns where it points to in |target|. // Reads the given |symlink| and returns where it points to in |target|.
// Returns false upon failure. // Returns false upon failure.
BASE_EXPORT bool ReadSymbolicLink(const FilePath& symlink, FilePath* target); BASE_EXPORT bool ReadSymbolicLink(const base::FilePath& symlink,
base::FilePath* target);
// Bits ans masks of the file permission. // Bits ans masks of the file permission.
enum FilePermissionBits { enum FilePermissionBits {
@@ -206,11 +211,11 @@ enum FilePermissionBits {
// Reads the permission of the given |path|, storing the file permission // Reads the permission of the given |path|, storing the file permission
// bits in |mode|. If |path| is symbolic link, |mode| is the permission of // bits in |mode|. If |path| is symbolic link, |mode| is the permission of
// a file which the symlink points to. // a file which the symlink points to.
BASE_EXPORT bool GetPosixFilePermissions(const FilePath& path, BASE_EXPORT bool GetPosixFilePermissions(const base::FilePath& path,
int* mode); int* mode);
// Sets the permission of the given |path|. If |path| is symbolic link, sets // Sets the permission of the given |path|. If |path| is symbolic link, sets
// the permission of a file which the symlink points to. // the permission of a file which the symlink points to.
BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, BASE_EXPORT bool SetPosixFilePermissions(const base::FilePath& path,
int mode); int mode);
#endif // defined(OS_POSIX) #endif // defined(OS_POSIX)
@@ -219,74 +224,76 @@ BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path,
// Returns true if all operations succeed. // Returns true if all operations succeed.
// This function simulates Move(), but unlike Move() it works across volumes. // This function simulates Move(), but unlike Move() it works across volumes.
// This fuction is not transactional. // This fuction is not transactional.
BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, BASE_EXPORT bool CopyAndDeleteDirectory(const base::FilePath& from_path,
const FilePath& to_path); const base::FilePath& to_path);
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
// Return true if the given directory is empty // Return true if the given directory is empty
BASE_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path); BASE_EXPORT bool IsDirectoryEmpty(const base::FilePath& dir_path);
// Get the temporary directory provided by the system. // Get the temporary directory provided by the system.
// WARNING: DON'T USE THIS. If you want to create a temporary file, use one of // WARNING: DON'T USE THIS. If you want to create a temporary file, use one of
// the functions below. // the functions below.
BASE_EXPORT bool GetTempDir(FilePath* path); BASE_EXPORT bool GetTempDir(base::FilePath* path);
// Get a temporary directory for shared memory files. // Get a temporary directory for shared memory files.
// Only useful on POSIX; redirects to GetTempDir() on Windows. // Only useful on POSIX; redirects to GetTempDir() on Windows.
BASE_EXPORT bool GetShmemTempDir(FilePath* path, bool executable); BASE_EXPORT bool GetShmemTempDir(base::FilePath* path, bool executable);
// Get the home directory. This is more complicated than just getenv("HOME") // Get the home directory. This is more complicated than just getenv("HOME")
// as it knows to fall back on getpwent() etc. // as it knows to fall back on getpwent() etc.
BASE_EXPORT FilePath GetHomeDir(); BASE_EXPORT base::FilePath GetHomeDir();
// Creates a temporary file. The full path is placed in |path|, and the // Creates a temporary file. The full path is placed in |path|, and the
// function returns true if was successful in creating the file. The file will // function returns true if was successful in creating the file. The file will
// be empty and all handles closed after this function returns. // be empty and all handles closed after this function returns.
BASE_EXPORT bool CreateTemporaryFile(FilePath* path); BASE_EXPORT bool CreateTemporaryFile(base::FilePath* path);
// Same as CreateTemporaryFile but the file is created in |dir|. // Same as CreateTemporaryFile but the file is created in |dir|.
BASE_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir, BASE_EXPORT bool CreateTemporaryFileInDir(const base::FilePath& dir,
FilePath* temp_file); base::FilePath* temp_file);
// Create and open a temporary file. File is opened for read/write. // Create and open a temporary file. File is opened for read/write.
// The full path is placed in |path|. // The full path is placed in |path|.
// Returns a handle to the opened file or NULL if an error occured. // Returns a handle to the opened file or NULL if an error occured.
BASE_EXPORT FILE* CreateAndOpenTemporaryFile(FilePath* path); BASE_EXPORT FILE* CreateAndOpenTemporaryFile(base::FilePath* path);
// Like above but for shmem files. Only useful for POSIX. // Like above but for shmem files. Only useful for POSIX.
// The executable flag says the file needs to support using // The executable flag says the file needs to support using
// mprotect with PROT_EXEC after mapping. // mprotect with PROT_EXEC after mapping.
BASE_EXPORT FILE* CreateAndOpenTemporaryShmemFile(FilePath* path, BASE_EXPORT FILE* CreateAndOpenTemporaryShmemFile(base::FilePath* path,
bool executable); bool executable);
// Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|.
BASE_EXPORT FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, BASE_EXPORT FILE* CreateAndOpenTemporaryFileInDir(const base::FilePath& dir,
FilePath* path); base::FilePath* path);
// Create a new directory. If prefix is provided, the new directory name is in // Create a new directory. If prefix is provided, the new directory name is in
// the format of prefixyyyy. // the format of prefixyyyy.
// NOTE: prefix is ignored in the POSIX implementation. // NOTE: prefix is ignored in the POSIX implementation.
// If success, return true and output the full path of the directory created. // If success, return true and output the full path of the directory created.
BASE_EXPORT bool CreateNewTempDirectory(const FilePath::StringType& prefix, BASE_EXPORT bool CreateNewTempDirectory(
FilePath* new_temp_path); const base::FilePath::StringType& prefix,
base::FilePath* new_temp_path);
// Create a directory within another directory. // Create a directory within another directory.
// Extra characters will be appended to |prefix| to ensure that the // Extra characters will be appended to |prefix| to ensure that the
// new directory does not have the same name as an existing directory. // new directory does not have the same name as an existing directory.
BASE_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir, BASE_EXPORT bool CreateTemporaryDirInDir(
const FilePath::StringType& prefix, const base::FilePath& base_dir,
FilePath* new_dir); const base::FilePath::StringType& prefix,
base::FilePath* new_dir);
// Creates a directory, as well as creating any parent directories, if they // Creates a directory, as well as creating any parent directories, if they
// don't exist. Returns 'true' on successful creation, or if the directory // don't exist. Returns 'true' on successful creation, or if the directory
// already exists. The directory is only readable by the current user. // already exists. The directory is only readable by the current user.
BASE_EXPORT bool CreateDirectory(const FilePath& full_path); BASE_EXPORT bool CreateDirectory(const base::FilePath& full_path);
// Returns the file size. Returns true on success. // Returns the file size. Returns true on success.
BASE_EXPORT bool GetFileSize(const FilePath& file_path, int64* file_size); BASE_EXPORT bool GetFileSize(const base::FilePath& file_path, int64* file_size);
// Returns true if the given path's base name is ".". // Returns true if the given path's base name is ".".
BASE_EXPORT bool IsDot(const FilePath& path); BASE_EXPORT bool IsDot(const base::FilePath& path);
// Returns true if the given path's base name is "..". // Returns true if the given path's base name is "..".
BASE_EXPORT bool IsDotDot(const FilePath& path); BASE_EXPORT bool IsDotDot(const base::FilePath& path);
// Sets |real_path| to |path| with symbolic links and junctions expanded. // Sets |real_path| to |path| with symbolic links and junctions expanded.
// On windows, make sure the path starts with a lettered drive. // On windows, make sure the path starts with a lettered drive.
@@ -294,47 +301,48 @@ BASE_EXPORT bool IsDotDot(const FilePath& path);
// a directory or to a nonexistent path. On windows, this function will // a directory or to a nonexistent path. On windows, this function will
// fail if |path| is a junction or symlink that points to an empty file, // fail if |path| is a junction or symlink that points to an empty file,
// or if |real_path| would be longer than MAX_PATH characters. // or if |real_path| would be longer than MAX_PATH characters.
BASE_EXPORT bool NormalizeFilePath(const FilePath& path, FilePath* real_path); BASE_EXPORT bool NormalizeFilePath(const base::FilePath& path,
base::FilePath* real_path);
#if defined(OS_WIN) #if defined(OS_WIN)
// Given a path in NT native form ("\Device\HarddiskVolumeXX\..."), // Given a path in NT native form ("\Device\HarddiskVolumeXX\..."),
// return in |drive_letter_path| the equivalent path that starts with // return in |drive_letter_path| the equivalent path that starts with
// a drive letter ("C:\..."). Return false if no such path exists. // a drive letter ("C:\..."). Return false if no such path exists.
BASE_EXPORT bool DevicePathToDriveLetterPath(const FilePath& device_path, BASE_EXPORT bool DevicePathToDriveLetterPath(const base::FilePath& device_path,
FilePath* drive_letter_path); base::FilePath* drive_letter_path);
// Given an existing file in |path|, set |real_path| to the path // Given an existing file in |path|, set |real_path| to the path
// in native NT format, of the form "\Device\HarddiskVolumeXX\..". // in native NT format, of the form "\Device\HarddiskVolumeXX\..".
// Returns false if the path can not be found. Empty files cannot // Returns false if the path can not be found. Empty files cannot
// be resolved with this function. // be resolved with this function.
BASE_EXPORT bool NormalizeToNativeFilePath(const FilePath& path, BASE_EXPORT bool NormalizeToNativeFilePath(const base::FilePath& path,
FilePath* nt_path); base::FilePath* nt_path);
#endif #endif
// This function will return if the given file is a symlink or not. // This function will return if the given file is a symlink or not.
BASE_EXPORT bool IsLink(const FilePath& file_path); BASE_EXPORT bool IsLink(const base::FilePath& file_path);
// Returns information about the given file path. // Returns information about the given file path.
BASE_EXPORT bool GetFileInfo(const FilePath& file_path, BASE_EXPORT bool GetFileInfo(const base::FilePath& file_path,
base::PlatformFileInfo* info); base::PlatformFileInfo* info);
// Sets the time of the last access and the time of the last modification. // Sets the time of the last access and the time of the last modification.
BASE_EXPORT bool TouchFile(const FilePath& path, BASE_EXPORT bool TouchFile(const base::FilePath& path,
const base::Time& last_accessed, const base::Time& last_accessed,
const base::Time& last_modified); const base::Time& last_modified);
// Set the time of the last modification. Useful for unit tests. // Set the time of the last modification. Useful for unit tests.
BASE_EXPORT bool SetLastModifiedTime(const FilePath& path, BASE_EXPORT bool SetLastModifiedTime(const base::FilePath& path,
const base::Time& last_modified); const base::Time& last_modified);
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Store inode number of |path| in |inode|. Return true on success. // Store inode number of |path| in |inode|. Return true on success.
BASE_EXPORT bool GetInode(const FilePath& path, ino_t* inode); BASE_EXPORT bool GetInode(const base::FilePath& path, ino_t* inode);
#endif #endif
// Wrapper for fopen-like calls. Returns non-NULL FILE* on success. // Wrapper for fopen-like calls. Returns non-NULL FILE* on success.
BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode); BASE_EXPORT FILE* OpenFile(const base::FilePath& filename, const char* mode);
// Closes file opened by OpenFile. Returns true on success. // Closes file opened by OpenFile. Returns true on success.
BASE_EXPORT bool CloseFile(FILE* file); BASE_EXPORT bool CloseFile(FILE* file);
@@ -345,32 +353,33 @@ BASE_EXPORT bool TruncateFile(FILE* file);
// Reads the given number of bytes from the file into the buffer. Returns // Reads the given number of bytes from the file into the buffer. Returns
// the number of read bytes, or -1 on error. // the number of read bytes, or -1 on error.
BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int size); BASE_EXPORT int ReadFile(const base::FilePath& filename, char* data, int size);
// Writes the given buffer into the file, overwriting any data that was // Writes the given buffer into the file, overwriting any data that was
// previously there. Returns the number of bytes written, or -1 on error. // previously there. Returns the number of bytes written, or -1 on error.
BASE_EXPORT int WriteFile(const FilePath& filename, const char* data, int size); BASE_EXPORT int WriteFile(const base::FilePath& filename, const char* data,
int size);
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Append the data to |fd|. Does not close |fd| when done. // Append the data to |fd|. Does not close |fd| when done.
BASE_EXPORT int WriteFileDescriptor(const int fd, const char* data, int size); BASE_EXPORT int WriteFileDescriptor(const int fd, const char* data, int size);
#endif #endif
// Append the given buffer into the file. Returns the number of bytes written, // Append the given buffer into the file. Returns the number of bytes written,
// or -1 on error. // or -1 on error.
BASE_EXPORT int AppendToFile(const FilePath& filename, BASE_EXPORT int AppendToFile(const base::FilePath& filename,
const char* data, int size); const char* data, int size);
// Gets the current working directory for the process. // Gets the current working directory for the process.
BASE_EXPORT bool GetCurrentDirectory(FilePath* path); BASE_EXPORT bool GetCurrentDirectory(base::FilePath* path);
// Sets the current working directory for the process. // Sets the current working directory for the process.
BASE_EXPORT bool SetCurrentDirectory(const FilePath& path); BASE_EXPORT bool SetCurrentDirectory(const base::FilePath& path);
// Attempts to find a number that can be appended to the |path| to make it // Attempts to find a number that can be appended to the |path| to make it
// unique. If |path| does not exist, 0 is returned. If it fails to find such // unique. If |path| does not exist, 0 is returned. If it fails to find such
// a number, -1 is returned. If |suffix| is not empty, also checks the // a number, -1 is returned. If |suffix| is not empty, also checks the
// existence of it with the given suffix. // existence of it with the given suffix.
BASE_EXPORT int GetUniquePathNumber(const FilePath& path, BASE_EXPORT int GetUniquePathNumber(const base::FilePath& path,
const FilePath::StringType& suffix); const base::FilePath::StringType& suffix);
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Test that |path| can only be changed by a given user and members of // Test that |path| can only be changed by a given user and members of
@@ -384,8 +393,8 @@ BASE_EXPORT int GetUniquePathNumber(const FilePath& path,
// * Are not symbolic links. // * Are not symbolic links.
// This is useful for checking that a config file is administrator-controlled. // This is useful for checking that a config file is administrator-controlled.
// |base| must contain |path|. // |base| must contain |path|.
BASE_EXPORT bool VerifyPathControlledByUser(const FilePath& base, BASE_EXPORT bool VerifyPathControlledByUser(const base::FilePath& base,
const FilePath& path, const base::FilePath& path,
uid_t owner_uid, uid_t owner_uid,
const std::set<gid_t>& group_gids); const std::set<gid_t>& group_gids);
#endif // defined(OS_POSIX) #endif // defined(OS_POSIX)
@@ -398,7 +407,7 @@ BASE_EXPORT bool VerifyPathControlledByUser(const FilePath& base,
// the filesystem, are owned by the superuser, controlled by the group // the filesystem, are owned by the superuser, controlled by the group
// "admin", are not writable by all users, and contain no symbolic links. // "admin", are not writable by all users, and contain no symbolic links.
// Will return false if |path| does not exist. // Will return false if |path| does not exist.
BASE_EXPORT bool VerifyPathControlledByAdmin(const FilePath& path); BASE_EXPORT bool VerifyPathControlledByAdmin(const base::FilePath& path);
#endif // defined(OS_MACOSX) && !defined(OS_IOS) #endif // defined(OS_MACOSX) && !defined(OS_IOS)
// A class to handle auto-closing of FILE*'s. // A class to handle auto-closing of FILE*'s.
@@ -473,17 +482,17 @@ class BASE_EXPORT FileEnumerator {
// NOTE: the pattern only matches the contents of root_path, not files in // NOTE: the pattern only matches the contents of root_path, not files in
// recursive subdirectories. // recursive subdirectories.
// TODO(erikkay): Fix the pattern matching to work at all levels. // TODO(erikkay): Fix the pattern matching to work at all levels.
FileEnumerator(const FilePath& root_path, FileEnumerator(const base::FilePath& root_path,
bool recursive, bool recursive,
int file_type); int file_type);
FileEnumerator(const FilePath& root_path, FileEnumerator(const base::FilePath& root_path,
bool recursive, bool recursive,
int file_type, int file_type,
const FilePath::StringType& pattern); const base::FilePath::StringType& pattern);
~FileEnumerator(); ~FileEnumerator();
// Returns an empty string if there are no more results. // Returns an empty string if there are no more results.
FilePath Next(); base::FilePath Next();
// Write the file info into |info|. // Write the file info into |info|.
void GetFindInfo(FindInfo* info); void GetFindInfo(FindInfo* info);
@@ -491,13 +500,13 @@ class BASE_EXPORT FileEnumerator {
// Looks inside a FindInfo and determines if it's a directory. // Looks inside a FindInfo and determines if it's a directory.
static bool IsDirectory(const FindInfo& info); static bool IsDirectory(const FindInfo& info);
static FilePath GetFilename(const FindInfo& find_info); static base::FilePath GetFilename(const FindInfo& find_info);
static int64 GetFilesize(const FindInfo& find_info); static int64 GetFilesize(const FindInfo& find_info);
static base::Time GetLastModifiedTime(const FindInfo& find_info); static base::Time GetLastModifiedTime(const FindInfo& find_info);
private: private:
// Returns true if the given path should be skipped in enumeration. // Returns true if the given path should be skipped in enumeration.
bool ShouldSkip(const FilePath& path); bool ShouldSkip(const base::FilePath& path);
#if defined(OS_WIN) #if defined(OS_WIN)
@@ -507,13 +516,13 @@ class BASE_EXPORT FileEnumerator {
HANDLE find_handle_; HANDLE find_handle_;
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
struct DirectoryEntryInfo { struct DirectoryEntryInfo {
FilePath filename; base::FilePath filename;
struct stat stat; struct stat stat;
}; };
// Read the filenames in source into the vector of DirectoryEntryInfo's // Read the filenames in source into the vector of DirectoryEntryInfo's
static bool ReadDirectory(std::vector<DirectoryEntryInfo>* entries, static bool ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
const FilePath& source, bool show_links); const base::FilePath& source, bool show_links);
// The files in the current directory // The files in the current directory
std::vector<DirectoryEntryInfo> directory_entries_; std::vector<DirectoryEntryInfo> directory_entries_;
@@ -522,14 +531,15 @@ class BASE_EXPORT FileEnumerator {
size_t current_directory_entry_; size_t current_directory_entry_;
#endif #endif
FilePath root_path_; base::FilePath root_path_;
bool recursive_; bool recursive_;
int file_type_; int file_type_;
FilePath::StringType pattern_; // Empty when we want to find everything. base::FilePath::StringType pattern_; // Empty when we want to find
// everything.
// A stack that keeps track of which subdirectories we still need to // A stack that keeps track of which subdirectories we still need to
// enumerate in the breadth-first search. // enumerate in the breadth-first search.
std::stack<FilePath> pending_paths_; std::stack<base::FilePath> pending_paths_;
DISALLOW_COPY_AND_ASSIGN(FileEnumerator); DISALLOW_COPY_AND_ASSIGN(FileEnumerator);
}; };
@@ -545,7 +555,7 @@ class BASE_EXPORT MemoryMappedFile {
// then this method will fail and return false. If it cannot open the file, // then this method will fail and return false. If it cannot open the file,
// the file does not exist, or the memory mapping fails, it will return false. // the file does not exist, or the memory mapping fails, it will return false.
// Later we may want to allow the user to specify access. // Later we may want to allow the user to specify access.
bool Initialize(const FilePath& file_name); bool Initialize(const base::FilePath& file_name);
// As above, but works with an already-opened file. MemoryMappedFile will take // As above, but works with an already-opened file. MemoryMappedFile will take
// ownership of |file| and close it when done. // ownership of |file| and close it when done.
bool Initialize(base::PlatformFile file); bool Initialize(base::PlatformFile file);
@@ -553,7 +563,7 @@ class BASE_EXPORT MemoryMappedFile {
#if defined(OS_WIN) #if defined(OS_WIN)
// Opens an existing file and maps it as an image section. Please refer to // Opens an existing file and maps it as an image section. Please refer to
// the Initialize function above for additional information. // the Initialize function above for additional information.
bool InitializeAsImageSection(const FilePath& file_name); bool InitializeAsImageSection(const base::FilePath& file_name);
#endif // OS_WIN #endif // OS_WIN
const uint8* data() const { return data_; } const uint8* data() const { return data_; }
@@ -564,7 +574,7 @@ class BASE_EXPORT MemoryMappedFile {
private: private:
// Open the given file and pass it to MapFileToMemoryInternal(). // Open the given file and pass it to MapFileToMemoryInternal().
bool MapFileToMemory(const FilePath& file_name); bool MapFileToMemory(const base::FilePath& file_name);
// Map the file to memory, set data_ to that memory address. Return true on // Map the file to memory, set data_ to that memory address. Return true on
// success, false on any kind of failure. This is a helper for Initialize(). // success, false on any kind of failure. This is a helper for Initialize().
@@ -609,7 +619,8 @@ enum FileSystemType {
// Attempts determine the FileSystemType for |path|. // Attempts determine the FileSystemType for |path|.
// Returns false if |path| doesn't exist. // Returns false if |path| doesn't exist.
BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); BASE_EXPORT bool GetFileSystemType(const base::FilePath& path,
FileSystemType* type);
#endif #endif
} // namespace file_util } // namespace file_util

@@ -18,7 +18,9 @@ extern "C" IMAGE_DOS_HEADER __ImageBase;
#include "base/base_export.h" #include "base/base_export.h"
#include "base/string16.h" #include "base/string16.h"
namespace base {
class FilePath; class FilePath;
}
// Provides an interface for accessing the version information for a file. This // Provides an interface for accessing the version information for a file. This
// is the information you access when you select a file in the Windows Explorer, // is the information you access when you select a file in the Windows Explorer,
@@ -38,7 +40,7 @@ class FileVersionInfo {
// goes wrong (typically the file does not exit or cannot be opened). The // goes wrong (typically the file does not exit or cannot be opened). The
// returned object should be deleted when you are done with it. // returned object should be deleted when you are done with it.
BASE_EXPORT static FileVersionInfo* CreateFileVersionInfo( BASE_EXPORT static FileVersionInfo* CreateFileVersionInfo(
const FilePath& file_path); const base::FilePath& file_path);
#endif // OS_WIN || OS_MACOSX #endif // OS_WIN || OS_MACOSX
#if defined(OS_WIN) #if defined(OS_WIN)

@@ -25,18 +25,18 @@ BASE_I18N_EXPORT bool IsFilenameLegal(const string16& file_name);
// file_name == "bad:file*name?.txt", changed to: "bad-file-name-.txt" when // file_name == "bad:file*name?.txt", changed to: "bad-file-name-.txt" when
// 'replace_char' is '-'. // 'replace_char' is '-'.
BASE_I18N_EXPORT void ReplaceIllegalCharactersInPath( BASE_I18N_EXPORT void ReplaceIllegalCharactersInPath(
FilePath::StringType* file_name, base::FilePath::StringType* file_name,
char replace_char); char replace_char);
// Compares two filenames using the current locale information. This can be // Compares two filenames using the current locale information. This can be
// used to sort directory listings. It behaves like "operator<" for use in // used to sort directory listings. It behaves like "operator<" for use in
// std::sort. // std::sort.
BASE_I18N_EXPORT bool LocaleAwareCompareFilenames(const FilePath& a, BASE_I18N_EXPORT bool LocaleAwareCompareFilenames(const base::FilePath& a,
const FilePath& b); const base::FilePath& b);
// Calculates the canonical file-system representation of |file_name| base name. // Calculates the canonical file-system representation of |file_name| base name.
// Modifies |file_name| in place. No-op if not on ChromeOS. // Modifies |file_name| in place. No-op if not on ChromeOS.
BASE_I18N_EXPORT void NormalizeFileNameEncoding(FilePath* file_name); BASE_I18N_EXPORT void NormalizeFileNameEncoding(base::FilePath* file_name);
} // namespace file_util } // namespace file_util

@@ -12,9 +12,10 @@
#include "base/string16.h" #include "base/string16.h"
#include "build/build_config.h" #include "build/build_config.h"
namespace base {
class FilePath; class FilePath;
namespace base {
namespace i18n { namespace i18n {
const char16 kRightToLeftMark = 0x200F; const char16 kRightToLeftMark = 0x200F;

@@ -15,9 +15,10 @@ class NSBundle;
class NSString; class NSString;
#endif // __OBJC__ #endif // __OBJC__
namespace base {
class FilePath; class FilePath;
namespace base {
namespace mac { namespace mac {
// This file provides several functions to explicitly request the various // This file provides several functions to explicitly request the various

@@ -28,8 +28,6 @@ class NSString;
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#endif #endif
class FilePath;
// Adapted from NSPathUtilities.h and NSObjCRuntime.h. // Adapted from NSPathUtilities.h and NSObjCRuntime.h.
#if __LP64__ || NS_BUILD_32_LIKE_64 #if __LP64__ || NS_BUILD_32_LIKE_64
typedef unsigned long NSSearchPathDirectory; typedef unsigned long NSSearchPathDirectory;
@@ -43,6 +41,9 @@ typedef struct OpaqueSecTrustRef* SecACLRef;
typedef struct OpaqueSecTrustedApplicationRef* SecTrustedApplicationRef; typedef struct OpaqueSecTrustedApplicationRef* SecTrustedApplicationRef;
namespace base { namespace base {
class FilePath;
namespace mac { namespace mac {
// Returns true if the application is running from a bundle // Returns true if the application is running from a bundle

@@ -21,9 +21,10 @@
class NSImage; class NSImage;
#endif // __OBJC__ #endif // __OBJC__
namespace base {
class FilePath; class FilePath;
namespace base {
namespace mac { namespace mac {
// Full screen modes, in increasing order of priority. More permissive modes // Full screen modes, in increasing order of priority. More permissive modes

@@ -26,10 +26,10 @@
#define CDECL #define CDECL
#endif #endif
class FilePath;
namespace base { namespace base {
class FilePath;
#if defined(OS_WIN) #if defined(OS_WIN)
typedef HMODULE NativeLibrary; typedef HMODULE NativeLibrary;
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)

@@ -10,9 +10,10 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "build/build_config.h" #include "build/build_config.h"
namespace base {
class FilePath; class FilePath;
namespace base {
namespace nix { namespace nix {
// Gets the mime type for a file based on its filename. The file path does not // Gets the mime type for a file based on its filename. The file path does not

@@ -18,11 +18,10 @@
#error asdf #error asdf
#endif #endif
class FilePath;
namespace base { namespace base {
class Environment; class Environment;
class FilePath;
namespace nix { namespace nix {

@@ -12,9 +12,8 @@
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "build/build_config.h" #include "build/build_config.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class ScopedPathOverride; class ScopedPathOverride;
} // namespace } // namespace
@@ -30,7 +29,7 @@ class BASE_EXPORT PathService {
// //
// Returns true if the directory or file was successfully retrieved. On // Returns true if the directory or file was successfully retrieved. On
// failure, 'path' will not be changed. // failure, 'path' will not be changed.
static bool Get(int key, FilePath* path); static bool Get(int key, base::FilePath* path);
// Overrides the path to a special directory or file. This cannot be used to // Overrides the path to a special directory or file. This cannot be used to
// change the value of DIR_CURRENT, but that should be obvious. Also, if the // change the value of DIR_CURRENT, but that should be obvious. Also, if the
@@ -42,13 +41,13 @@ class BASE_EXPORT PathService {
// //
// WARNING: Consumers of PathService::Get may expect paths to be constant // WARNING: Consumers of PathService::Get may expect paths to be constant
// over the lifetime of the app, so this method should be used with caution. // over the lifetime of the app, so this method should be used with caution.
static bool Override(int key, const FilePath& path); static bool Override(int key, const base::FilePath& path);
// This function does the same as PathService::Override but it takes an extra // This function does the same as PathService::Override but it takes an extra
// parameter |create| which guides whether the directory to be overriden must // parameter |create| which guides whether the directory to be overriden must
// be created in case it doesn't exist already. // be created in case it doesn't exist already.
static bool OverrideAndCreateIfNeeded(int key, static bool OverrideAndCreateIfNeeded(int key,
const FilePath& path, const base::FilePath& path,
bool create); bool create);
// To extend the set of supported keys, you can register a path provider, // To extend the set of supported keys, you can register a path provider,
@@ -59,7 +58,7 @@ class BASE_EXPORT PathService {
// WARNING: This function could be called on any thread from which the // WARNING: This function could be called on any thread from which the
// PathService is used, so a the ProviderFunc MUST BE THREADSAFE. // PathService is used, so a the ProviderFunc MUST BE THREADSAFE.
// //
typedef bool (*ProviderFunc)(int, FilePath*); typedef bool (*ProviderFunc)(int, base::FilePath*);
// Call to register a path provider. You must specify the range "[key_start, // Call to register a path provider. You must specify the range "[key_start,
// key_end)" of supported path keys. // key_end)" of supported path keys.

@@ -10,14 +10,16 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/time.h" #include "base/time.h"
namespace base {
class FilePath; class FilePath;
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Initializes and finalizes the perf log. These functions should be // Initializes and finalizes the perf log. These functions should be
// called at the beginning and end (respectively) of running all the // called at the beginning and end (respectively) of running all the
// performance tests. The init function returns true on success. // performance tests. The init function returns true on success.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
bool InitPerfLog(const FilePath& log_path); bool InitPerfLog(const base::FilePath& log_path);
void FinalizePerfLog(); void FinalizePerfLog();
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------

@@ -20,12 +20,12 @@
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
class FilePath;
class SequencedWorkerPool; class SequencedWorkerPool;
class SequencedTaskRunner; class SequencedTaskRunner;
class Value; class Value;
} }
class FilePath;
// A writable PrefStore implementation that is used for user preferences. // A writable PrefStore implementation that is used for user preferences.
class BASE_PREFS_EXPORT JsonPrefStore class BASE_PREFS_EXPORT JsonPrefStore
@@ -35,12 +35,12 @@ class BASE_PREFS_EXPORT JsonPrefStore
// Returns instance of SequencedTaskRunner which guarantees that file // Returns instance of SequencedTaskRunner which guarantees that file
// operations on the same file will be executed in sequenced order. // operations on the same file will be executed in sequenced order.
static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForFile( static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForFile(
const FilePath& pref_filename, const base::FilePath& pref_filename,
base::SequencedWorkerPool* worker_pool); base::SequencedWorkerPool* worker_pool);
// |sequenced_task_runner| is must be a shutdown-blocking task runner, ideally // |sequenced_task_runner| is must be a shutdown-blocking task runner, ideally
// created by GetTaskRunnerForFile() method above. // created by GetTaskRunnerForFile() method above.
JsonPrefStore(const FilePath& pref_filename, JsonPrefStore(const base::FilePath& pref_filename,
base::SequencedTaskRunner* sequenced_task_runner); base::SequencedTaskRunner* sequenced_task_runner);
// PrefStore overrides: // PrefStore overrides:
@@ -78,7 +78,7 @@ class BASE_PREFS_EXPORT JsonPrefStore
// ImportantFileWriter::DataSerializer overrides: // ImportantFileWriter::DataSerializer overrides:
virtual bool SerializeData(std::string* output) OVERRIDE; virtual bool SerializeData(std::string* output) OVERRIDE;
FilePath path_; base::FilePath path_;
const scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; const scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_;
scoped_ptr<base::DictionaryValue> prefs_; scoped_ptr<base::DictionaryValue> prefs_;

@@ -18,6 +18,10 @@
#include "base/values.h" #include "base/values.h"
namespace base {
class FilePath;
}
namespace content { namespace content {
class BrowserContext; class BrowserContext;
} }
@@ -26,7 +30,6 @@ namespace subtle {
class PrefMemberBase; class PrefMemberBase;
} }
class FilePath;
class PrefObserver; class PrefObserver;
class PrefServiceBase { class PrefServiceBase {
@@ -118,7 +121,7 @@ class PrefServiceBase {
virtual int GetInteger(const char* path) const = 0; virtual int GetInteger(const char* path) const = 0;
virtual double GetDouble(const char* path) const = 0; virtual double GetDouble(const char* path) const = 0;
virtual std::string GetString(const char* path) const = 0; virtual std::string GetString(const char* path) const = 0;
virtual FilePath GetFilePath(const char* path) const = 0; virtual base::FilePath GetFilePath(const char* path) const = 0;
// Returns the branch if it exists, or the registered default value otherwise. // Returns the branch if it exists, or the registered default value otherwise.
// Note that |path| must point to a registered preference. In that case, these // Note that |path| must point to a registered preference. In that case, these
@@ -140,7 +143,7 @@ class PrefServiceBase {
virtual void SetInteger(const char* path, int value) = 0; virtual void SetInteger(const char* path, int value) = 0;
virtual void SetDouble(const char* path, double value) = 0; virtual void SetDouble(const char* path, double value) = 0;
virtual void SetString(const char* path, const std::string& value) = 0; virtual void SetString(const char* path, const std::string& value) = 0;
virtual void SetFilePath(const char* path, const FilePath& value) = 0; virtual void SetFilePath(const char* path, const base::FilePath& value) = 0;
// Int64 helper methods that actually store the given value as a string. // Int64 helper methods that actually store the given value as a string.
// Note that if obtaining the named value via GetDictionary or GetList, the // Note that if obtaining the named value via GetDictionary or GetList, the

@@ -8,10 +8,10 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/native_library.h" #include "base/native_library.h"
class FilePath;
namespace base { namespace base {
class FilePath;
// A class which encapsulates a base::NativeLibrary object available only in a // A class which encapsulates a base::NativeLibrary object available only in a
// scope. // scope.
// This class automatically unloads the loaded library in its destructor. // This class automatically unloads the loaded library in its destructor.

@@ -23,10 +23,10 @@
#include "base/file_descriptor_posix.h" #include "base/file_descriptor_posix.h"
#endif #endif
class FilePath;
namespace base { namespace base {
class FilePath;
// SharedMemoryHandle is a platform specific type which represents // SharedMemoryHandle is a platform specific type which represents
// the underlying OS handle to a shared memory segment. // the underlying OS handle to a shared memory segment.
#if defined(OS_WIN) #if defined(OS_WIN)

@@ -8,10 +8,10 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
class FilePath;
namespace base { namespace base {
class FilePath;
// Sets a path override on construction, and removes it when the object goes out // Sets a path override on construction, and removes it when the object goes out
// of scope. This class is intended to be used by tests that need to override // of scope. This class is intended to be used by tests that need to override
// paths to ensure their overrides are properly handled and reverted when the // paths to ensure their overrides are properly handled and reverted when the

@@ -12,18 +12,20 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/file_path.h" #include "base/file_path.h"
namespace base {
class FilePath; class FilePath;
}
namespace file_util { namespace file_util {
// Wrapper over file_util::Delete. On Windows repeatedly invokes Delete in case // Wrapper over file_util::Delete. On Windows repeatedly invokes Delete in case
// of failure to workaround Windows file locking semantics. Returns true on // of failure to workaround Windows file locking semantics. Returns true on
// success. // success.
bool DieFileDie(const FilePath& file, bool recurse); bool DieFileDie(const base::FilePath& file, bool recurse);
// Clear a specific file from the system cache. After this call, trying // Clear a specific file from the system cache. After this call, trying
// to access this file will result in a cold load from the hard drive. // to access this file will result in a cold load from the hard drive.
bool EvictFileFromSystemCache(const FilePath& file); bool EvictFileFromSystemCache(const base::FilePath& file);
// Like CopyFileNoCache but recursively copies all files and subdirectories // Like CopyFileNoCache but recursively copies all files and subdirectories
// in the given input directory to the output directory. Any files in the // in the given input directory to the output directory. Any files in the
@@ -31,39 +33,39 @@ bool EvictFileFromSystemCache(const FilePath& file);
// //
// Returns true on success. False means there was some error copying, so the // Returns true on success. False means there was some error copying, so the
// state of the destination is unknown. // state of the destination is unknown.
bool CopyRecursiveDirNoCache(const FilePath& source_dir, bool CopyRecursiveDirNoCache(const base::FilePath& source_dir,
const FilePath& dest_dir); const base::FilePath& dest_dir);
#if defined(OS_WIN) #if defined(OS_WIN)
// Returns true if the volume supports Alternate Data Streams. // Returns true if the volume supports Alternate Data Streams.
bool VolumeSupportsADS(const FilePath& path); bool VolumeSupportsADS(const base::FilePath& path);
// Returns true if the ZoneIdentifier is correctly set to "Internet" (3). // Returns true if the ZoneIdentifier is correctly set to "Internet" (3).
// Note that this function must be called from the same process as // Note that this function must be called from the same process as
// the one that set the zone identifier. I.e. don't use it in UI/automation // the one that set the zone identifier. I.e. don't use it in UI/automation
// based tests. // based tests.
bool HasInternetZoneIdentifier(const FilePath& full_path); bool HasInternetZoneIdentifier(const base::FilePath& full_path);
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
// In general it's not reliable to convert a FilePath to a wstring and we use // In general it's not reliable to convert a FilePath to a wstring and we use
// string16 elsewhere for Unicode strings, but in tests it is frequently // string16 elsewhere for Unicode strings, but in tests it is frequently
// convenient to be able to compare paths to literals like L"foobar". // convenient to be able to compare paths to literals like L"foobar".
std::wstring FilePathAsWString(const FilePath& path); std::wstring FilePathAsWString(const base::FilePath& path);
FilePath WStringAsFilePath(const std::wstring& path); base::FilePath WStringAsFilePath(const std::wstring& path);
// For testing, make the file unreadable or unwritable. // For testing, make the file unreadable or unwritable.
// In POSIX, this does not apply to the root user. // In POSIX, this does not apply to the root user.
bool MakeFileUnreadable(const FilePath& path) WARN_UNUSED_RESULT; bool MakeFileUnreadable(const base::FilePath& path) WARN_UNUSED_RESULT;
bool MakeFileUnwritable(const FilePath& path) WARN_UNUSED_RESULT; bool MakeFileUnwritable(const base::FilePath& path) WARN_UNUSED_RESULT;
// Saves the current permissions for a path, and restores it on destruction. // Saves the current permissions for a path, and restores it on destruction.
class PermissionRestorer { class PermissionRestorer {
public: public:
explicit PermissionRestorer(const FilePath& path); explicit PermissionRestorer(const base::FilePath& path);
~PermissionRestorer(); ~PermissionRestorer();
private: private:
const FilePath path_; const base::FilePath path_;
void* info_; // The opaque stored permission information. void* info_; // The opaque stored permission information.
size_t length_; // The length of the stored permission information. size_t length_; // The length of the stored permission information.

@@ -9,10 +9,10 @@
#include "base/base_export.h" #include "base/base_export.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class TimeDelta; class TimeDelta;
class StringValue; class StringValue;
class Value; class Value;

@@ -5,11 +5,13 @@
#ifndef CHROME_APP_CHROME_MAIN_MAC_H_ #ifndef CHROME_APP_CHROME_MAIN_MAC_H_
#define CHROME_APP_CHROME_MAIN_MAC_H_ #define CHROME_APP_CHROME_MAIN_MAC_H_
namespace base {
class FilePath; class FilePath;
}
// Checks if the UserDataDir policy has been set and returns its value in the // Checks if the UserDataDir policy has been set and returns its value in the
// |user_data_dir| parameter. If no policy is set the parameter is not changed. // |user_data_dir| parameter. If no policy is set the parameter is not changed.
void CheckUserDataDirPolicy(FilePath* user_data_dir); void CheckUserDataDirPolicy(base::FilePath* user_data_dir);
// Sets the app bundle (base::mac::FrameworkBundle()) to the framework's bundle, // Sets the app bundle (base::mac::FrameworkBundle()) to the framework's bundle,
// and sets the base bundle ID (base::mac::BaseBundleID()) to the proper value // and sets the base bundle ID (base::mac::BaseBundleID()) to the proper value

@@ -44,7 +44,6 @@ class AutomationTabTracker;
class AutomationWindowTracker; class AutomationWindowTracker;
class Browser; class Browser;
class ExternalTabContainer; class ExternalTabContainer;
class FilePath;
class FindInPageNotificationObserver; class FindInPageNotificationObserver;
class InitialLoadObserver; class InitialLoadObserver;
class LoginHandler; class LoginHandler;

@@ -11,7 +11,9 @@
@class NSString; @class NSString;
#endif // __OBJC__ #endif // __OBJC__
namespace base {
class FilePath; class FilePath;
}
// This set of functions lets C++ code interact with the cocoa pasteboard // This set of functions lets C++ code interact with the cocoa pasteboard
// and dragging methods. // and dragging methods.
@@ -25,12 +27,12 @@ enum PasteboardType {
// Writes a set of bookmark elements from a profile to the specified pasteboard. // Writes a set of bookmark elements from a profile to the specified pasteboard.
void WriteToPasteboard(PasteboardType type, void WriteToPasteboard(PasteboardType type,
const std::vector<BookmarkNodeData::Element>& elements, const std::vector<BookmarkNodeData::Element>& elements,
const FilePath& profile_path); const base::FilePath& profile_path);
// Reads a set of bookmark elements from the specified pasteboard. // Reads a set of bookmark elements from the specified pasteboard.
bool ReadFromPasteboard(PasteboardType type, bool ReadFromPasteboard(PasteboardType type,
std::vector<BookmarkNodeData::Element>& elements, std::vector<BookmarkNodeData::Element>& elements,
FilePath* profile_path); base::FilePath* profile_path);
// Returns true if the specified pasteboard contains any sort of // Returns true if the specified pasteboard contains any sort of
// bookmark elements. It currently does not consider a plaintext url a // bookmark elements. It currently does not consider a plaintext url a

@@ -16,11 +16,11 @@
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_fetcher_delegate.h"
class FilePath;
class PrefServiceSimple; class PrefServiceSimple;
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
class FilePath;
} }
namespace net { namespace net {
@@ -44,7 +44,7 @@ class CustomizationDocument {
protected: protected:
explicit CustomizationDocument(const std::string& accepted_version); explicit CustomizationDocument(const std::string& accepted_version);
virtual bool LoadManifestFromFile(const FilePath& manifest_path); virtual bool LoadManifestFromFile(const base::FilePath& manifest_path);
virtual bool LoadManifestFromString(const std::string& manifest); virtual bool LoadManifestFromString(const std::string& manifest);
std::string GetLocaleSpecificString(const std::string& locale, std::string GetLocaleSpecificString(const std::string& locale,
@@ -158,7 +158,7 @@ class ServicesCustomizationDocument : public CustomizationDocument,
void StartFileFetch(); void StartFileFetch();
// Executes on FILE thread and reads file to string. // Executes on FILE thread and reads file to string.
void ReadFileInBackground(const FilePath& file); void ReadFileInBackground(const base::FilePath& file);
// Services customization manifest URL. // Services customization manifest URL.
GURL url_; GURL url_;

@@ -7,7 +7,9 @@
#include <string> #include <string>
namespace base {
class FilePath; class FilePath;
}
namespace drive { namespace drive {
@@ -18,7 +20,7 @@ class DriveFeedLoaderObserver {
// Triggered when a content of a directory has been changed. // Triggered when a content of a directory has been changed.
// |directory_path| is a virtual directory path representing the // |directory_path| is a virtual directory path representing the
// changed directory. // changed directory.
virtual void OnDirectoryChanged(const FilePath& directory_path) { virtual void OnDirectoryChanged(const base::FilePath& directory_path) {
} }
// Triggered when a resource list is fetched. |num_accumulated_entries| // Triggered when a resource list is fetched. |num_accumulated_entries|

@@ -7,7 +7,9 @@
#include "chrome/browser/chromeos/drive/drive_file_error.h" #include "chrome/browser/chromeos/drive/drive_file_error.h"
namespace base {
class FilePath; class FilePath;
}
namespace drive { namespace drive {
@@ -19,7 +21,7 @@ class DriveFileSystemObserver {
// Triggered when a content of a directory has been changed. // Triggered when a content of a directory has been changed.
// |directory_path| is a virtual directory path (/drive/...) representing // |directory_path| is a virtual directory path (/drive/...) representing
// changed directory. // changed directory.
virtual void OnDirectoryChanged(const FilePath& directory_path) { virtual void OnDirectoryChanged(const base::FilePath& directory_path) {
} }
// Triggered when the file system is initially loaded. // Triggered when the file system is initially loaded.

@@ -16,9 +16,12 @@
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
class FilePath;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace drive { namespace drive {
class PlatformFileInfoProto; class PlatformFileInfoProto;
@@ -39,13 +42,13 @@ const char kWildCard[] = "*";
const char kSymLinkToDevNull[] = "/dev/null"; const char kSymLinkToDevNull[] = "/dev/null";
// Returns the Drive mount point path, which looks like "/special/drive". // Returns the Drive mount point path, which looks like "/special/drive".
const FilePath& GetDriveMountPointPath(); const base::FilePath& GetDriveMountPointPath();
// Returns the Drive mount path as string. // Returns the Drive mount path as string.
const std::string& GetDriveMountPointPathAsString(); const std::string& GetDriveMountPointPathAsString();
// Returns the 'local' root of remote file system as "/special". // Returns the 'local' root of remote file system as "/special".
const FilePath& GetSpecialRemoteRootPath(); const base::FilePath& GetSpecialRemoteRootPath();
// Returns the gdata file resource url formatted as // Returns the gdata file resource url formatted as
// chrome://drive/<resource_id>/<file_name>. // chrome://drive/<resource_id>/<file_name>.
@@ -54,16 +57,16 @@ GURL GetFileResourceUrl(const std::string& resource_id,
// Given a profile and a drive_cache_path, return the file resource url. // Given a profile and a drive_cache_path, return the file resource url.
void ModifyDriveFileResourceUrl(Profile* profile, void ModifyDriveFileResourceUrl(Profile* profile,
const FilePath& drive_cache_path, const base::FilePath& drive_cache_path,
GURL* url); GURL* url);
// Returns true if the given path is under the Drive mount point. // Returns true if the given path is under the Drive mount point.
bool IsUnderDriveMountPoint(const FilePath& path); bool IsUnderDriveMountPoint(const base::FilePath& path);
// Extracts the Drive path from the given path located under the Drive mount // Extracts the Drive path from the given path located under the Drive mount
// point. Returns an empty path if |path| is not under the Drive mount point. // point. Returns an empty path if |path| is not under the Drive mount point.
// Examples: ExtractGDatPath("/special/drive/foo.txt") => "drive/foo.txt" // Examples: ExtractGDatPath("/special/drive/foo.txt") => "drive/foo.txt"
FilePath ExtractDrivePath(const FilePath& path); base::FilePath ExtractDrivePath(const base::FilePath& path);
// Escapes a file name in Drive cache. // Escapes a file name in Drive cache.
// Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex)
@@ -90,13 +93,13 @@ std::string ExtractResourceIdFromUrl(const GURL& url);
// Case 3: Mounted files have all three parts. // Case 3: Mounted files have all three parts.
// Example: path="/user/GCache/v1/persistent/pdf:a1b2.01234567.mounted" => // Example: path="/user/GCache/v1/persistent/pdf:a1b2.01234567.mounted" =>
// resource_id="pdf:a1b2", md5="01234567", extra_extension="mounted". // resource_id="pdf:a1b2", md5="01234567", extra_extension="mounted".
void ParseCacheFilePath(const FilePath& path, void ParseCacheFilePath(const base::FilePath& path,
std::string* resource_id, std::string* resource_id,
std::string* md5, std::string* md5,
std::string* extra_extension); std::string* extra_extension);
// Callback type for PrepareWritableFilePathAndRun. // Callback type for PrepareWritablebase::FilePathAndRun.
typedef base::Callback<void (DriveFileError, const FilePath& path)> typedef base::Callback<void (DriveFileError, const base::FilePath& path)>
OpenFileCallback; OpenFileCallback;
// Invokes |callback| on blocking thread pool, after converting virtual |path| // Invokes |callback| on blocking thread pool, after converting virtual |path|
@@ -108,7 +111,7 @@ typedef base::Callback<void (DriveFileError, const FilePath& path)>
// //
// Must be called from UI thread. // Must be called from UI thread.
void PrepareWritableFileAndRun(Profile* profile, void PrepareWritableFileAndRun(Profile* profile,
const FilePath& path, const base::FilePath& path,
const OpenFileCallback& callback); const OpenFileCallback& callback);
// Ensures the existence of |directory| of '/special/drive/foo'. This will // Ensures the existence of |directory| of '/special/drive/foo'. This will
@@ -122,7 +125,7 @@ void PrepareWritableFileAndRun(Profile* profile,
// //
// Must be called from UI/IO thread. // Must be called from UI/IO thread.
void EnsureDirectoryExists(Profile* profile, void EnsureDirectoryExists(Profile* profile,
const FilePath& directory, const base::FilePath& directory,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Converts GData error code into file platform error code. // Converts GData error code into file platform error code.

@@ -17,7 +17,9 @@
#include "chrome/browser/chromeos/drive/drive_file_system_observer.h" #include "chrome/browser/chromeos/drive/drive_file_system_observer.h"
#include "chrome/browser/chromeos/drive/drive_sync_client_observer.h" #include "chrome/browser/chromeos/drive/drive_sync_client_observer.h"
namespace base {
class FilePath; class FilePath;
}
namespace drive { namespace drive {
@@ -45,7 +47,8 @@ class DrivePrefetcher : public DriveFileSystemObserver,
// DriveFileSystemObserver overrides. // DriveFileSystemObserver overrides.
virtual void OnInitialLoadFinished(DriveFileError error) OVERRIDE; virtual void OnInitialLoadFinished(DriveFileError error) OVERRIDE;
virtual void OnDirectoryChanged(const FilePath& directory_path) OVERRIDE; virtual void OnDirectoryChanged(
const base::FilePath& directory_path) OVERRIDE;
// DriveSyncClientObserver overrides. // DriveSyncClientObserver overrides.
virtual void OnSyncTaskStarted() OVERRIDE; virtual void OnSyncTaskStarted() OVERRIDE;
@@ -63,7 +66,7 @@ class DrivePrefetcher : public DriveFileSystemObserver,
// Called when DoPrefetch is done. // Called when DoPrefetch is done.
void OnPrefetchFinished(const std::string& resource_id, void OnPrefetchFinished(const std::string& resource_id,
DriveFileError error, DriveFileError error,
const FilePath& file_path, const base::FilePath& file_path,
const std::string& mime_type, const std::string& mime_type,
DriveFileType file_type); DriveFileType file_type);
@@ -72,8 +75,8 @@ class DrivePrefetcher : public DriveFileSystemObserver,
// Helper methods to traverse over the file system. // Helper methods to traverse over the file system.
void VisitFile(const DriveEntryProto& entry); void VisitFile(const DriveEntryProto& entry);
void VisitDirectory(const FilePath& directory_path); void VisitDirectory(const base::FilePath& directory_path);
void OnReadDirectory(const FilePath& directory_path, void OnReadDirectory(const base::FilePath& directory_path,
DriveFileError error, DriveFileError error,
bool hide_hosted_documents, bool hide_hosted_documents,
scoped_ptr<DriveEntryProtoVector> entries); scoped_ptr<DriveEntryProtoVector> entries);

@@ -17,7 +17,9 @@
#include "chrome/browser/profiles/profile_keyed_service_factory.h" #include "chrome/browser/profiles/profile_keyed_service_factory.h"
#include "sync/notifier/invalidation_handler.h" #include "sync/notifier/invalidation_handler.h"
namespace base {
class FilePath; class FilePath;
}
namespace google_apis { namespace google_apis {
class DriveServiceInterface; class DriveServiceInterface;
@@ -50,7 +52,7 @@ class DriveSystemService : public ProfileKeyedService,
// Pass NULL or the empty value when not interested. // Pass NULL or the empty value when not interested.
DriveSystemService(Profile* profile, DriveSystemService(Profile* profile,
google_apis::DriveServiceInterface* test_drive_service, google_apis::DriveServiceInterface* test_drive_service,
const FilePath& test_cache_root, const base::FilePath& test_cache_root,
DriveFileSystemInterface* test_file_system); DriveFileSystemInterface* test_file_system);
virtual ~DriveSystemService(); virtual ~DriveSystemService();

@@ -10,9 +10,8 @@
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
#include "chrome/browser/google_apis/test_util.h" #include "chrome/browser/google_apis/test_util.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class Value; class Value;
} }
@@ -51,9 +50,9 @@ void CopyErrorCodeFromFileOperationCallback(DriveFileError* output,
// Copies |error| and |moved_file_path| to |out_error| and |out_file_path|. // Copies |error| and |moved_file_path| to |out_error| and |out_file_path|.
// Used to run asynchronous functions that take FileMoveCallback from tests. // Used to run asynchronous functions that take FileMoveCallback from tests.
void CopyResultsFromFileMoveCallback(DriveFileError* out_error, void CopyResultsFromFileMoveCallback(DriveFileError* out_error,
FilePath* out_file_path, base::FilePath* out_file_path,
DriveFileError error, DriveFileError error,
const FilePath& moved_file_path); const base::FilePath& moved_file_path);
// Copies |error| and |entry_proto| to |out_error| and |out_entry_proto| // Copies |error| and |entry_proto| to |out_error| and |out_entry_proto|
// respectively. Used to run asynchronous functions that take // respectively. Used to run asynchronous functions that take
@@ -85,14 +84,14 @@ void CopyResultsFromReadDirectoryByPathCallback(
// Copies |error|, |drive_file_path|, and |entry_proto| to |out_error|, // Copies |error|, |drive_file_path|, and |entry_proto| to |out_error|,
// |out_drive_file_path|, and |out_entry_proto| respectively. Used to run // |out_drive_file_path|, and |out_entry_proto| respectively. Used to run
// asynchronous functions that take GetEntryInfoWithFilePathCallback from // asynchronous functions that take GetEntryInfoWithbase::FilePathCallback from
// tests. // tests.
void CopyResultsFromGetEntryInfoWithFilePathCallback( void CopyResultsFromGetEntryInfoWithFilePathCallback(
DriveFileError* out_error, DriveFileError* out_error,
FilePath* out_drive_file_path, base::FilePath* out_drive_file_path,
scoped_ptr<DriveEntryProto>* out_entry_proto, scoped_ptr<DriveEntryProto>* out_entry_proto,
DriveFileError error, DriveFileError error,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
scoped_ptr<DriveEntryProto> entry_proto); scoped_ptr<DriveEntryProto> entry_proto);
// Copies |result| to |out_result|. Used to run asynchronous functions // Copies |result| to |out_result|. Used to run asynchronous functions
@@ -108,10 +107,11 @@ void CopyResultFromInitializeCacheCallback(bool* out_success,
// Copies results from DriveCache methods. Used to run asynchronous functions // Copies results from DriveCache methods. Used to run asynchronous functions
// that take GetFileFromCacheCallback from tests. // that take GetFileFromCacheCallback from tests.
void CopyResultsFromGetFileFromCacheCallback(DriveFileError* out_error, void CopyResultsFromGetFileFromCacheCallback(
FilePath* out_cache_file_path, DriveFileError* out_error,
DriveFileError error, base::FilePath* out_cache_file_path,
const FilePath& cache_file_path); DriveFileError error,
const base::FilePath& cache_file_path);
// Copies results from DriveCache methods. Used to run asynchronous functions // Copies results from DriveCache methods. Used to run asynchronous functions
// that take GetCacheEntryCallback from tests. // that take GetCacheEntryCallback from tests.
@@ -123,10 +123,10 @@ void CopyResultsFromGetCacheEntryCallback(bool* out_success,
// Copies results from DriveFileSystem methods. Used to run asynchronous // Copies results from DriveFileSystem methods. Used to run asynchronous
// functions that take GetFileCallback from tests. // functions that take GetFileCallback from tests.
void CopyResultsFromGetFileCallback(DriveFileError* out_error, void CopyResultsFromGetFileCallback(DriveFileError* out_error,
FilePath* out_file_path, base::FilePath* out_file_path,
DriveFileType* out_file_type, DriveFileType* out_file_type,
DriveFileError error, DriveFileError error,
const FilePath& file_path, const base::FilePath& file_path,
const std::string& mime_type, const std::string& mime_type,
DriveFileType file_type); DriveFileType file_type);
@@ -143,9 +143,9 @@ void CopyResultsFromGetAvailableSpaceCallback(DriveFileError* out_error,
// of the current thread. Used to run asynchronous function that take // of the current thread. Used to run asynchronous function that take
// OpenFileCallback. // OpenFileCallback.
void CopyResultsFromOpenFileCallbackAndQuit(DriveFileError* out_error, void CopyResultsFromOpenFileCallbackAndQuit(DriveFileError* out_error,
FilePath* out_file_path, base::FilePath* out_file_path,
DriveFileError error, DriveFileError error,
const FilePath& file_path); const base::FilePath& file_path);
// Copies the results from DriveFileSystem methods and stops the message loop // Copies the results from DriveFileSystem methods and stops the message loop
// of the current thread. Used to run asynchronous function that take // of the current thread. Used to run asynchronous function that take

@@ -13,7 +13,9 @@
#include "chrome/browser/google_apis/gdata_wapi_parser.h" #include "chrome/browser/google_apis/gdata_wapi_parser.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
namespace base {
class FilePath; class FilePath;
}
namespace google_apis { namespace google_apis {
class AppList; class AppList;
@@ -57,7 +59,7 @@ class DriveWebAppsRegistry {
virtual ~DriveWebAppsRegistry(); virtual ~DriveWebAppsRegistry();
// DriveWebAppsRegistry overrides. // DriveWebAppsRegistry overrides.
virtual void GetWebAppsForFile(const FilePath& file, virtual void GetWebAppsForFile(const base::FilePath& file,
const std::string& mime_type, const std::string& mime_type,
ScopedVector<DriveWebAppInfo>* apps); ScopedVector<DriveWebAppInfo>* apps);
virtual std::set<std::string> GetExtensionsForWebStoreApp( virtual std::set<std::string> GetExtensionsForWebStoreApp(

@@ -11,10 +11,10 @@
#include "chrome/browser/chromeos/drive/drive_resource_metadata.h" #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
class FilePath;
class GURL; class GURL;
namespace base { namespace base {
class FilePath;
class Value; class Value;
} }
@@ -49,8 +49,8 @@ class CopyOperation {
// Performs the copy operation on the file at drive path |src_file_path| // Performs the copy operation on the file at drive path |src_file_path|
// with a target of |dest_file_path|. Invokes |callback| when finished with // with a target of |dest_file_path|. Invokes |callback| when finished with
// the result of the operation. |callback| must not be null. // the result of the operation. |callback| must not be null.
virtual void Copy(const FilePath& src_file_path, virtual void Copy(const base::FilePath& src_file_path,
const FilePath& dest_file_path, const base::FilePath& dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Initiates transfer of |remote_src_file_path| to |local_dest_file_path|. // Initiates transfer of |remote_src_file_path| to |local_dest_file_path|.
@@ -60,8 +60,8 @@ class CopyOperation {
// Must be called from *UI* thread. |callback| is run on the calling thread. // Must be called from *UI* thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
virtual void TransferFileFromRemoteToLocal( virtual void TransferFileFromRemoteToLocal(
const FilePath& remote_src_file_path, const base::FilePath& remote_src_file_path,
const FilePath& local_dest_file_path, const base::FilePath& local_dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Initiates transfer of |local_src_file_path| to |remote_dest_file_path|. // Initiates transfer of |local_src_file_path| to |remote_dest_file_path|.
@@ -72,8 +72,8 @@ class CopyOperation {
// Must be called from *UI* thread. |callback| is run on the calling thread. // Must be called from *UI* thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
virtual void TransferFileFromLocalToRemote( virtual void TransferFileFromLocalToRemote(
const FilePath& local_src_file_path, const base::FilePath& local_src_file_path,
const FilePath& remote_dest_file_path, const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Initiates transfer of |local_file_path| to |remote_dest_file_path|. // Initiates transfer of |local_file_path| to |remote_dest_file_path|.
@@ -83,8 +83,8 @@ class CopyOperation {
// //
// Must be called from *UI* thread. |callback| is run on the calling thread. // Must be called from *UI* thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
virtual void TransferRegularFile(const FilePath& local_file_path, virtual void TransferRegularFile(const base::FilePath& local_file_path,
const FilePath& remote_dest_file_path, const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
private: private:
@@ -98,27 +98,28 @@ class CopyOperation {
// //
// Can be called from UI thread. |callback| is run on the calling thread. // Can be called from UI thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
void OnGetFileCompleteForTransferFile(const FilePath& local_dest_file_path, void OnGetFileCompleteForTransferFile(
const FileOperationCallback& callback, const base::FilePath& local_dest_file_path,
DriveFileError error, const FileOperationCallback& callback,
const FilePath& local_file_path, DriveFileError error,
const std::string& unused_mime_type, const base::FilePath& local_file_path,
DriveFileType file_type); const std::string& unused_mime_type,
DriveFileType file_type);
// Copies a hosted document with |resource_id| to the directory at |dir_path| // Copies a hosted document with |resource_id| to the directory at |dir_path|
// and names the copied document as |new_name|. // and names the copied document as |new_name|.
// //
// Can be called from UI thread. |callback| is run on the calling thread. // Can be called from UI thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
void CopyHostedDocumentToDirectory(const FilePath& dir_path, void CopyHostedDocumentToDirectory(const base::FilePath& dir_path,
const std::string& resource_id, const std::string& resource_id,
const FilePath::StringType& new_name, const base::FilePath::StringType& new_name,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Callback for handling document copy attempt. // Callback for handling document copy attempt.
// |callback| must not be null. // |callback| must not be null.
void OnCopyHostedDocumentCompleted( void OnCopyHostedDocumentCompleted(
const FilePath& dir_path, const base::FilePath& dir_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
google_apis::GDataErrorCode status, google_apis::GDataErrorCode status,
scoped_ptr<google_apis::ResourceEntry> resource_entry); scoped_ptr<google_apis::ResourceEntry> resource_entry);
@@ -129,14 +130,14 @@ class CopyOperation {
// //
// Can be called from UI thread. |callback| is run on the calling thread. // Can be called from UI thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
void MoveEntryFromRootDirectory(const FilePath& directory_path, void MoveEntryFromRootDirectory(const base::FilePath& directory_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& file_path); const base::FilePath& file_path);
// Part of Copy(). Called after GetEntryInfoPairByPaths() is // Part of Copy(). Called after GetEntryInfoPairByPaths() is
// complete. |callback| must not be null. // complete. |callback| must not be null.
void CopyAfterGetEntryInfoPair(const FilePath& dest_file_path, void CopyAfterGetEntryInfoPair(const base::FilePath& dest_file_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
scoped_ptr<EntryInfoPairResult> result); scoped_ptr<EntryInfoPairResult> result);
@@ -145,10 +146,10 @@ class CopyOperation {
// |local_file_path| to |remote_dest_file_path|. // |local_file_path| to |remote_dest_file_path|.
// //
// Can be called from UI thread. |callback| is run on the calling thread. // Can be called from UI thread. |callback| is run on the calling thread.
void OnGetFileCompleteForCopy(const FilePath& remote_dest_file_path, void OnGetFileCompleteForCopy(const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& local_file_path, const base::FilePath& local_file_path,
const std::string& unused_mime_type, const std::string& unused_mime_type,
DriveFileType file_type); DriveFileType file_type);
@@ -170,15 +171,15 @@ class CopyOperation {
void OnTransferCompleted( void OnTransferCompleted(
const FileOperationCallback& callback, const FileOperationCallback& callback,
google_apis::DriveUploadError error, google_apis::DriveUploadError error,
const FilePath& drive_path, const base::FilePath& drive_path,
const FilePath& file_path, const base::FilePath& file_path,
scoped_ptr<google_apis::ResourceEntry> resource_entry); scoped_ptr<google_apis::ResourceEntry> resource_entry);
// Part of TransferFileFromLocalToRemote(). Called after // Part of TransferFileFromLocalToRemote(). Called after
// GetEntryInfoByPath() is complete. // GetEntryInfoByPath() is complete.
void TransferFileFromLocalToRemoteAfterGetEntryInfo( void TransferFileFromLocalToRemoteAfterGetEntryInfo(
const FilePath& local_src_file_path, const base::FilePath& local_src_file_path,
const FilePath& remote_dest_file_path, const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
scoped_ptr<DriveEntryProto> entry_proto); scoped_ptr<DriveEntryProto> entry_proto);
@@ -192,8 +193,8 @@ class CopyOperation {
// //
// Must be called from *UI* thread. |callback| is run on the calling thread. // Must be called from *UI* thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
void TransferFileForResourceId(const FilePath& local_file_path, void TransferFileForResourceId(const base::FilePath& local_file_path,
const FilePath& remote_dest_file_path, const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
const std::string& resource_id); const std::string& resource_id);

@@ -9,7 +9,9 @@
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "chrome/browser/chromeos/drive/drive_resource_metadata.h" #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
namespace base {
class FilePath; class FilePath;
}
namespace google_apis { namespace google_apis {
class DriveUploaderInterface; class DriveUploaderInterface;
@@ -52,37 +54,38 @@ class DriveOperations {
// Wrapper function for copy_operation_. // Wrapper function for copy_operation_.
// |callback| must not be null. // |callback| must not be null.
void Copy(const FilePath& src_file_path, void Copy(const base::FilePath& src_file_path,
const FilePath& dest_file_path, const base::FilePath& dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Wrapper function for copy_operation_. // Wrapper function for copy_operation_.
// |callback| must not be null. // |callback| must not be null.
void TransferFileFromRemoteToLocal(const FilePath& remote_src_file_path, void TransferFileFromRemoteToLocal(const base::FilePath& remote_src_file_path,
const FilePath& local_dest_file_path, const base::FilePath& local_dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Wrapper function for copy_operation_. // Wrapper function for copy_operation_.
// |callback| must not be null. // |callback| must not be null.
void TransferFileFromLocalToRemote(const FilePath& local_src_file_path, void TransferFileFromLocalToRemote(
const FilePath& remote_dest_file_path, const base::FilePath& local_src_file_path,
const FileOperationCallback& callback); const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback);
// Wrapper function for copy_operation_. // Wrapper function for copy_operation_.
// |callback| must not be null. // |callback| must not be null.
void TransferRegularFile(const FilePath& local_src_file_path, void TransferRegularFile(const base::FilePath& local_src_file_path,
const FilePath& remote_dest_file_path, const base::FilePath& remote_dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Wrapper function for move_operation_. // Wrapper function for move_operation_.
// |callback| must not be null. // |callback| must not be null.
void Move(const FilePath& src_file_path, void Move(const base::FilePath& src_file_path,
const FilePath& dest_file_path, const base::FilePath& dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
// Wrapper function for remove_operation_. // Wrapper function for remove_operation_.
// |callback| must not be null. // |callback| must not be null.
void Remove(const FilePath& file_path, void Remove(const base::FilePath& file_path,
bool is_recursive, bool is_recursive,
const FileOperationCallback& callback); const FileOperationCallback& callback);

@@ -11,9 +11,12 @@
#include "chrome/browser/chromeos/drive/drive_resource_metadata.h" #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
class FilePath;
class GURL; class GURL;
namespace base {
class FilePath;
}
namespace drive { namespace drive {
class DriveCache; class DriveCache;
@@ -38,14 +41,14 @@ class MoveOperation {
// Performs the move operation on the file at drive path |src_file_path| // Performs the move operation on the file at drive path |src_file_path|
// with a target of |dest_file_path|. Invokes |callback| when finished with // with a target of |dest_file_path|. Invokes |callback| when finished with
// the result of the operation. |callback| must not be null. // the result of the operation. |callback| must not be null.
virtual void Move(const FilePath& src_file_path, virtual void Move(const base::FilePath& src_file_path,
const FilePath& dest_file_path, const base::FilePath& dest_file_path,
const FileOperationCallback& callback); const FileOperationCallback& callback);
private: private:
// Part of Move(). Called after GetEntryInfoPairByPaths() is // Part of Move(). Called after GetEntryInfoPairByPaths() is
// complete. |callback| must not be null. // complete. |callback| must not be null.
void MoveAfterGetEntryInfoPair( void MoveAfterGetEntryInfoPair(
const FilePath& dest_file_path, const base::FilePath& dest_file_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
scoped_ptr<EntryInfoPairResult> result); scoped_ptr<EntryInfoPairResult> result);
@@ -53,7 +56,7 @@ class MoveOperation {
// FileMoveCallback to FileOperationCallback. // FileMoveCallback to FileOperationCallback.
void OnFilePathUpdated(const FileOperationCallback& cllback, void OnFilePathUpdated(const FileOperationCallback& cllback,
DriveFileError error, DriveFileError error,
const FilePath& file_path); const base::FilePath& file_path);
// Renames a file or directory at |file_path| to |new_name| in the same // Renames a file or directory at |file_path| to |new_name| in the same
// directory. |callback| will receive the new file path if the operation is // directory. |callback| will receive the new file path if the operation is
@@ -63,14 +66,14 @@ class MoveOperation {
// //
// Can be called from UI thread. |callback| is run on the calling thread. // Can be called from UI thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
void Rename(const FilePath& file_path, void Rename(const base::FilePath& file_path,
const FilePath::StringType& new_name, const base::FilePath::StringType& new_name,
const FileMoveCallback& callback); const FileMoveCallback& callback);
// Part of Rename(). Called after GetEntryInfoByPath() is complete. // Part of Rename(). Called after GetEntryInfoByPath() is complete.
// |callback| must not be null. // |callback| must not be null.
void RenameAfterGetEntryInfo(const FilePath& file_path, void RenameAfterGetEntryInfo(const base::FilePath& file_path,
const FilePath::StringType& new_name, const base::FilePath::StringType& new_name,
const FileMoveCallback& callback, const FileMoveCallback& callback,
DriveFileError error, DriveFileError error,
scoped_ptr<DriveEntryProto> entry_proto); scoped_ptr<DriveEntryProto> entry_proto);
@@ -78,8 +81,8 @@ class MoveOperation {
// Callback for handling resource rename attempt. Renames a file or // Callback for handling resource rename attempt. Renames a file or
// directory at |file_path| on the client side. // directory at |file_path| on the client side.
// |callback| must not be null. // |callback| must not be null.
void RenameEntryLocally(const FilePath& file_path, void RenameEntryLocally(const base::FilePath& file_path,
const FilePath::StringType& new_name, const base::FilePath::StringType& new_name,
const FileMoveCallback& callback, const FileMoveCallback& callback,
google_apis::GDataErrorCode status); google_apis::GDataErrorCode status);
@@ -90,7 +93,7 @@ class MoveOperation {
// |callback| must not be null. // |callback| must not be null.
void RemoveEntryFromDirectory(const FileMoveCallback& callback, void RemoveEntryFromDirectory(const FileMoveCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& file_path); const base::FilePath& file_path);
// Part of RemoveEntryFromDirectory(). Called after // Part of RemoveEntryFromDirectory(). Called after
// GetEntryInfoPairByPaths() is complete. |callback| must not be null. // GetEntryInfoPairByPaths() is complete. |callback| must not be null.
@@ -103,10 +106,10 @@ class MoveOperation {
// //
// Can be called from UI thread. |callback| is run on the calling thread. // Can be called from UI thread. |callback| is run on the calling thread.
// |callback| must not be null. // |callback| must not be null.
void AddEntryToDirectory(const FilePath& directory_path, void AddEntryToDirectory(const base::FilePath& directory_path,
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& file_path); const base::FilePath& file_path);
// Part of AddEntryToDirectory(). Called after // Part of AddEntryToDirectory(). Called after
// GetEntryInfoPairByPaths() is complete. |callback| must not be null. // GetEntryInfoPairByPaths() is complete. |callback| must not be null.
@@ -117,8 +120,8 @@ class MoveOperation {
// Moves entry specified by |file_path| to the directory specified by // Moves entry specified by |file_path| to the directory specified by
// |dir_path| and calls |callback| asynchronously. // |dir_path| and calls |callback| asynchronously.
// |callback| must not be null. // |callback| must not be null.
void MoveEntryToDirectory(const FilePath& file_path, void MoveEntryToDirectory(const base::FilePath& file_path,
const FilePath& directory_path, const base::FilePath& directory_path,
const FileMoveCallback& callback, const FileMoveCallback& callback,
google_apis::GDataErrorCode status); google_apis::GDataErrorCode status);
@@ -128,7 +131,7 @@ class MoveOperation {
void NotifyAndRunFileOperationCallback( void NotifyAndRunFileOperationCallback(
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& moved_file_path); const base::FilePath& moved_file_path);
// Callback when an entry is moved to another directory on the client side. // Callback when an entry is moved to another directory on the client side.
// Notifies the directory change and runs |callback|. // Notifies the directory change and runs |callback|.
@@ -136,7 +139,7 @@ class MoveOperation {
void NotifyAndRunFileMoveCallback( void NotifyAndRunFileMoveCallback(
const FileMoveCallback& callback, const FileMoveCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& moved_file_path); const base::FilePath& moved_file_path);
DriveScheduler* drive_scheduler_; DriveScheduler* drive_scheduler_;
DriveResourceMetadata* metadata_; DriveResourceMetadata* metadata_;

@@ -5,7 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_
namespace base {
class FilePath; class FilePath;
}
namespace drive { namespace drive {
namespace file_system { namespace file_system {
@@ -17,7 +19,7 @@ class OperationObserver {
// |directory_path| is a virtual directory path representing the // |directory_path| is a virtual directory path representing the
// changed directory. // changed directory.
virtual void OnDirectoryChangedByOperation( virtual void OnDirectoryChangedByOperation(
const FilePath& directory_path) = 0; const base::FilePath& directory_path) = 0;
}; };
} // namespace file_system } // namespace file_system

@@ -11,9 +11,12 @@
#include "chrome/browser/chromeos/drive/drive_resource_metadata.h" #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
class FilePath;
class GURL; class GURL;
namespace base {
class FilePath;
}
namespace google_apis { namespace google_apis {
} }
@@ -42,7 +45,7 @@ class RemoveOperation {
// Perform the remove operation on the file at drive path |file_path|. // Perform the remove operation on the file at drive path |file_path|.
// Invokes |callback| when finished with the result of the operation. // Invokes |callback| when finished with the result of the operation.
// |callback| must not be null. // |callback| must not be null.
virtual void Remove(const FilePath& file_path, virtual void Remove(const base::FilePath& file_path,
bool is_recursive, bool is_recursive,
const FileOperationCallback& callback); const FileOperationCallback& callback);
@@ -67,7 +70,7 @@ class RemoveOperation {
void NotifyDirectoryChanged( void NotifyDirectoryChanged(
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& directory_path); const base::FilePath& directory_path);
DriveScheduler* drive_scheduler_; DriveScheduler* drive_scheduler_;
DriveCache* cache_; DriveCache* cache_;

@@ -11,9 +11,12 @@
#include "chrome/browser/chromeos/drive/drive_resource_metadata.h" #include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
class FilePath;
class GURL; class GURL;
namespace base {
class FilePath;
}
namespace google_apis { namespace google_apis {
class DriveUploaderInterface; class DriveUploaderInterface;
} }
@@ -58,7 +61,7 @@ class UpdateOperation {
void UpdateFileByEntryInfo( void UpdateFileByEntryInfo(
const FileOperationCallback& callback, const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
scoped_ptr<DriveEntryProto> entry_proto); scoped_ptr<DriveEntryProto> entry_proto);
// Part of UpdateFileByResourceId(). // Part of UpdateFileByResourceId().
@@ -66,10 +69,10 @@ class UpdateOperation {
// UpdateFileByResourceId(). // UpdateFileByResourceId().
// |callback| must not be null. // |callback| must not be null.
void OnGetFileCompleteForUpdateFile(const FileOperationCallback& callback, void OnGetFileCompleteForUpdateFile(const FileOperationCallback& callback,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
scoped_ptr<DriveEntryProto> entry_proto, scoped_ptr<DriveEntryProto> entry_proto,
DriveFileError error, DriveFileError error,
const FilePath& cache_file_path); const base::FilePath& cache_file_path);
// Part of UpdateFileByResourceId(). // Part of UpdateFileByResourceId().
// Called when DriveUploader::UploadUpdatedFile() is completed for // Called when DriveUploader::UploadUpdatedFile() is completed for
@@ -78,15 +81,15 @@ class UpdateOperation {
void OnUpdatedFileUploaded( void OnUpdatedFileUploaded(
const FileOperationCallback& callback, const FileOperationCallback& callback,
google_apis::DriveUploadError error, google_apis::DriveUploadError error,
const FilePath& gdata_path, const base::FilePath& gdata_path,
const FilePath& file_path, const base::FilePath& file_path,
scoped_ptr<google_apis::ResourceEntry> resource_entry); scoped_ptr<google_apis::ResourceEntry> resource_entry);
// Part of UpdateFileByResourceId(). // Part of UpdateFileByResourceId().
// |callback| must not be null. // |callback| must not be null.
void OnUpdatedFileRefreshed(const FileOperationCallback& callback, void OnUpdatedFileRefreshed(const FileOperationCallback& callback,
DriveFileError error, DriveFileError error,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
scoped_ptr<DriveEntryProto> entry_proto); scoped_ptr<DriveEntryProto> entry_proto);
DriveCache* cache_; DriveCache* cache_;

@@ -9,7 +9,9 @@
#include "chrome/browser/chromeos/drive/drive_file_error.h" #include "chrome/browser/chromeos/drive/drive_file_error.h"
#include "chrome/browser/chromeos/drive/drive_file_system_interface.h" #include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
namespace base {
class FilePath; class FilePath;
}
namespace drive { namespace drive {
@@ -26,7 +28,7 @@ class FileWriteHelper {
// file is created. // file is created.
// //
// Must be called from UI thread. // Must be called from UI thread.
void PrepareWritableFileAndRun(const FilePath& path, void PrepareWritableFileAndRun(const base::FilePath& path,
const OpenFileCallback& callback); const OpenFileCallback& callback);
private: private:
@@ -34,15 +36,15 @@ class FileWriteHelper {
// file does not exist yet, does OpenFile to download and mark the file as // file does not exist yet, does OpenFile to download and mark the file as
// dirty, runs |callback|, and finally calls CloseFile. // dirty, runs |callback|, and finally calls CloseFile.
void PrepareWritableFileAndRunAfterCreateFile( void PrepareWritableFileAndRunAfterCreateFile(
const FilePath& file_path, const base::FilePath& file_path,
const OpenFileCallback& callback, const OpenFileCallback& callback,
DriveFileError result); DriveFileError result);
void PrepareWritableFileAndRunAfterOpenFile( void PrepareWritableFileAndRunAfterOpenFile(
const FilePath& file_path, const base::FilePath& file_path,
const OpenFileCallback& callback, const OpenFileCallback& callback,
DriveFileError result, DriveFileError result,
const FilePath& local_cache_path); const base::FilePath& local_cache_path);
void PrepareWritableFileAndRunAfterCallback(const FilePath& file_path); void PrepareWritableFileAndRunAfterCallback(const base::FilePath& file_path);
// File system owned by DriveSystemService. // File system owned by DriveSystemService.
DriveFileSystemInterface* file_system_; DriveFileSystemInterface* file_system_;

@@ -13,9 +13,12 @@
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h" #include "content/public/browser/notification_types.h"
class FilePath;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace chromeos { namespace chromeos {
// This observer listens for installed extensions and restarts the ChromeOS // This observer listens for installed extensions and restarts the ChromeOS
@@ -31,7 +34,7 @@ class EnterpriseExtensionObserver
const content::NotificationDetails& details) OVERRIDE; const content::NotificationDetails& details) OVERRIDE;
private: private:
static void CheckExtensionAndNotifyEntd(const FilePath& path); static void CheckExtensionAndNotifyEntd(const base::FilePath& path);
static void NotifyEntd(); static void NotifyEntd();
Profile* profile_; Profile* profile_;

@@ -10,9 +10,8 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "chromeos/disks/disk_mount_manager.h" #include "chromeos/disks/disk_mount_manager.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class TimeDelta; class TimeDelta;
} }
@@ -69,8 +68,8 @@ class BurnController {
// Returns devices on which we can burn recovery image. // Returns devices on which we can burn recovery image.
virtual std::vector<disks::DiskMountManager::Disk> GetBurnableDevices() = 0; virtual std::vector<disks::DiskMountManager::Disk> GetBurnableDevices() = 0;
// Starts burning process. // Starts burning process.
virtual void StartBurnImage(const FilePath& target_device_path, virtual void StartBurnImage(const base::FilePath& target_device_path,
const FilePath& target_file_path) = 0; const base::FilePath& target_file_path) = 0;
// Cancels burning process. // Cancels burning process.
virtual void CancelBurnImage() = 0; virtual void CancelBurnImage() = 0;
// Creates a new instance of BurnController. // Creates a new instance of BurnController.

@@ -9,9 +9,12 @@
#include "chrome/browser/chromeos/login/user.h" #include "chrome/browser/chromeos/login/user.h"
class FilePath;
class PrefServiceSimple; class PrefServiceSimple;
namespace base {
class FilePath;
}
namespace gfx { namespace gfx {
class ImageSkia; class ImageSkia;
} }
@@ -49,7 +52,7 @@ class UserImageManager {
// Tries to load user image from disk; if successful, sets it for the user, // Tries to load user image from disk; if successful, sets it for the user,
// sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State. // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State.
virtual void SaveUserImageFromFile(const std::string& username, virtual void SaveUserImageFromFile(const std::string& username,
const FilePath& path) = 0; const base::FilePath& path) = 0;
// Sets profile image as user image for |username|, sends // Sets profile image as user image for |username|, sends
// LOGIN_USER_IMAGE_CHANGED notification and updates Local State. If the user // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. If the user

@@ -21,6 +21,10 @@
class ProfileDownloader; class ProfileDownloader;
class UserImage; class UserImage;
namespace base {
class FilePath;
}
namespace chromeos { namespace chromeos {
class UserImageManagerImpl : public UserImageManager, class UserImageManagerImpl : public UserImageManager,
@@ -39,7 +43,7 @@ class UserImageManagerImpl : public UserImageManager,
virtual void SaveUserImage(const std::string& username, virtual void SaveUserImage(const std::string& username,
const UserImage& user_image) OVERRIDE; const UserImage& user_image) OVERRIDE;
virtual void SaveUserImageFromFile(const std::string& username, virtual void SaveUserImageFromFile(const std::string& username,
const FilePath& path) OVERRIDE; const base::FilePath& path) OVERRIDE;
virtual void SaveUserImageFromProfileImage( virtual void SaveUserImageFromProfileImage(
const std::string& username) OVERRIDE; const std::string& username) OVERRIDE;
virtual void DeleteUserImage(const std::string& username) OVERRIDE; virtual void DeleteUserImage(const std::string& username) OVERRIDE;
@@ -63,7 +67,7 @@ class UserImageManagerImpl : public UserImageManager,
ProfileDownloaderDelegate::FailureReason reason) OVERRIDE; ProfileDownloaderDelegate::FailureReason reason) OVERRIDE;
// Returns image filepath for the given user. // Returns image filepath for the given user.
FilePath GetImagePathForUser(const std::string& username); base::FilePath GetImagePathForUser(const std::string& username);
// Sets one of the default images for the specified user and saves this // Sets one of the default images for the specified user and saves this
// setting in local state. // setting in local state.
@@ -90,7 +94,7 @@ class UserImageManagerImpl : public UserImageManager,
// Local State on UI thread. // Local State on UI thread.
void SaveImageToFile(const std::string& username, void SaveImageToFile(const std::string& username,
const UserImage& user_image, const UserImage& user_image,
const FilePath& image_path, const base::FilePath& image_path,
int image_index, int image_index,
const GURL& image_url); const GURL& image_url);
@@ -105,7 +109,7 @@ class UserImageManagerImpl : public UserImageManager,
// Saves |image| to the specified |image_path|. Runs on FILE thread. // Saves |image| to the specified |image_path|. Runs on FILE thread.
bool SaveBitmapToFile(const UserImage& user_image, bool SaveBitmapToFile(const UserImage& user_image,
const FilePath& image_path); const base::FilePath& image_path);
// Initializes |downloaded_profile_image_| with the picture of the logged-in // Initializes |downloaded_profile_image_| with the picture of the logged-in
// user. // user.

@@ -24,7 +24,6 @@
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
class FilePath;
class PrefService; class PrefService;
class ProfileSyncService; class ProfileSyncService;

@@ -15,10 +15,9 @@
#include "base/time.h" #include "base/time.h"
#include "chrome/browser/chromeos/customization_document.h" #include "chrome/browser/chromeos/customization_document.h"
class FilePath;
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
class FilePath;
} }
namespace chromeos { namespace chromeos {
@@ -180,8 +179,8 @@ class MobileConfig : public CustomizationDocument {
const std::string& local_config); const std::string& local_config);
// Executes on FILE thread and reads config files to string. // Executes on FILE thread and reads config files to string.
void ReadConfigInBackground(const FilePath& global_config_file, void ReadConfigInBackground(const base::FilePath& global_config_file,
const FilePath& local_config_file); const base::FilePath& local_config_file);
// Maps external carrier ID to internal carrier ID. // Maps external carrier ID to internal carrier ID.
CarrierIdMap carrier_id_map_; CarrierIdMap carrier_id_map_;

@@ -14,7 +14,9 @@
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
namespace base {
class FilePath; class FilePath;
}
namespace crypto { namespace crypto {
class RSAPrivateKey; class RSAPrivateKey;
@@ -59,7 +61,7 @@ class OwnerKeyUtilImpl : public OwnerKeyUtil {
// key will live. // key will live.
static const char kOwnerKeyFile[]; static const char kOwnerKeyFile[];
explicit OwnerKeyUtilImpl(const FilePath& public_key_file); explicit OwnerKeyUtilImpl(const base::FilePath& public_key_file);
// OwnerKeyUtil: // OwnerKeyUtil:
virtual bool ImportPublicKey(std::vector<uint8>* output) OVERRIDE; virtual bool ImportPublicKey(std::vector<uint8>* output) OVERRIDE;
@@ -72,7 +74,7 @@ class OwnerKeyUtilImpl : public OwnerKeyUtil {
private: private:
// The file that holds the public key. // The file that holds the public key.
FilePath key_file_; base::FilePath key_file_;
DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilImpl); DISALLOW_COPY_AND_ASSIGN(OwnerKeyUtilImpl);
}; };

@@ -10,7 +10,9 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace base {
class FilePath; class FilePath;
}
namespace chromeos { namespace chromeos {
namespace system { namespace system {
@@ -36,7 +38,7 @@ class NameValuePairsParser {
// Parses name-value pairs from the file. // Parses name-value pairs from the file.
// Returns false if there was any error in the file. Valid pairs will still be // Returns false if there was any error in the file. Valid pairs will still be
// added to the map. // added to the map.
bool GetNameValuePairsFromFile(const FilePath& file_path, bool GetNameValuePairsFromFile(const base::FilePath& file_path,
const std::string& eq, const std::string& eq,
const std::string& delim); const std::string& delim);

@@ -11,14 +11,13 @@
#include "base/version.h" #include "base/version.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
class FilePath;
namespace net { namespace net {
class URLRequestContextGetter; class URLRequestContextGetter;
} }
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
class FilePath;
} }
// Component specific installers must derive from this class and implement // Component specific installers must derive from this class and implement
@@ -36,7 +35,7 @@ class ComponentInstaller {
// json dictionary and |unpack_path| contains the temporary directory // json dictionary and |unpack_path| contains the temporary directory
// with all the unpacked CRX files. // with all the unpacked CRX files.
virtual bool Install(base::DictionaryValue* manifest, virtual bool Install(base::DictionaryValue* manifest,
const FilePath& unpack_path) = 0; const base::FilePath& unpack_path) = 0;
protected: protected:
virtual ~ComponentInstaller() {} virtual ~ComponentInstaller() {}

@@ -14,9 +14,12 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
class FilePath;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace content { namespace content {
class WebContents; class WebContents;
} }
@@ -84,19 +87,21 @@ class DevToolsFileHelper {
void SaveAsFileSelected(const std::string& url, void SaveAsFileSelected(const std::string& url,
const std::string& content, const std::string& content,
const SaveCallback& callback, const SaveCallback& callback,
const FilePath& path); const base::FilePath& path);
void SaveAsFileSelectionCanceled(); void SaveAsFileSelectionCanceled();
void InnerAddFileSystem(const AddFileSystemCallback& callback, void InnerAddFileSystem(const AddFileSystemCallback& callback,
const FilePath& path); const base::FilePath& path);
void AddValidatedFileSystem(const AddFileSystemCallback& callback, void AddValidatedFileSystem(
const std::vector<FilePath>& permitted_paths); const AddFileSystemCallback& callback,
void RestoreValidatedFileSystems(const RequestFileSystemsCallback& callback, const std::vector<base::FilePath>& permitted_paths);
const std::vector<FilePath>& file_paths); void RestoreValidatedFileSystems(
const RequestFileSystemsCallback& callback,
const std::vector<base::FilePath>& file_paths);
content::WebContents* web_contents_; content::WebContents* web_contents_;
Profile* profile_; Profile* profile_;
base::WeakPtrFactory<DevToolsFileHelper> weak_factory_; base::WeakPtrFactory<DevToolsFileHelper> weak_factory_;
typedef std::map<std::string, FilePath> PathsMap; typedef std::map<std::string, base::FilePath> PathsMap;
PathsMap saved_files_; PathsMap saved_files_;
DISALLOW_COPY_AND_ASSIGN(DevToolsFileHelper); DISALLOW_COPY_AND_ASSIGN(DevToolsFileHelper);
}; };

@@ -9,7 +9,9 @@
#include "base/string16.h" #include "base/string16.h"
#include "chrome/browser/diagnostics/diagnostics_model.h" #include "chrome/browser/diagnostics/diagnostics_model.h"
namespace base {
class FilePath; class FilePath;
}
// Represents a single diagnostic test and encapsulates the common // Represents a single diagnostic test and encapsulates the common
// functionality across platforms as well. // functionality across platforms as well.
@@ -55,7 +57,7 @@ class DiagnosticTest : public DiagnosticsModel::TestInfo {
void RecordOutcome(const string16& additional_info, void RecordOutcome(const string16& additional_info,
DiagnosticsModel::TestResult result); DiagnosticsModel::TestResult result);
static FilePath GetUserDefaultProfileDir(); static base::FilePath GetUserDefaultProfileDir();
protected: protected:
// The id needs to be overridden by derived classes and must uniquely // The id needs to be overridden by derived classes and must uniquely

@@ -8,7 +8,9 @@
#include "chrome/browser/download/chrome_download_manager_delegate.h" #include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog.h"
namespace base {
class FilePath; class FilePath;
}
namespace content { namespace content {
class DownloadItem; class DownloadItem;
@@ -24,7 +26,7 @@ class DownloadFilePicker : public ui::SelectFileDialog::Listener {
void Init(content::DownloadManager* download_manager, void Init(content::DownloadManager* download_manager,
content::DownloadItem* item, content::DownloadItem* item,
const FilePath& suggested_path, const base::FilePath& suggested_path,
const ChromeDownloadManagerDelegate::FileSelectedCallback& const ChromeDownloadManagerDelegate::FileSelectedCallback&
callback); callback);
@@ -33,28 +35,28 @@ class DownloadFilePicker : public ui::SelectFileDialog::Listener {
// method should be overridden to set the correct suggested path to prompt the // method should be overridden to set the correct suggested path to prompt the
// user. // user.
virtual void InitSuggestedPath(content::DownloadItem* item, virtual void InitSuggestedPath(content::DownloadItem* item,
const FilePath& suggested_path); const base::FilePath& suggested_path);
void set_suggested_path(const FilePath& suggested_path) { void set_suggested_path(const base::FilePath& suggested_path) {
suggested_path_ = suggested_path; suggested_path_ = suggested_path;
} }
// Runs |file_selected_callback_| with |path| and then deletes this object. // Runs |file_selected_callback_| with |path| and then deletes this object.
void OnFileSelected(const FilePath& path); void OnFileSelected(const base::FilePath& path);
void RecordFileSelected(const FilePath& path); void RecordFileSelected(const base::FilePath& path);
scoped_refptr<content::DownloadManager> download_manager_; scoped_refptr<content::DownloadManager> download_manager_;
int32 download_id_; int32 download_id_;
private: private:
// SelectFileDialog::Listener implementation. // SelectFileDialog::Listener implementation.
virtual void FileSelected(const FilePath& path, virtual void FileSelected(const base::FilePath& path,
int index, int index,
void* params) OVERRIDE; void* params) OVERRIDE;
virtual void FileSelectionCanceled(void* params) OVERRIDE; virtual void FileSelectionCanceled(void* params) OVERRIDE;
FilePath suggested_path_; base::FilePath suggested_path_;
ChromeDownloadManagerDelegate::FileSelectedCallback file_selected_callback_; ChromeDownloadManagerDelegate::FileSelectedCallback file_selected_callback_;

@@ -63,12 +63,14 @@
// It considers 'foo/bar/x.pdf' and 'foo/baz/x.pdf' to be two different paths, // It considers 'foo/bar/x.pdf' and 'foo/baz/x.pdf' to be two different paths,
// even though 'bar' might be a symlink to 'baz'. // even though 'bar' might be a symlink to 'baz'.
namespace base {
class FilePath;
}
namespace content { namespace content {
class DownloadItem; class DownloadItem;
} }
class FilePath;
// Issues and tracks download paths that are in use by the download system. When // Issues and tracks download paths that are in use by the download system. When
// a target path is set for a download, this object tracks the path and the // a target path is set for a download, this object tracks the path and the
// associated download item so that subsequent downloads can avoid using the // associated download item so that subsequent downloads can avoid using the
@@ -84,7 +86,7 @@ class DownloadPathReservationTracker {
// //
// If |requested_target_path| was not writeable, then the parent directory of // If |requested_target_path| was not writeable, then the parent directory of
// |target_path| may be different from that of |requested_target_path|. // |target_path| may be different from that of |requested_target_path|.
typedef base::Callback<void(const FilePath& target_path, typedef base::Callback<void(const base::FilePath& target_path,
bool target_path_verified)> ReservedPathCallback; bool target_path_verified)> ReservedPathCallback;
// The largest index for the uniquification suffix that we will try while // The largest index for the uniquification suffix that we will try while
@@ -99,14 +101,14 @@ class DownloadPathReservationTracker {
// directory does not exist and is the parent directory of // directory does not exist and is the parent directory of
// |requested_target_path|, the directory will be created. // |requested_target_path|, the directory will be created.
static void GetReservedPath(content::DownloadItem& download_item, static void GetReservedPath(content::DownloadItem& download_item,
const FilePath& requested_target_path, const base::FilePath& requested_target_path,
const FilePath& default_download_path, const base::FilePath& default_download_path,
bool should_uniquify_path, bool should_uniquify_path,
const ReservedPathCallback& callback); const ReservedPathCallback& callback);
// Returns true if |path| is in use by an existing path reservation. Should // Returns true if |path| is in use by an existing path reservation. Should
// only be called on the FILE thread. Currently only used by tests. // only be called on the FILE thread. Currently only used by tests.
static bool IsPathInUseForTesting(const FilePath& path); static bool IsPathInUseForTesting(const base::FilePath& path);
}; };
#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PATH_RESERVATION_TRACKER_H_ #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PATH_RESERVATION_TRACKER_H_

@@ -17,9 +17,9 @@
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
class EnumerateModulesModel; class EnumerateModulesModel;
class FilePath;
namespace base { namespace base {
class FilePath;
class ListValue; class ListValue;
} }
@@ -191,7 +191,7 @@ class ModuleEnumerator : public base::RefCountedThreadSafe<ModuleEnumerator> {
// Given a filename, returns the Subject (who signed it) retrieved from // Given a filename, returns the Subject (who signed it) retrieved from
// the digital signature (Authenticode). // the digital signature (Authenticode).
string16 GetSubjectNameFromDigitalSignature(const FilePath& filename); string16 GetSubjectNameFromDigitalSignature(const base::FilePath& filename);
// The typedef for the vector that maps a regular file path to %env_var%. // The typedef for the vector that maps a regular file path to %env_var%.
typedef std::vector< std::pair<string16, string16> > PathMapping; typedef std::vector< std::pair<string16, string16> > PathMapping;

@@ -14,7 +14,9 @@
#include "sql/connection.h" #include "sql/connection.h"
#include "sql/init_status.h" #include "sql/init_status.h"
namespace base {
class FilePath; class FilePath;
}
namespace extensions { namespace extensions {
@@ -30,7 +32,7 @@ class ActivityDatabase : public base::RefCountedThreadSafe<ActivityDatabase> {
void SetErrorDelegate(sql::ErrorDelegate* error_delegate); void SetErrorDelegate(sql::ErrorDelegate* error_delegate);
// Opens the DB and creates tables as necessary. // Opens the DB and creates tables as necessary.
void Init(const FilePath& db_name); void Init(const base::FilePath& db_name);
void LogInitFailure(); void LogInitFailure();
// Record a UrlAction in the database. // Record a UrlAction in the database.

@@ -17,9 +17,8 @@
#include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/extensions/extension_function.h"
#include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class ListValue; class ListValue;
} }
@@ -274,10 +273,10 @@ class BookmarksIOFunction : public BookmarksFunction,
public: public:
BookmarksIOFunction(); BookmarksIOFunction();
virtual void FileSelected(const FilePath& path, int index, void* params) = 0; virtual void FileSelected(const base::FilePath& path, int index, void* params) = 0;
// ui::SelectFileDialog::Listener: // ui::SelectFileDialog::Listener:
virtual void MultiFilesSelected(const std::vector<FilePath>& files, virtual void MultiFilesSelected(const std::vector<base::FilePath>& files,
void* params) OVERRIDE; void* params) OVERRIDE;
virtual void FileSelectionCanceled(void* params) OVERRIDE; virtual void FileSelectionCanceled(void* params) OVERRIDE;
@@ -289,7 +288,7 @@ class BookmarksIOFunction : public BookmarksFunction,
private: private:
void ShowSelectFileDialog( void ShowSelectFileDialog(
ui::SelectFileDialog::Type type, ui::SelectFileDialog::Type type,
const FilePath& default_path); const base::FilePath& default_path);
protected: protected:
scoped_refptr<ui::SelectFileDialog> select_file_dialog_; scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
@@ -300,7 +299,7 @@ class BookmarksImportFunction : public BookmarksIOFunction {
DECLARE_EXTENSION_FUNCTION("bookmarks.import", BOOKMARKS_IMPORT) DECLARE_EXTENSION_FUNCTION("bookmarks.import", BOOKMARKS_IMPORT)
// BookmarkManagerIOFunction: // BookmarkManagerIOFunction:
virtual void FileSelected(const FilePath& path, virtual void FileSelected(const base::FilePath& path,
int index, int index,
void* params) OVERRIDE; void* params) OVERRIDE;
@@ -316,7 +315,7 @@ class BookmarksExportFunction : public BookmarksIOFunction {
DECLARE_EXTENSION_FUNCTION("bookmarks.export", BOOKMARKS_EXPORT) DECLARE_EXTENSION_FUNCTION("bookmarks.export", BOOKMARKS_EXPORT)
// BookmarkManagerIOFunction: // BookmarkManagerIOFunction:
virtual void FileSelected(const FilePath& path, virtual void FileSelected(const base::FilePath& path,
int index, int index,
void* params) OVERRIDE; void* params) OVERRIDE;

@@ -13,7 +13,6 @@
#include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/media_gallery/media_galleries_preferences.h" #include "chrome/browser/media_gallery/media_galleries_preferences.h"
class FilePath;
class Profile; class Profile;
namespace extensions { namespace extensions {

@@ -19,7 +19,6 @@
#include "chrome/browser/media_gallery/media_galleries_preferences.h" #include "chrome/browser/media_gallery/media_galleries_preferences.h"
#include "chrome/browser/system_monitor/removable_storage_observer.h" #include "chrome/browser/system_monitor/removable_storage_observer.h"
class FilePath;
class Profile; class Profile;
namespace base { namespace base {

@@ -8,7 +8,9 @@
#include "base/process.h" #include "base/process.h"
#include "chrome/browser/extensions/api/messaging/native_message_process_host.h" #include "chrome/browser/extensions/api/messaging/native_message_process_host.h"
namespace base {
class FilePath; class FilePath;
}
namespace extensions { namespace extensions {
@@ -35,7 +37,7 @@ class NativeProcessLauncher {
protected: protected:
static bool LaunchNativeProcess( static bool LaunchNativeProcess(
const FilePath& path, const base::FilePath& path,
base::ProcessHandle* native_process_handle, base::ProcessHandle* native_process_handle,
base::PlatformFile* read_file, base::PlatformFile* read_file,
base::PlatformFile* write_file); base::PlatformFile* write_file);

@@ -12,7 +12,9 @@
#include "chrome/common/extensions/api/page_capture.h" #include "chrome/common/extensions/api/page_capture.h"
#include "webkit/blob/shareable_file_reference.h" #include "webkit/blob/shareable_file_reference.h"
namespace base {
class FilePath; class FilePath;
}
namespace content { namespace content {
class WebContents; class WebContents;
@@ -29,7 +31,7 @@ class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction {
public: public:
// Called on the UI thread when the temporary file that contains the // Called on the UI thread when the temporary file that contains the
// generated data has been created. // generated data has been created.
virtual void OnTemporaryFileCreated(const FilePath& temp_file) = 0; virtual void OnTemporaryFileCreated(const base::FilePath& temp_file) = 0;
}; };
static void SetTestDelegate(TestDelegate* delegate); static void SetTestDelegate(TestDelegate* delegate);
@@ -48,7 +50,7 @@ class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction {
void ReturnSuccess(int64 file_size); void ReturnSuccess(int64 file_size);
// Callback called once the MHTML generation is done. // Callback called once the MHTML generation is done.
void MHTMLGenerated(const FilePath& file_path, int64 mhtml_file_size); void MHTMLGenerated(const base::FilePath& file_path, int64 mhtml_file_size);
// Returns the WebContents we are associated with, NULL if it's been closed. // Returns the WebContents we are associated with, NULL if it's been closed.
content::WebContents* GetWebContents(); content::WebContents* GetWebContents();
@@ -56,7 +58,7 @@ class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction {
scoped_ptr<extensions::api::page_capture::SaveAsMHTML::Params> params_; scoped_ptr<extensions::api::page_capture::SaveAsMHTML::Params> params_;
// The path to the temporary file containing the MHTML data. // The path to the temporary file containing the MHTML data.
FilePath mhtml_path_; base::FilePath mhtml_path_;
// The file containing the MHTML. // The file containing the MHTML.
scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_;

@@ -13,7 +13,9 @@
#include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h" #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h"
#include "chrome/browser/extensions/api/storage/value_store_cache.h" #include "chrome/browser/extensions/api/storage/value_store_cache.h"
namespace base {
class FilePath; class FilePath;
}
namespace extensions { namespace extensions {
@@ -30,7 +32,7 @@ class SyncOrLocalValueStoreCache : public ValueStoreCache {
const scoped_refptr<SettingsStorageFactory>& factory, const scoped_refptr<SettingsStorageFactory>& factory,
const SettingsStorageQuotaEnforcer::Limits& quota, const SettingsStorageQuotaEnforcer::Limits& quota,
const scoped_refptr<SettingsObserverList>& observers, const scoped_refptr<SettingsObserverList>& observers,
const FilePath& profile_path); const base::FilePath& profile_path);
virtual ~SyncOrLocalValueStoreCache(); virtual ~SyncOrLocalValueStoreCache();
SettingsBackend* GetAppBackend() const; SettingsBackend* GetAppBackend() const;
@@ -48,7 +50,7 @@ class SyncOrLocalValueStoreCache : public ValueStoreCache {
void InitOnFileThread(const scoped_refptr<SettingsStorageFactory>& factory, void InitOnFileThread(const scoped_refptr<SettingsStorageFactory>& factory,
const SettingsStorageQuotaEnforcer::Limits& quota, const SettingsStorageQuotaEnforcer::Limits& quota,
const scoped_refptr<SettingsObserverList>& observers, const scoped_refptr<SettingsObserverList>& observers,
const FilePath& profile_path); const base::FilePath& profile_path);
settings_namespace::Namespace settings_namespace_; settings_namespace::Namespace settings_namespace_;
scoped_ptr<SettingsBackend> app_backend_; scoped_ptr<SettingsBackend> app_backend_;

@@ -119,7 +119,7 @@ class AppNotificationManager
virtual ~AppNotificationManager(); virtual ~AppNotificationManager();
// Starts loading storage_ using |storage_path|. // Starts loading storage_ using |storage_path|.
void LoadOnFileThread(const FilePath& storage_path); void LoadOnFileThread(const base::FilePath& storage_path);
// Called on the UI thread to handle the loaded results from storage_. // Called on the UI thread to handle the loaded results from storage_.
void HandleLoadResults(NotificationMap* map); void HandleLoadResults(NotificationMap* map);

@@ -9,7 +9,9 @@
#include "chrome/browser/extensions/app_notification.h" #include "chrome/browser/extensions/app_notification.h"
namespace base {
class FilePath; class FilePath;
}
namespace extensions { namespace extensions {
@@ -20,7 +22,7 @@ namespace extensions {
class AppNotificationStorage { class AppNotificationStorage {
public: public:
// Must be called on the FILE thread. The storage will be created at |path|. // Must be called on the FILE thread. The storage will be created at |path|.
static AppNotificationStorage* Create(const FilePath& path); static AppNotificationStorage* Create(const base::FilePath& path);
virtual ~AppNotificationStorage(); virtual ~AppNotificationStorage();

@@ -10,9 +10,12 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/string16.h" #include "base/string16.h"
class FilePath;
class GURL; class GURL;
namespace base {
class FilePath;
}
namespace extensions { namespace extensions {
class Extension; class Extension;
@@ -24,8 +27,8 @@ class Extension;
// NOTE: The caller takes ownership of the directory at extension->path() on the // NOTE: The caller takes ownership of the directory at extension->path() on the
// returned object. // returned object.
scoped_refptr<extensions::Extension> ConvertUserScriptToExtension( scoped_refptr<extensions::Extension> ConvertUserScriptToExtension(
const FilePath& user_script, const GURL& original_url, const base::FilePath& user_script, const GURL& original_url,
const FilePath& extensions_dir, string16* error); const base::FilePath& extensions_dir, string16* error);
} // namespace extensions } // namespace extensions

@@ -9,9 +9,8 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class Time; class Time;
} }
@@ -41,7 +40,7 @@ std::string ConvertTimeToExtensionVersion(const base::Time& time);
scoped_refptr<Extension> ConvertWebAppToExtension( scoped_refptr<Extension> ConvertWebAppToExtension(
const WebApplicationInfo& web_app_info, const WebApplicationInfo& web_app_info,
const base::Time& create_time, const base::Time& create_time,
const FilePath& extensions_dir); const base::FilePath& extensions_dir);
} // namespace extensions } // namespace extensions

@@ -13,13 +13,14 @@
#include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/extension_browsertest.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
namespace base {
class FilePath; class FilePath;
}
namespace extensions { namespace extensions {
class Extension; class Extension;
} }
// The general flow of these API tests should work like this: // The general flow of these API tests should work like this:
// (1) Setup initial browser state (e.g. create some bookmarks for the // (1) Setup initial browser state (e.g. create some bookmarks for the
// bookmark test) // bookmark test)
@@ -158,7 +159,7 @@ class ExtensionApiTest : public ExtensionBrowserTest {
// Start the test WebSocket server, and store details of its state. Those // Start the test WebSocket server, and store details of its state. Those
// details will be available to javascript tests using // details will be available to javascript tests using
// chrome.test.getConfig(). // chrome.test.getConfig().
bool StartWebSocketServer(const FilePath& root_directory); bool StartWebSocketServer(const base::FilePath& root_directory);
// Test that exactly one extension loaded. If so, return a pointer to // Test that exactly one extension loaded. If so, return a pointer to
// the extension. If not, return NULL and set message_. // the extension. If not, return NULL and set message_.

@@ -10,12 +10,14 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace base {
class FilePath;
}
namespace crypto { namespace crypto {
class RSAPrivateKey; class RSAPrivateKey;
} }
class FilePath;
namespace extensions { namespace extensions {
// This class create an installable extension (.crx file) given an input // This class create an installable extension (.crx file) given an input
@@ -37,10 +39,10 @@ class ExtensionCreator {
// Categories of error that may need special handling on the UI end. // Categories of error that may need special handling on the UI end.
enum ErrorType { kOtherError, kCRXExists }; enum ErrorType { kOtherError, kCRXExists };
bool Run(const FilePath& extension_dir, bool Run(const base::FilePath& extension_dir,
const FilePath& crx_path, const base::FilePath& crx_path,
const FilePath& private_key_path, const base::FilePath& private_key_path,
const FilePath& private_key_output_path, const base::FilePath& private_key_output_path,
int run_flags); int run_flags);
// Returns the error message that will be present if Run(...) returned false. // Returns the error message that will be present if Run(...) returned false.
@@ -56,38 +58,38 @@ class ExtensionCreator {
// the extension. If not provided, a random key will be created (in which case // the extension. If not provided, a random key will be created (in which case
// it is written to |private_key_output_path| -- if provided). // it is written to |private_key_output_path| -- if provided).
// |flags| is a bitset of RunFlags values. // |flags| is a bitset of RunFlags values.
bool InitializeInput(const FilePath& extension_dir, bool InitializeInput(const base::FilePath& extension_dir,
const FilePath& crx_path, const base::FilePath& crx_path,
const FilePath& private_key_path, const base::FilePath& private_key_path,
const FilePath& private_key_output_path, const base::FilePath& private_key_output_path,
int run_flags); int run_flags);
// Validates the manifest by trying to load the extension. // Validates the manifest by trying to load the extension.
bool ValidateManifest(const FilePath& extension_dir, bool ValidateManifest(const base::FilePath& extension_dir,
crypto::RSAPrivateKey* key_pair, crypto::RSAPrivateKey* key_pair,
int run_flags); int run_flags);
// Reads private key from |private_key_path|. // Reads private key from |private_key_path|.
crypto::RSAPrivateKey* ReadInputKey(const FilePath& private_key_path); crypto::RSAPrivateKey* ReadInputKey(const base::FilePath& private_key_path);
// Generates a key pair and writes the private key to |private_key_path| // Generates a key pair and writes the private key to |private_key_path|
// if provided. // if provided.
crypto::RSAPrivateKey* GenerateKey(const FilePath& private_key_path); crypto::RSAPrivateKey* GenerateKey(const base::FilePath& private_key_path);
// Creates temporary zip file for the extension. // Creates temporary zip file for the extension.
bool CreateZip(const FilePath& extension_dir, const FilePath& temp_path, bool CreateZip(const base::FilePath& extension_dir, const base::FilePath& temp_path,
FilePath* zip_path); base::FilePath* zip_path);
// Signs the temporary zip and returns the signature. // Signs the temporary zip and returns the signature.
bool SignZip(const FilePath& zip_path, bool SignZip(const base::FilePath& zip_path,
crypto::RSAPrivateKey* private_key, crypto::RSAPrivateKey* private_key,
std::vector<uint8>* signature); std::vector<uint8>* signature);
// Export installable .crx to |crx_path|. // Export installable .crx to |crx_path|.
bool WriteCRX(const FilePath& zip_path, bool WriteCRX(const base::FilePath& zip_path,
crypto::RSAPrivateKey* private_key, crypto::RSAPrivateKey* private_key,
const std::vector<uint8>& signature, const std::vector<uint8>& signature,
const FilePath& crx_path); const base::FilePath& crx_path);
// Holds a message for any error that is raised during Run(...). // Holds a message for any error that is raised during Run(...).
std::string error_message_; std::string error_message_;

@@ -7,7 +7,9 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
namespace base {
class FilePath; class FilePath;
}
namespace extensions { namespace extensions {
@@ -18,9 +20,9 @@ class ExtensionCreatorFilter
public: public:
ExtensionCreatorFilter() {} ExtensionCreatorFilter() {}
// Returns true if the given FilePath should be included in a // Returns true if the given base::FilePath should be included in a
// packed extension. // packed extension.
bool ShouldPackageFile(const FilePath& file_path); bool ShouldPackageFile(const base::FilePath& file_path);
private: private:
friend class base::RefCounted<ExtensionCreatorFilter>; friend class base::RefCounted<ExtensionCreatorFilter>;

@@ -10,10 +10,13 @@
#include "base/memory/linked_ptr.h" #include "base/memory/linked_ptr.h"
#include "chrome/common/extensions/manifest.h" #include "chrome/common/extensions/manifest.h"
class FilePath;
class GURL; class GURL;
class Version; class Version;
namespace base {
class FilePath;
}
namespace extensions { namespace extensions {
// This class is an abstract class for implementing external extensions // This class is an abstract class for implementing external extensions
@@ -33,7 +36,7 @@ class ExternalProviderInterface {
virtual bool OnExternalExtensionFileFound( virtual bool OnExternalExtensionFileFound(
const std::string& id, const std::string& id,
const Version* version, const Version* version,
const FilePath& path, const base::FilePath& path,
Manifest::Location location, Manifest::Location location,
int creation_flags, int creation_flags,
bool mark_acknowledged) = 0; bool mark_acknowledged) = 0;

@@ -8,9 +8,12 @@
#include <string> #include <string>
class CommandLine; class CommandLine;
class FilePath;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace content { namespace content {
class WebContents; class WebContents;
class WebIntentsDispatcher; class WebIntentsDispatcher;
@@ -27,20 +30,20 @@ class Extension;
void LaunchPlatformApp(Profile* profile, void LaunchPlatformApp(Profile* profile,
const Extension* extension, const Extension* extension,
const CommandLine* command_line, const CommandLine* command_line,
const FilePath& current_directory); const base::FilePath& current_directory);
// Launches the platform app |extension| with the contents of |file_path| // Launches the platform app |extension| with the contents of |file_path|
// available through the launch data. // available through the launch data.
void LaunchPlatformAppWithPath(Profile* profile, void LaunchPlatformAppWithPath(Profile* profile,
const Extension* extension, const Extension* extension,
const FilePath& file_path); const base::FilePath& file_path);
// Launches the platform app |extension| with the contents of |file_path| // Launches the platform app |extension| with the contents of |file_path|
// available through the launch data. // available through the launch data.
void LaunchPlatformAppWithFileHandler(Profile* profile, void LaunchPlatformAppWithFileHandler(Profile* profile,
const Extension* extension, const Extension* extension,
const std::string& handler_id, const std::string& handler_id,
const FilePath& file_path); const base::FilePath& file_path);
#if defined(ENABLE_WEB_INTENTS) #if defined(ENABLE_WEB_INTENTS)
// Launches the platform app |extension| with the supplied web intent. Creates // Launches the platform app |extension| with the supplied web intent. Creates

@@ -8,8 +8,9 @@
#include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/extension_system.h"
class CommandLine; class CommandLine;
class FilePath;
namespace base { namespace base {
class FilePath;
class Time; class Time;
} }
@@ -27,7 +28,7 @@ class TestExtensionSystem : public ExtensionSystem {
// Creates an ExtensionService initialized with the testing profile and // Creates an ExtensionService initialized with the testing profile and
// returns it. // returns it.
ExtensionService* CreateExtensionService(const CommandLine* command_line, ExtensionService* CreateExtensionService(const CommandLine* command_line,
const FilePath& install_directory, const base::FilePath& install_directory,
bool autoupdate_enabled); bool autoupdate_enabled);
// Creates an ExtensionProcessManager. If not invoked, the // Creates an ExtensionProcessManager. If not invoked, the

@@ -11,9 +11,12 @@
#include "base/time.h" #include "base/time.h"
#include "chrome/browser/extensions/updater/manifest_fetch_data.h" #include "chrome/browser/extensions/updater/manifest_fetch_data.h"
class FilePath;
class GURL; class GURL;
namespace base {
class FilePath;
}
namespace extensions { namespace extensions {
class ExtensionDownloaderDelegate { class ExtensionDownloaderDelegate {
@@ -80,7 +83,7 @@ class ExtensionDownloaderDelegate {
// to the delegate. // to the delegate.
virtual void OnExtensionDownloadFinished( virtual void OnExtensionDownloadFinished(
const std::string& id, const std::string& id,
const FilePath& path, const base::FilePath& path,
const GURL& download_url, const GURL& download_url,
const std::string& version, const std::string& version,
const PingResult& ping_result, const PingResult& ping_result,

@@ -21,9 +21,12 @@
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
class FilePath;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace content { namespace content {
class NavigationController; class NavigationController;
} }
@@ -142,7 +145,7 @@ class WebstoreInstaller :public content::NotificationObserver,
// Instead of using the default download directory, use |directory| instead. // Instead of using the default download directory, use |directory| instead.
// This does *not* transfer ownership of |directory|. // This does *not* transfer ownership of |directory|.
static void SetDownloadDirectoryForTests(FilePath* directory); static void SetDownloadDirectoryForTests(base::FilePath* directory);
private: private:
friend struct content::BrowserThread::DeleteOnThread< friend struct content::BrowserThread::DeleteOnThread<
@@ -158,7 +161,7 @@ class WebstoreInstaller :public content::NotificationObserver,
virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE;
// Starts downloading the extension to |file_path|. // Starts downloading the extension to |file_path|.
void StartDownload(const FilePath& file_path); void StartDownload(const base::FilePath& file_path);
// Reports an install |error| to the delegate for the given extension if this // Reports an install |error| to the delegate for the given extension if this
// managed its installation. This also removes the associated PendingInstall. // managed its installation. This also removes the associated PendingInstall.

@@ -17,12 +17,15 @@
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
class CommandLine; class CommandLine;
class FilePath;
class GURL; class GURL;
class PrefServiceSyncable; class PrefServiceSyncable;
class Profile; class Profile;
class ProcessSingleton; class ProcessSingleton;
namespace base {
class FilePath;
}
// This namespace contains the chrome first-run installation actions needed to // This namespace contains the chrome first-run installation actions needed to
// fully test the custom installer. It also contains the opposite actions to // fully test the custom installer. It also contains the opposite actions to
// execute during uninstall. When the first run UI is ready we won't // execute during uninstall. When the first run UI is ready we won't
@@ -133,10 +136,10 @@ void DoPostImportTasks(Profile* profile, bool make_chrome_default);
int ImportNow(Profile* profile, const CommandLine& cmdline); int ImportNow(Profile* profile, const CommandLine& cmdline);
// Returns the path for the master preferences file. // Returns the path for the master preferences file.
FilePath MasterPrefsPath(); base::FilePath MasterPrefsPath();
// Set a master preferences file path that overrides platform defaults. // Set a master preferences file path that overrides platform defaults.
void SetMasterPrefsPathForTesting(const FilePath& master_prefs); void SetMasterPrefsPathForTesting(const base::FilePath& master_prefs);
// The master preferences is a JSON file with the same entries as the // The master preferences is a JSON file with the same entries as the
// 'Default\Preferences' file. This function locates this file from a standard // 'Default\Preferences' file. This function locates this file from a standard
@@ -152,7 +155,7 @@ void SetMasterPrefsPathForTesting(const FilePath& master_prefs);
// See chrome/installer/util/master_preferences.h for a description of // See chrome/installer/util/master_preferences.h for a description of
// 'master_preferences' file. // 'master_preferences' file.
ProcessMasterPreferencesResult ProcessMasterPreferences( ProcessMasterPreferencesResult ProcessMasterPreferences(
const FilePath& user_data_dir, const base::FilePath& user_data_dir,
MasterPrefs* out_prefs); MasterPrefs* out_prefs);
// Show the first run search engine bubble at the first appropriate opportunity. // Show the first run search engine bubble at the first appropriate opportunity.

@@ -14,7 +14,6 @@
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
class CommandLine; class CommandLine;
class FilePath;
class GURL; class GURL;
class ImporterHost; class ImporterHost;
class ImporterList; class ImporterList;
@@ -22,6 +21,10 @@ class Profile;
class ProcessSingleton; class ProcessSingleton;
class TemplateURLService; class TemplateURLService;
namespace base {
class FilePath;
}
namespace installer { namespace installer {
class MasterPreferences; class MasterPreferences;
} }
@@ -42,12 +45,12 @@ extern FirstRunState first_run_;
// master preferences. Passes the master preference file path out in // master preferences. Passes the master preference file path out in
// master_prefs_path. Returns the pointer to installer::MasterPreferences object // master_prefs_path. Returns the pointer to installer::MasterPreferences object
// if successful; otherwise, returns NULL. // if successful; otherwise, returns NULL.
installer::MasterPreferences* LoadMasterPrefs(FilePath* master_prefs_path); installer::MasterPreferences* LoadMasterPrefs(base::FilePath* master_prefs_path);
// Copies user preference file to master preference file. Returns true if // Copies user preference file to master preference file. Returns true if
// successful. // successful.
bool CopyPrefFile(const FilePath& user_data_dir, bool CopyPrefFile(const base::FilePath& user_data_dir,
const FilePath& master_prefs_path); const base::FilePath& master_prefs_path);
// Sets up master preferences by preferences passed by installer. // Sets up master preferences by preferences passed by installer.
void SetupMasterPrefsFromInstallPrefs( void SetupMasterPrefsFromInstallPrefs(
@@ -75,7 +78,7 @@ void DoPostImportPlatformSpecificTasks();
// Gives the full path to the sentinel file. The file might not exist. // Gives the full path to the sentinel file. The file might not exist.
// This function has a common implementation on OS_POSIX and a windows specific // This function has a common implementation on OS_POSIX and a windows specific
// implementation. // implementation.
bool GetFirstRunSentinelFilePath(FilePath* path); bool GetFirstRunSentinelFilePath(base::FilePath* path);
// This function has a common implementationin for all non-linux platforms, and // This function has a common implementationin for all non-linux platforms, and
// a linux specific implementation. // a linux specific implementation.
@@ -100,7 +103,7 @@ int ImportBookmarkFromFileIfNeeded(Profile* profile,
const CommandLine& cmdline); const CommandLine& cmdline);
#if !defined(OS_WIN) #if !defined(OS_WIN)
bool ImportBookmarks(const FilePath& import_bookmarks_path); bool ImportBookmarks(const base::FilePath& import_bookmarks_path);
#endif #endif
// Shows the EULA dialog if required. Returns true if the EULA is accepted, // Shows the EULA dialog if required. Returns true if the EULA is accepted,

@@ -14,10 +14,13 @@
#include "chrome/browser/google_apis/drive_api_url_generator.h" #include "chrome/browser/google_apis/drive_api_url_generator.h"
#include "chrome/browser/google_apis/drive_service_interface.h" #include "chrome/browser/google_apis/drive_service_interface.h"
class FilePath;
class GURL; class GURL;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace net { namespace net {
class URLRequestContextGetter; class URLRequestContextGetter;
} // namespace net } // namespace net
@@ -51,7 +54,7 @@ class DriveAPIService : public DriveServiceInterface,
virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE; virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE;
virtual bool CanStartOperation() const OVERRIDE; virtual bool CanStartOperation() const OVERRIDE;
virtual void CancelAll() OVERRIDE; virtual void CancelAll() OVERRIDE;
virtual bool CancelForFilePath(const FilePath& file_path) OVERRIDE; virtual bool CancelForFilePath(const base::FilePath& file_path) OVERRIDE;
virtual OperationProgressStatusList GetProgressStatusList() const OVERRIDE; virtual OperationProgressStatusList GetProgressStatusList() const OVERRIDE;
virtual bool HasAccessToken() const OVERRIDE; virtual bool HasAccessToken() const OVERRIDE;
virtual bool HasRefreshToken() const OVERRIDE; virtual bool HasRefreshToken() const OVERRIDE;
@@ -74,8 +77,8 @@ class DriveAPIService : public DriveServiceInterface,
const std::string& resource_id, const std::string& resource_id,
const EntryActionCallback& callback) OVERRIDE; const EntryActionCallback& callback) OVERRIDE;
virtual void DownloadFile( virtual void DownloadFile(
const FilePath& virtual_path, const base::FilePath& virtual_path,
const FilePath& local_cache_path, const base::FilePath& local_cache_path,
const GURL& content_url, const GURL& content_url,
const DownloadActionCallback& download_action_callback, const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback) OVERRIDE; const GetContentCallback& get_content_callback) OVERRIDE;

@@ -15,17 +15,20 @@
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h" #include "chrome/browser/google_apis/gdata_wapi_parser.h"
class FilePath;
class GURL; class GURL;
namespace base {
class FilePath;
}
namespace google_apis { namespace google_apis {
class DriveServiceInterface; class DriveServiceInterface;
struct ResumeUploadResponse; struct ResumeUploadResponse;
// Callback to be invoked once the upload has completed. // Callback to be invoked once the upload has completed.
typedef base::Callback<void(DriveUploadError error, typedef base::Callback<void(DriveUploadError error,
const FilePath& drive_path, const base::FilePath& drive_path,
const FilePath& file_path, const base::FilePath& file_path,
scoped_ptr<ResourceEntry> resource_entry)> scoped_ptr<ResourceEntry> resource_entry)>
UploadCompletionCallback; UploadCompletionCallback;
@@ -55,8 +58,8 @@ class DriveUploaderInterface {
// Called when an upload is done regardless of it was successful or not. // Called when an upload is done regardless of it was successful or not.
// Must not be null. // Must not be null.
virtual void UploadNewFile(const GURL& upload_location, virtual void UploadNewFile(const GURL& upload_location,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
const FilePath& local_file_path, const base::FilePath& local_file_path,
const std::string& title, const std::string& title,
const std::string& content_type, const std::string& content_type,
const UploadCompletionCallback& callback) = 0; const UploadCompletionCallback& callback) = 0;
@@ -70,8 +73,8 @@ class DriveUploaderInterface {
// fails with UPLOAD_ERROR_CONFLICT. // fails with UPLOAD_ERROR_CONFLICT.
// If |etag| is empty, the test is skipped. // If |etag| is empty, the test is skipped.
virtual void UploadExistingFile(const GURL& upload_location, virtual void UploadExistingFile(const GURL& upload_location,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
const FilePath& local_file_path, const base::FilePath& local_file_path,
const std::string& content_type, const std::string& content_type,
const std::string& etag, const std::string& etag,
const UploadCompletionCallback& callback) = 0; const UploadCompletionCallback& callback) = 0;
@@ -84,15 +87,15 @@ class DriveUploader : public DriveUploaderInterface {
// DriveUploaderInterface overrides. // DriveUploaderInterface overrides.
virtual void UploadNewFile(const GURL& upload_location, virtual void UploadNewFile(const GURL& upload_location,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
const FilePath& local_file_path, const base::FilePath& local_file_path,
const std::string& title, const std::string& title,
const std::string& content_type, const std::string& content_type,
const UploadCompletionCallback& callback) OVERRIDE; const UploadCompletionCallback& callback) OVERRIDE;
virtual void UploadExistingFile( virtual void UploadExistingFile(
const GURL& upload_location, const GURL& upload_location,
const FilePath& drive_file_path, const base::FilePath& drive_file_path,
const FilePath& local_file_path, const base::FilePath& local_file_path,
const std::string& content_type, const std::string& content_type,
const std::string& etag, const std::string& etag,
const UploadCompletionCallback& callback) OVERRIDE; const UploadCompletionCallback& callback) OVERRIDE;

@@ -17,12 +17,13 @@
#include "chrome/browser/google_apis/drive_entry_kinds.h" #include "chrome/browser/google_apis/drive_entry_kinds.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
class FilePath;
class Profile; class Profile;
namespace base { namespace base {
class Value; class FilePath;
class DictionaryValue; class DictionaryValue;
class Value;
template <class StructType> template <class StructType>
class JSONValueConverter; class JSONValueConverter;
@@ -421,7 +422,7 @@ class ResourceEntry : public FeedEntry {
static bool ParseChangestamp(const base::Value* value, int64* result); static bool ParseChangestamp(const base::Value* value, int64* result);
// Returns true if |file| has one of the hosted document extensions. // Returns true if |file| has one of the hosted document extensions.
static bool HasHostedDocumentExtension(const FilePath& file); static bool HasHostedDocumentExtension(const base::FilePath& file);
// The resource ID is used to identify a resource, which looks like: // The resource ID is used to identify a resource, which looks like:
// file:d41d8cd98f00b204e9800998ecf8 // file:d41d8cd98f00b204e9800998ecf8

@@ -15,10 +15,13 @@
#include "chrome/browser/google_apis/gdata_wapi_operations.h" #include "chrome/browser/google_apis/gdata_wapi_operations.h"
#include "chrome/browser/google_apis/gdata_wapi_url_generator.h" #include "chrome/browser/google_apis/gdata_wapi_url_generator.h"
class FilePath;
class GURL; class GURL;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace net { namespace net {
class URLRequestContextGetter; class URLRequestContextGetter;
} // namespace net } // namespace net
@@ -55,7 +58,7 @@ class GDataWapiService : public DriveServiceInterface,
virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE; virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE;
virtual bool CanStartOperation() const OVERRIDE; virtual bool CanStartOperation() const OVERRIDE;
virtual void CancelAll() OVERRIDE; virtual void CancelAll() OVERRIDE;
virtual bool CancelForFilePath(const FilePath& file_path) OVERRIDE; virtual bool CancelForFilePath(const base::FilePath& file_path) OVERRIDE;
virtual OperationProgressStatusList GetProgressStatusList() const OVERRIDE; virtual OperationProgressStatusList GetProgressStatusList() const OVERRIDE;
virtual bool HasAccessToken() const OVERRIDE; virtual bool HasAccessToken() const OVERRIDE;
virtual bool HasRefreshToken() const OVERRIDE; virtual bool HasRefreshToken() const OVERRIDE;
@@ -76,8 +79,8 @@ class GDataWapiService : public DriveServiceInterface,
virtual void DeleteResource(const std::string& resource_id, virtual void DeleteResource(const std::string& resource_id,
const EntryActionCallback& callback) OVERRIDE; const EntryActionCallback& callback) OVERRIDE;
virtual void DownloadFile( virtual void DownloadFile(
const FilePath& virtual_path, const base::FilePath& virtual_path,
const FilePath& local_cache_path, const base::FilePath& local_cache_path,
const GURL& content_url, const GURL& content_url,
const DownloadActionCallback& download_action_callback, const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback) OVERRIDE; const GetContentCallback& get_content_callback) OVERRIDE;

@@ -13,7 +13,9 @@
#include "chrome/browser/google_apis/drive_service_interface.h" #include "chrome/browser/google_apis/drive_service_interface.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
namespace base {
class FilePath; class FilePath;
}
namespace google_apis { namespace google_apis {
@@ -30,7 +32,7 @@ class MockDriveService : public DriveServiceInterface {
void(DriveServiceObserver* observer)); void(DriveServiceObserver* observer));
MOCK_CONST_METHOD0(CanStartOperation, bool()); MOCK_CONST_METHOD0(CanStartOperation, bool());
MOCK_METHOD0(CancelAll, void(void)); MOCK_METHOD0(CancelAll, void(void));
MOCK_METHOD1(CancelForFilePath, bool(const FilePath& file_path)); MOCK_METHOD1(CancelForFilePath, bool(const base::FilePath& file_path));
MOCK_CONST_METHOD0(GetProgressStatusList, MOCK_CONST_METHOD0(GetProgressStatusList,
OperationProgressStatusList()); OperationProgressStatusList());
MOCK_CONST_METHOD0(GetRootResourceId, std::string()); MOCK_CONST_METHOD0(GetRootResourceId, std::string());
@@ -72,8 +74,8 @@ class MockDriveService : public DriveServiceInterface {
const GetResourceEntryCallback& callback)); const GetResourceEntryCallback& callback));
MOCK_METHOD5( MOCK_METHOD5(
DownloadFile, DownloadFile,
void(const FilePath& virtual_path, void(const base::FilePath& virtual_path,
const FilePath& local_cache_path, const base::FilePath& local_cache_path,
const GURL& content_url, const GURL& content_url,
const DownloadActionCallback& const DownloadActionCallback&
donwload_action_callback, donwload_action_callback,
@@ -151,8 +153,8 @@ class MockDriveService : public DriveServiceInterface {
// portion of the URL as the temporary file path. If |file_data_| is not null, // portion of the URL as the temporary file path. If |file_data_| is not null,
// |file_data_| is written to the temporary file. // |file_data_| is written to the temporary file.
void DownloadFileStub( void DownloadFileStub(
const FilePath& virtual_path, const base::FilePath& virtual_path,
const FilePath& local_tmp_path, const base::FilePath& local_tmp_path,
const GURL& content_url, const GURL& content_url,
const DownloadActionCallback& download_action_callback, const DownloadActionCallback& download_action_callback,
const GetContentCallback& get_content_callback); const GetContentCallback& get_content_callback);

@@ -11,9 +11,8 @@
#include "chrome/browser/google_apis/gdata_errorcode.h" #include "chrome/browser/google_apis/gdata_errorcode.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
class FilePath;
namespace base { namespace base {
class FilePath;
class Value; class Value;
} }
@@ -42,7 +41,7 @@ void RunBlockingPoolTask();
// Returns the absolute path for a test file stored under // Returns the absolute path for a test file stored under
// chrome/test/data/chromeos. // chrome/test/data/chromeos.
FilePath GetTestFilePath(const std::string& relative_path); base::FilePath GetTestFilePath(const std::string& relative_path);
// Returns the base URL for communicating with the local test server for // Returns the base URL for communicating with the local test server for
// testing, running at the specified port number. // testing, running at the specified port number.
@@ -103,13 +102,13 @@ void CopyResultsFromGetAppListCallback(
// Copies the results from DownloadActionCallback. // Copies the results from DownloadActionCallback.
void CopyResultsFromDownloadActionCallback( void CopyResultsFromDownloadActionCallback(
GDataErrorCode* error_out, GDataErrorCode* error_out,
FilePath* temp_file_out, base::FilePath* temp_file_out,
GDataErrorCode error_in, GDataErrorCode error_in,
const FilePath& temp_file_in); const base::FilePath& temp_file_in);
// Returns a HttpResponse created from the given file path. // Returns a HttpResponse created from the given file path.
scoped_ptr<test_server::HttpResponse> CreateHttpResponseFromFile( scoped_ptr<test_server::HttpResponse> CreateHttpResponseFromFile(
const FilePath& file_path); const base::FilePath& file_path);
// Does nothing for ReAuthenticateCallback(). This function should be used // Does nothing for ReAuthenticateCallback(). This function should be used
// if it is not expected to reach this method as there won't be any // if it is not expected to reach this method as there won't be any
@@ -120,7 +119,7 @@ void DoNothingForReAuthenticateCallback(
// Returns true if |json_data| is not NULL and equals to the content in // Returns true if |json_data| is not NULL and equals to the content in
// |expected_json_file_path|. The failure reason will be logged into LOG(ERROR) // |expected_json_file_path|. The failure reason will be logged into LOG(ERROR)
// if necessary. // if necessary.
bool VerifyJsonData(const FilePath& expected_json_file_path, bool VerifyJsonData(const base::FilePath& expected_json_file_path,
const base::Value* json_data); const base::Value* json_data);
} // namespace test_util } // namespace test_util

@@ -9,7 +9,6 @@
#include "base/string_piece.h" #include "base/string_piece.h"
class FilePath;
class Profile; class Profile;
namespace base { namespace base {

@@ -24,7 +24,7 @@ ArchivedDatabase::ArchivedDatabase() {
ArchivedDatabase::~ArchivedDatabase() { ArchivedDatabase::~ArchivedDatabase() {
} }
bool ArchivedDatabase::Init(const FilePath& file_name) { bool ArchivedDatabase::Init(const base::FilePath& file_name) {
// Set the database page size to something a little larger to give us // Set the database page size to something a little larger to give us
// better performance (we're typically seek rather than bandwidth limited). // better performance (we're typically seek rather than bandwidth limited).
// This only has an effect before any tables have been created, otherwise // This only has an effect before any tables have been created, otherwise

@@ -12,7 +12,9 @@
#include "sql/init_status.h" #include "sql/init_status.h"
#include "sql/meta_table.h" #include "sql/meta_table.h"
namespace base {
class FilePath; class FilePath;
}
namespace history { namespace history {
@@ -30,7 +32,7 @@ class ArchivedDatabase : public URLDatabase,
// Initializes the database connection. This must return true before any other // Initializes the database connection. This must return true before any other
// functions on this class are called. // functions on this class are called.
bool Init(const FilePath& file_name); bool Init(const base::FilePath& file_name);
// Transactions on the database. We support nested transactions and only // Transactions on the database. We support nested transactions and only
// commit when the outermost one is committed (sqlite doesn't support true // commit when the outermost one is committed (sqlite doesn't support true

@@ -11,8 +11,6 @@
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "sql/meta_table.h" #include "sql/meta_table.h"
class FilePath;
namespace sql { namespace sql {
class Connection; class Connection;
} }

@@ -23,7 +23,9 @@
#include "chrome/browser/history/android/android_urls_database.h" #include "chrome/browser/history/android/android_urls_database.h"
#endif #endif
namespace base {
class FilePath; class FilePath;
}
namespace history { namespace history {
@@ -67,7 +69,7 @@ class HistoryDatabase : public DownloadDatabase,
// Must call this function to complete initialization. Will return // Must call this function to complete initialization. Will return
// sql::INIT_OK on success. Otherwise, no other function should be called. You // sql::INIT_OK on success. Otherwise, no other function should be called. You
// may want to call BeginExclusiveMode after this when you are ready. // may want to call BeginExclusiveMode after this when you are ready.
sql::InitStatus Init(const FilePath& history_name, sql::InitStatus Init(const base::FilePath& history_name,
sql::ErrorDelegate* error_delegate); sql::ErrorDelegate* error_delegate);
// Call to set the mode on the database to exclusive. The default locking mode // Call to set the mode on the database to exclusive. The default locking mode

@@ -40,7 +40,6 @@
#endif #endif
class BookmarkService; class BookmarkService;
class FilePath;
class GURL; class GURL;
class HistoryURLProvider; class HistoryURLProvider;
class PageUsageData; class PageUsageData;
@@ -49,6 +48,7 @@ class Profile;
struct HistoryURLProviderParams; struct HistoryURLProviderParams;
namespace base { namespace base {
class FilePath;
class Thread; class Thread;
} }
@@ -129,7 +129,7 @@ class HistoryService : public CancelableRequestProvider,
// not call any other functions. The given directory will be used for storing // not call any other functions. The given directory will be used for storing
// the history files. The BookmarkService is used when deleting URLs to // the history files. The BookmarkService is used when deleting URLs to
// test if a URL is bookmarked; it may be NULL during testing. // test if a URL is bookmarked; it may be NULL during testing.
bool Init(const FilePath& history_dir, BookmarkService* bookmark_service) { bool Init(const base::FilePath& history_dir, BookmarkService* bookmark_service) {
return Init(history_dir, bookmark_service, false); return Init(history_dir, bookmark_service, false);
} }
@@ -666,7 +666,7 @@ class HistoryService : public CancelableRequestProvider,
// Low-level Init(). Same as the public version, but adds a |no_db| parameter // Low-level Init(). Same as the public version, but adds a |no_db| parameter
// that is only set by unittests which causes the backend to not init its DB. // that is only set by unittests which causes the backend to not init its DB.
bool Init(const FilePath& history_dir, bool Init(const base::FilePath& history_dir,
BookmarkService* bookmark_service, BookmarkService* bookmark_service,
bool no_db); bool no_db);
@@ -1094,7 +1094,7 @@ class HistoryService : public CancelableRequestProvider,
int current_backend_id_; int current_backend_id_;
// Cached values from Init(), used whenever we need to reload the backend. // Cached values from Init(), used whenever we need to reload the backend.
FilePath history_dir_; base::FilePath history_dir_;
BookmarkService* bookmark_service_; BookmarkService* bookmark_service_;
bool no_db_; bool no_db_;

@@ -9,7 +9,9 @@
#include "chrome/browser/history/url_database.h" #include "chrome/browser/history/url_database.h"
#include "sql/connection.h" #include "sql/connection.h"
namespace base {
class FilePath; class FilePath;
}
namespace history { namespace history {
@@ -28,7 +30,7 @@ class InMemoryDatabase : public URLDatabase {
// file. Conceptually, the InMemoryHistoryBackend should do the populating // file. Conceptually, the InMemoryHistoryBackend should do the populating
// after this object does some common initialization, but that would be // after this object does some common initialization, but that would be
// much slower. // much slower.
bool InitFromDisk(const FilePath& history_name); bool InitFromDisk(const base::FilePath& history_name);
protected: protected:
// Implemented for URLDatabase. // Implemented for URLDatabase.

@@ -27,7 +27,7 @@ InMemoryHistoryBackend::InMemoryHistoryBackend()
InMemoryHistoryBackend::~InMemoryHistoryBackend() {} InMemoryHistoryBackend::~InMemoryHistoryBackend() {}
bool InMemoryHistoryBackend::Init(const FilePath& history_filename, bool InMemoryHistoryBackend::Init(const base::FilePath& history_filename,
URLDatabase* db) { URLDatabase* db) {
db_.reset(new InMemoryDatabase); db_.reset(new InMemoryDatabase);
return db_->InitFromDisk(history_filename); return db_->InitFromDisk(history_filename);

@@ -21,10 +21,13 @@
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
class FilePath;
class GURL; class GURL;
class Profile; class Profile;
namespace base {
class FilePath;
}
namespace history { namespace history {
class InMemoryDatabase; class InMemoryDatabase;
@@ -42,7 +45,7 @@ class InMemoryHistoryBackend : public content::NotificationObserver {
// Initializes the backend from the history database pointed to by the // Initializes the backend from the history database pointed to by the
// full path in |history_filename|. |db| is used for setting up the // full path in |history_filename|. |db| is used for setting up the
// InMemoryDatabase. // InMemoryDatabase.
bool Init(const FilePath& history_filename, URLDatabase* db); bool Init(const base::FilePath& history_filename, URLDatabase* db);
// Does initialization work when this object is attached to the history // Does initialization work when this object is attached to the history
// system on the main thread. The argument is the profile with which the // system on the main thread. The argument is the profile with which the

@@ -15,11 +15,11 @@
#include "sql/meta_table.h" #include "sql/meta_table.h"
#include "sql/statement.h" #include "sql/statement.h"
class FilePath;
struct ThumbnailScore; struct ThumbnailScore;
class SkBitmap; class SkBitmap;
namespace base { namespace base {
class FilePath;
class RefCountedMemory; class RefCountedMemory;
class Time; class Time;
} }
@@ -47,7 +47,7 @@ class ThumbnailDatabase {
// Must be called after creation but before any other methods are called. // Must be called after creation but before any other methods are called.
// When not INIT_OK, no other functions should be called. // When not INIT_OK, no other functions should be called.
sql::InitStatus Init(const FilePath& db_name, sql::InitStatus Init(const base::FilePath& db_name,
const HistoryPublisher* history_publisher, const HistoryPublisher* history_publisher,
URLDatabase* url_database); URLDatabase* url_database);
@@ -56,7 +56,7 @@ class ThumbnailDatabase {
// |db| is the database to open. // |db| is the database to open.
// |db_name| is a path to the database file. // |db_name| is a path to the database file.
static sql::InitStatus OpenDatabase(sql::Connection* db, static sql::InitStatus OpenDatabase(sql::Connection* db,
const FilePath& db_name); const base::FilePath& db_name);
// Transactions on the database. // Transactions on the database.
void BeginTransaction(); void BeginTransaction();
@@ -308,8 +308,8 @@ class ThumbnailDatabase {
bool NeedsMigrationToTopSites(); bool NeedsMigrationToTopSites();
// Renames the database file and drops the Thumbnails table. // Renames the database file and drops the Thumbnails table.
bool RenameAndDropThumbnails(const FilePath& old_db_file, bool RenameAndDropThumbnails(const base::FilePath& old_db_file,
const FilePath& new_db_file); const base::FilePath& new_db_file);
private: private:
friend class ExpireHistoryBackend; friend class ExpireHistoryBackend;

@@ -29,10 +29,10 @@
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
class FilePath;
class Profile; class Profile;
namespace base { namespace base {
class FilePath;
class RefCountedBytes; class RefCountedBytes;
class RefCountedMemory; class RefCountedMemory;
} }
@@ -57,7 +57,7 @@ class TopSites
explicit TopSites(Profile* profile); explicit TopSites(Profile* profile);
// Initializes TopSites. // Initializes TopSites.
void Init(const FilePath& db_name); void Init(const base::FilePath& db_name);
// Sets the given thumbnail for the given URL. Returns true if the thumbnail // Sets the given thumbnail for the given URL. Returns true if the thumbnail
// was updated. False means either the URL wasn't known to us, or we felt // was updated. False means either the URL wasn't known to us, or we felt

@@ -12,7 +12,10 @@
#include "chrome/browser/history/history_types.h" #include "chrome/browser/history/history_types.h"
class CancelableTaskTracker; class CancelableTaskTracker;
namespace base {
class FilePath; class FilePath;
}
namespace history { namespace history {
@@ -31,7 +34,7 @@ class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
TopSitesBackend(); TopSitesBackend();
void Init(const FilePath& path); void Init(const base::FilePath& path);
// Schedules the db to be shutdown. // Schedules the db to be shutdown.
void Shutdown(); void Shutdown();
@@ -64,7 +67,7 @@ class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
virtual ~TopSitesBackend(); virtual ~TopSitesBackend();
// Invokes Init on the db_. // Invokes Init on the db_.
void InitDBOnDBThread(const FilePath& path); void InitDBOnDBThread(const base::FilePath& path);
// Shuts down the db. // Shuts down the db.
void ShutdownDBOnDBThread(); void ShutdownDBOnDBThread();
@@ -83,9 +86,9 @@ class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
const Images& thumbnail); const Images& thumbnail);
// Resets the database. // Resets the database.
void ResetDatabaseOnDBThread(const FilePath& file_path); void ResetDatabaseOnDBThread(const base::FilePath& file_path);
FilePath db_path_; base::FilePath db_path_;
scoped_ptr<TopSitesDatabase> db_; scoped_ptr<TopSitesDatabase> db_;

@@ -13,7 +13,9 @@
#include "chrome/browser/history/url_database.h" // For DBCloseScoper. #include "chrome/browser/history/url_database.h" // For DBCloseScoper.
#include "sql/meta_table.h" #include "sql/meta_table.h"
namespace base {
class FilePath; class FilePath;
}
namespace sql { namespace sql {
class Connection; class Connection;
@@ -28,7 +30,7 @@ class TopSitesDatabase {
// Must be called after creation but before any other methods are called. // Must be called after creation but before any other methods are called.
// Returns true on success. If false, no other functions should be called. // Returns true on success. If false, no other functions should be called.
bool Init(const FilePath& db_name); bool Init(const base::FilePath& db_name);
// Returns true if migration of top sites from history may be needed. A value // Returns true if migration of top sites from history may be needed. A value
// of true means either migration is definitely needed (the top sites file is // of true means either migration is definitely needed (the top sites file is
@@ -92,7 +94,7 @@ class TopSitesDatabase {
// Returns the number of URLs (rows) in the database. // Returns the number of URLs (rows) in the database.
int GetRowCount(); int GetRowCount();
sql::Connection* CreateDB(const FilePath& db_name); sql::Connection* CreateDB(const base::FilePath& db_name);
// Encodes redirects into a string. // Encodes redirects into a string.
static std::string GetRedirects(const MostVisitedURL& url); static std::string GetRedirects(const MostVisitedURL& url);

@@ -51,7 +51,9 @@
#include "chrome/common/cancelable_task_tracker.h" #include "chrome/common/cancelable_task_tracker.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
namespace base {
class FilePath; class FilePath;
}
class IconManager : public IconLoader::Delegate { class IconManager : public IconLoader::Delegate {
public: public:
@@ -63,7 +65,7 @@ class IconManager : public IconLoader::Delegate {
// it via 'LoadIcon'. The returned bitmap is owned by the IconManager and must // it via 'LoadIcon'. The returned bitmap is owned by the IconManager and must
// not be free'd by the caller. If the caller needs to modify the icon, it // not be free'd by the caller. If the caller needs to modify the icon, it
// must make a copy and modify the copy. // must make a copy and modify the copy.
gfx::Image* LookupIcon(const FilePath& file_name, IconLoader::IconSize size); gfx::Image* LookupIcon(const base::FilePath& file_name, IconLoader::IconSize size);
typedef base::Callback<void(gfx::Image*)> IconRequestCallback; typedef base::Callback<void(gfx::Image*)> IconRequestCallback;
@@ -77,7 +79,7 @@ class IconManager : public IconLoader::Delegate {
// should never keep it or delete it. // should never keep it or delete it.
// 3. The gfx::Image pointer passed to the callback may be NULL if decoding // 3. The gfx::Image pointer passed to the callback may be NULL if decoding
// failed. // failed.
CancelableTaskTracker::TaskId LoadIcon(const FilePath& file_name, CancelableTaskTracker::TaskId LoadIcon(const base::FilePath& file_name,
IconLoader::IconSize size, IconLoader::IconSize size,
const IconRequestCallback& callback, const IconRequestCallback& callback,
CancelableTaskTracker* tracker); CancelableTaskTracker* tracker);
@@ -87,7 +89,7 @@ class IconManager : public IconLoader::Delegate {
// Get the identifying string for the given file. The implementation // Get the identifying string for the given file. The implementation
// is in icon_manager_[platform].cc. // is in icon_manager_[platform].cc.
static IconGroupID GetGroupIDFromFilepath(const FilePath& path); static IconGroupID GetGroupIDFromFilepath(const base::FilePath& path);
private: private:
struct CacheKey { struct CacheKey {

@@ -5,7 +5,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/icon_manager.h" #include "chrome/browser/icon_manager.h"
IconGroupID IconManager::GetGroupIDFromFilepath(const FilePath& filepath) { IconGroupID IconManager::GetGroupIDFromFilepath(const base::FilePath& filepath) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return 0; return 0;
} }

@@ -7,7 +7,8 @@
#include "base/nix/mime_util_xdg.h" #include "base/nix/mime_util_xdg.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
IconGroupID IconManager::GetGroupIDFromFilepath(const FilePath& filepath) { IconGroupID IconManager::GetGroupIDFromFilepath(
const base::FilePath& filepath) {
// It turns out the call to base::nix::GetFileMimeType below does IO, but // It turns out the call to base::nix::GetFileMimeType below does IO, but
// callers of GetGroupIDFromFilepath assume it does not do IO (the Windows // callers of GetGroupIDFromFilepath assume it does not do IO (the Windows
// and Mac implementations do not). We should fix this by either not doing IO // and Mac implementations do not). We should fix this by either not doing IO

Some files were not shown because too many files have changed in this diff Show More