summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
commita3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e (patch)
treebdd4dac76e6034ef6cf33450e203269a715ea0e6 /net
parent8bc574c57115e9ffd0169f33131c0865997dcb35 (diff)
downloadchromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.zip
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.gz
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.bz2
Add FilePath to base namespace.
This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes. Review URL: https://codereview.chromium.org/12163003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/cert_test_util.h6
-rw-r--r--net/base/file_stream.h6
-rw-r--r--net/base/file_stream_context.h10
-rw-r--r--net/base/net_util.h21
-rw-r--r--net/base/network_delegate.cc2
-rw-r--r--net/base/network_delegate.h9
-rw-r--r--net/base/test_root_certs.h4
-rw-r--r--net/base/upload_data.h5
-rw-r--r--net/disk_cache/cache_util.h11
-rw-r--r--net/disk_cache/disk_cache.h6
-rw-r--r--net/disk_cache/file.h2
-rw-r--r--net/disk_cache/mapped_file.h4
-rw-r--r--net/http/infinite_cache.h5
-rw-r--r--net/test/python_utils.h7
-rw-r--r--net/url_request/url_fetcher.h6
-rw-r--r--net/url_request/url_request.h1
-rw-r--r--net/url_request/url_request_context_builder.h2
17 files changed, 63 insertions, 44 deletions
diff --git a/net/base/cert_test_util.h b/net/base/cert_test_util.h
index 9f23b7d..db49e87 100644
--- a/net/base/cert_test_util.h
+++ b/net/base/cert_test_util.h
@@ -11,13 +11,15 @@
#include "net/base/x509_cert_types.h"
#include "net/base/x509_certificate.h"
+namespace base {
class FilePath;
+}
namespace net {
class EVRootCAMetadata;
-CertificateList CreateCertificateListFromFile(const FilePath& certs_dir,
+CertificateList CreateCertificateListFromFile(const base::FilePath& certs_dir,
const std::string& cert_file,
int format);
@@ -26,7 +28,7 @@ CertificateList CreateCertificateListFromFile(const FilePath& certs_dir,
// |certs_dir| represents the test certificates directory. |cert_file| is the
// name of the certificate file. If cert_file contains multiple certificates,
// the first certificate found will be returned.
-scoped_refptr<X509Certificate> ImportCertFromFile(const FilePath& certs_dir,
+scoped_refptr<X509Certificate> ImportCertFromFile(const base::FilePath& certs_dir,
const std::string& cert_file);
// ScopedTestEVPolicy causes certificates marked with |policy|, issued from a
diff --git a/net/base/file_stream.h b/net/base/file_stream.h
index 5c64792..763a03c 100644
--- a/net/base/file_stream.h
+++ b/net/base/file_stream.h
@@ -16,7 +16,9 @@
#include "net/base/net_export.h"
#include "net/base/net_log.h"
+namespace base {
class FilePath;
+}
namespace net {
@@ -54,7 +56,7 @@ class NET_EXPORT FileStream {
// automatically closed when FileStream is destructed in an asynchronous
// manner (i.e. the file stream is closed in the background but you don't
// know when).
- virtual int Open(const FilePath& path, int open_flags,
+ virtual int Open(const base::FilePath& path, int open_flags,
const CompletionCallback& callback);
// Call this method to open the FileStream synchronously.
@@ -64,7 +66,7 @@ class NET_EXPORT FileStream {
//
// If the file stream is not closed manually, the underlying file will be
// automatically closed when FileStream is destructed.
- virtual int OpenSync(const FilePath& path, int open_flags);
+ virtual int OpenSync(const base::FilePath& path, int open_flags);
// Returns true if Open succeeded and Close has not been called.
virtual bool IsOpen() const;
diff --git a/net/base/file_stream_context.h b/net/base/file_stream_context.h
index 244c25f..42fc0eb 100644
--- a/net/base/file_stream_context.h
+++ b/net/base/file_stream_context.h
@@ -39,7 +39,9 @@
#include <errno.h>
#endif
+namespace base {
class FilePath;
+}
namespace net {
@@ -97,10 +99,10 @@ class FileStream::Context {
// not closed yet.
void Orphan();
- void OpenAsync(const FilePath& path,
+ void OpenAsync(const base::FilePath& path,
int open_flags,
const CompletionCallback& callback);
- int OpenSync(const FilePath& path, int open_flags);
+ int OpenSync(const base::FilePath& path, int open_flags);
void CloseSync();
@@ -137,9 +139,9 @@ class FileStream::Context {
// Map system error into network error code and log it with |bound_net_log_|.
int RecordAndMapError(int error, FileErrorSource source) const;
- void BeginOpenEvent(const FilePath& path);
+ void BeginOpenEvent(const base::FilePath& path);
- OpenResult OpenFileImpl(const FilePath& path, int open_flags);
+ OpenResult OpenFileImpl(const base::FilePath& path, int open_flags);
int ProcessOpenError(int error_code);
void OnOpenCompleted(const CompletionCallback& callback, OpenResult result);
diff --git a/net/base/net_util.h b/net/base/net_util.h
index 874f3e2..f21c1ed 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -26,10 +26,10 @@
#include "net/base/net_export.h"
#include "net/base/net_log.h"
-class FilePath;
class GURL;
namespace base {
+class FilePath;
class Time;
}
@@ -79,13 +79,13 @@ NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts();
// Given the full path to a file name, creates a file: URL. The returned URL
// may not be valid if the input is malformed.
-NET_EXPORT GURL FilePathToFileURL(const FilePath& path);
+NET_EXPORT GURL FilePathToFileURL(const base::FilePath& path);
// Converts a file: URL back to a filename that can be passed to the OS. The
// file URL must be well-formed (GURL::is_valid() must return true); we don't
// handle degenerate cases here. Returns true on success, false if it isn't a
// valid file URL. On failure, *file_path will be empty.
-NET_EXPORT bool FileURLToFilePath(const GURL& url, FilePath* file_path);
+NET_EXPORT bool FileURLToFilePath(const GURL& url, base::FilePath* file_path);
// Splits an input of the form <host>[":"<port>] into its consitituent parts.
// Saves the result into |*host| and |*port|. If the input did not have
@@ -278,12 +278,13 @@ NET_EXPORT string16 GetSuggestedFilename(const GURL& url,
const std::string& default_name);
// Similar to GetSuggestedFilename(), but returns a FilePath.
-NET_EXPORT FilePath GenerateFileName(const GURL& url,
- const std::string& content_disposition,
- const std::string& referrer_charset,
- const std::string& suggested_name,
- const std::string& mime_type,
- const std::string& default_name);
+NET_EXPORT base::FilePath GenerateFileName(
+ const GURL& url,
+ const std::string& content_disposition,
+ const std::string& referrer_charset,
+ const std::string& suggested_name,
+ const std::string& mime_type,
+ const std::string& default_name);
// Ensures that the filename and extension is safe to use in the filesystem.
//
@@ -304,7 +305,7 @@ NET_EXPORT FilePath GenerateFileName(const GURL& url,
// thread that allows IO.
NET_EXPORT void GenerateSafeFileName(const std::string& mime_type,
bool ignore_extension,
- FilePath* file_path);
+ base::FilePath* file_path);
// Checks |port| against a list of ports which are restricted by default.
// Returns true if |port| is allowed, false if it is restricted.
diff --git a/net/base/network_delegate.cc b/net/base/network_delegate.cc
index 539d987..59953a8 100644
--- a/net/base/network_delegate.cc
+++ b/net/base/network_delegate.cc
@@ -108,7 +108,7 @@ bool NetworkDelegate::CanGetCookies(const URLRequest& request,
}
bool NetworkDelegate::CanAccessFile(const URLRequest& request,
- const FilePath& path) const {
+ const base::FilePath& path) const {
DCHECK(CalledOnValidThread());
return OnCanAccessFile(request, path);
}
diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h
index 5475754..f219854 100644
--- a/net/base/network_delegate.h
+++ b/net/base/network_delegate.h
@@ -14,9 +14,12 @@
#include "net/base/completion_callback.h"
#include "net/cookies/canonical_cookie.h"
-class FilePath;
class GURL;
+namespace base {
+class FilePath;
+}
+
namespace net {
// NOTE: Layering violations!
@@ -92,7 +95,7 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
const std::string& cookie_line,
CookieOptions* options);
bool CanAccessFile(const URLRequest& request,
- const FilePath& path) const;
+ const base::FilePath& path) const;
bool CanThrottleRequest(const URLRequest& request) const;
int NotifyBeforeSocketStreamConnect(SocketStream* socket,
@@ -215,7 +218,7 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
// allow or block access to the given file path. Returns true if access is
// allowed.
virtual bool OnCanAccessFile(const URLRequest& request,
- const FilePath& path) const = 0;
+ const base::FilePath& path) const = 0;
// Returns true if the given request may be rejected when the
// URLRequestThrottlerManager believes the server servicing the
diff --git a/net/base/test_root_certs.h b/net/base/test_root_certs.h
index 4d52dbc..a7c7cde 100644
--- a/net/base/test_root_certs.h
+++ b/net/base/test_root_certs.h
@@ -21,7 +21,9 @@
#include "base/mac/scoped_cftyperef.h"
#endif
+namespace base {
class FilePath;
+}
namespace net {
@@ -45,7 +47,7 @@ class NET_EXPORT_PRIVATE TestRootCerts {
// Reads a single certificate from |file| and marks it as trusted. Returns
// false if an error is encountered, such as being unable to read |file|
// or more than one certificate existing in |file|.
- bool AddFromFile(const FilePath& file);
+ bool AddFromFile(const base::FilePath& file);
// Clears the trusted status of any certificates that were previously
// marked trusted via Add().
diff --git a/net/base/upload_data.h b/net/base/upload_data.h
index 4e6c6ca..b782ab4 100644
--- a/net/base/upload_data.h
+++ b/net/base/upload_data.h
@@ -12,9 +12,8 @@
#include "net/base/net_export.h"
#include "net/base/upload_element.h"
-class FilePath;
-
namespace base {
+class FilePath;
class Time;
} // namespace base
@@ -35,7 +34,7 @@ class NET_EXPORT UploadData
void AppendBytes(const char* bytes, int bytes_len);
- void AppendFileRange(const FilePath& file_path,
+ void AppendFileRange(const base::FilePath& file_path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time);
diff --git a/net/disk_cache/cache_util.h b/net/disk_cache/cache_util.h
index 6987dc3..0b3ee6e 100644
--- a/net/disk_cache/cache_util.h
+++ b/net/disk_cache/cache_util.h
@@ -8,7 +8,9 @@
#include "base/basictypes.h"
#include "net/base/net_export.h"
+namespace base {
class FilePath;
+}
namespace disk_cache {
@@ -18,15 +20,16 @@ namespace disk_cache {
// for the cache directory. Returns true if successful. On ChromeOS,
// this moves the cache contents, and leaves the empty cache
// directory.
-NET_EXPORT_PRIVATE bool MoveCache(const FilePath& from_path,
- const FilePath& to_path);
+NET_EXPORT_PRIVATE bool MoveCache(const base::FilePath& from_path,
+ const base::FilePath& to_path);
// Deletes the cache files stored on |path|, and optionally also attempts to
// delete the folder itself.
-NET_EXPORT_PRIVATE void DeleteCache(const FilePath& path, bool remove_folder);
+NET_EXPORT_PRIVATE void DeleteCache(const base::FilePath& path,
+ bool remove_folder);
// Deletes a cache file.
-NET_EXPORT_PRIVATE bool DeleteCacheFile(const FilePath& name);
+NET_EXPORT_PRIVATE bool DeleteCacheFile(const base::FilePath& name);
} // namespace disk_cache
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index d2e01a0..e27d24c 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -17,9 +17,8 @@
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
-class FilePath;
-
namespace base {
+class FilePath;
class MessageLoopProxy;
}
@@ -48,7 +47,8 @@ class Backend;
// be invoked when a backend is available or a fatal error condition is reached.
// The pointer to receive the |backend| must remain valid until the operation
// completes (the callback is notified).
-NET_EXPORT int CreateCacheBackend(net::CacheType type, const FilePath& path,
+NET_EXPORT int CreateCacheBackend(net::CacheType type,
+ const base::FilePath& path,
int max_bytes, bool force,
base::MessageLoopProxy* thread,
net::NetLog* net_log, Backend** backend,
diff --git a/net/disk_cache/file.h b/net/disk_cache/file.h
index 0124090..3f17ea0 100644
--- a/net/disk_cache/file.h
+++ b/net/disk_cache/file.h
@@ -11,7 +11,9 @@
#include "base/platform_file.h"
#include "net/base/net_export.h"
+namespace base {
class FilePath;
+}
namespace disk_cache {
diff --git a/net/disk_cache/mapped_file.h b/net/disk_cache/mapped_file.h
index c5960d0..6190997 100644
--- a/net/disk_cache/mapped_file.h
+++ b/net/disk_cache/mapped_file.h
@@ -12,7 +12,9 @@
#include "net/disk_cache/file.h"
#include "net/disk_cache/file_block.h"
+namespace base {
class FilePath;
+}
namespace disk_cache {
@@ -27,7 +29,7 @@ class NET_EXPORT_PRIVATE MappedFile : public File {
// Performs object initialization. name is the file to use, and size is the
// amount of data to memory map from the file. If size is 0, the whole file
// will be mapped in memory.
- void* Init(const FilePath& name, size_t size);
+ void* Init(const base::FilePath& name, size_t size);
void* buffer() const {
return buffer_;
diff --git a/net/http/infinite_cache.h b/net/http/infinite_cache.h
index 30d9025..a93d4c1 100644
--- a/net/http/infinite_cache.h
+++ b/net/http/infinite_cache.h
@@ -18,9 +18,8 @@
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
-class FilePath;
-
namespace base {
+class FilePath;
class SequencedTaskRunner;
class SequencedWorkerPool;
}
@@ -80,7 +79,7 @@ class NET_EXPORT_PRIVATE InfiniteCache
// Initializes this object to start tracking requests. |path| is the location
// of the file to use to store data; it can be empty, in which case the data
// will not be persisted to disk.
- void Init(const FilePath& path);
+ void Init(const base::FilePath& path);
InfiniteCacheTransaction* CreateInfiniteCacheTransaction();
diff --git a/net/test/python_utils.h b/net/test/python_utils.h
index c7cf289..3077645 100644
--- a/net/test/python_utils.h
+++ b/net/test/python_utils.h
@@ -8,16 +8,19 @@
#include "base/compiler_specific.h"
class CommandLine;
+
+namespace base {
class FilePath;
+}
// This is the python path variable name.
extern const char kPythonPathEnv[];
// Appends the dir to python path environment variable.
-void AppendToPythonPath(const FilePath& dir);
+void AppendToPythonPath(const base::FilePath& dir);
// Return the location of the compiler-generated python protobuf.
-bool GetPyProtoPath(FilePath* dir);
+bool GetPyProtoPath(base::FilePath* dir);
// Returns the command that should be used to launch Python.
bool GetPythonCommand(CommandLine* python_cmd) WARN_UNUSED_RESULT;
diff --git a/net/url_request/url_fetcher.h b/net/url_request/url_fetcher.h
index 815dac0..fdd4367 100644
--- a/net/url_request/url_fetcher.h
+++ b/net/url_request/url_fetcher.h
@@ -16,10 +16,10 @@
#include "base/task_runner.h"
#include "net/base/net_export.h"
-class FilePath;
class GURL;
namespace base {
+class FilePath;
class MessageLoopProxy;
class TimeDelta;
}
@@ -220,7 +220,7 @@ class NET_EXPORT URLFetcher {
// The created file is removed when the URLFetcher is deleted unless you
// take ownership by calling GetResponseAsFilePath().
virtual void SaveResponseToFileAtPath(
- const FilePath& file_path,
+ const base::FilePath& file_path,
scoped_refptr<base::TaskRunner> file_task_runner) = 0;
// By default, the response is saved in a string. Call this method to save the
@@ -284,7 +284,7 @@ class NET_EXPORT URLFetcher {
// be removed once the URLFetcher is destroyed. User should not take
// ownership more than once, or call this method after taking ownership.
virtual bool GetResponseAsFilePath(bool take_ownership,
- FilePath* out_response_path) const = 0;
+ base::FilePath* out_response_path) const = 0;
};
} // namespace net
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index a0ed0b2..3c1c2d52 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -30,7 +30,6 @@
#include "net/http/http_response_info.h"
#include "net/url_request/url_request_status.h"
-class FilePath;
// Temporary layering violation to allow existing users of a deprecated
// interface.
class ChildProcessSecurityPolicyTest;
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h
index fd21f8a6..f1ce570 100644
--- a/net/url_request/url_request_context_builder.h
+++ b/net/url_request/url_request_context_builder.h
@@ -49,7 +49,7 @@ class NET_EXPORT URLRequestContextBuilder {
int max_size;
// The cache path (when type is DISK).
- FilePath path;
+ base::FilePath path;
};
struct NET_EXPORT HttpNetworkSessionParams {