summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-31 19:40:37 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-31 19:40:37 +0000
commit8ac1a75acadaa2aae065212cb6255d00c789a184 (patch)
tree854eaf66ba8ce7e581bd8e6f1fa75f46d22f4bb7 /net/url_request
parent287a019ed5d015185cab41f6c7156dc6c4cbcee7 (diff)
downloadchromium_src-8ac1a75acadaa2aae065212cb6255d00c789a184.zip
chromium_src-8ac1a75acadaa2aae065212cb6255d00c789a184.tar.gz
chromium_src-8ac1a75acadaa2aae065212cb6255d00c789a184.tar.bz2
Move more net classes into the net namespace. Also remove the net_util namespace in favor of the net namespace.
This is a purely mechanical change. There should be no logic changes. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/mime_sniffer_proxy.h2
-rw-r--r--net/url_request/url_request.h2
-rw-r--r--net/url_request/url_request_context.h10
-rw-r--r--net/url_request/url_request_file_dir_job.cc4
-rw-r--r--net/url_request/url_request_file_job.cc4
-rw-r--r--net/url_request/url_request_ftp_job.cc8
-rw-r--r--net/url_request/url_request_http_job.cc4
-rw-r--r--net/url_request/url_request_unittest.cc8
-rw-r--r--net/url_request/url_request_unittest.h2
9 files changed, 23 insertions, 21 deletions
diff --git a/net/url_request/mime_sniffer_proxy.h b/net/url_request/mime_sniffer_proxy.h
index af02dfd..9263863 100644
--- a/net/url_request/mime_sniffer_proxy.h
+++ b/net/url_request/mime_sniffer_proxy.h
@@ -68,7 +68,7 @@ class MimeSnifferProxy : public URLRequest::Delegate {
}
virtual void OnSSLCertificateError(URLRequest* request,
int cert_error,
- X509Certificate* cert) {
+ net::X509Certificate* cert) {
delegate_->OnSSLCertificateError(request, cert_error, cert);
}
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index 6740975..ed0eac1 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -144,7 +144,7 @@ class URLRequest {
// indicating what's wrong with the certificate.
virtual void OnSSLCertificateError(URLRequest* request,
int cert_error,
- X509Certificate* cert) {
+ net::X509Certificate* cert) {
request->Cancel();
}
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index 63b8f45..e23a6ba 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -44,7 +44,9 @@
#include "net/base/cookie_policy.h"
#include "net/http/http_transaction_factory.h"
+namespace net {
class CookieMonster;
+}
// Subclass to provide application-specific context for URLRequest instances.
class URLRequestContext :
@@ -62,10 +64,10 @@ class URLRequestContext :
}
// Gets the cookie store for this context.
- CookieMonster* cookie_store() { return cookie_store_; }
+ net::CookieMonster* cookie_store() { return cookie_store_; }
// Gets the cookie policy for this context.
- CookiePolicy* cookie_policy() { return &cookie_policy_; }
+ net::CookiePolicy* cookie_policy() { return &cookie_policy_; }
// Gets the FTP realm authentication cache for this context.
net::AuthCache* ftp_auth_cache() { return &ftp_auth_cache_; }
@@ -90,8 +92,8 @@ class URLRequestContext :
// The following members are expected to be initialized and owned by
// subclasses.
net::HttpTransactionFactory* http_transaction_factory_;
- CookieMonster* cookie_store_;
- CookiePolicy cookie_policy_;
+ net::CookieMonster* cookie_store_;
+ net::CookiePolicy cookie_policy_;
net::AuthCache ftp_auth_cache_;
std::string user_agent_;
bool is_off_the_record_;
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc
index 5845abf..a0fcf7a 100644
--- a/net/url_request/url_request_file_dir_job.cc
+++ b/net/url_request/url_request_file_dir_job.cc
@@ -131,11 +131,11 @@ void URLRequestFileDirJob::OnListFile(const WIN32_FIND_DATA& data) {
// We wait to write out the header until we get the first file, so that we
// can catch errors from DirectoryLister and show an error page.
if (!wrote_header_) {
- data_.append(net_util::GetDirectoryListingHeader(WideToUTF8(dir_path_)));
+ data_.append(net::GetDirectoryListingHeader(WideToUTF8(dir_path_)));
wrote_header_ = true;
}
- data_.append(net_util::GetDirectoryListingEntry(
+ data_.append(net::GetDirectoryListingEntry(
WideToUTF8(data.cFileName), data.dwFileAttributes, size, &local_time));
// TODO(darin): coalesce more?
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index e469047..a738b3a 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -75,7 +75,7 @@ DWORD WINAPI NetworkFileThread(LPVOID param) {
URLRequestJob* URLRequestFileJob::Factory(URLRequest* request,
const std::string& scheme) {
std::wstring file_path;
- if (net_util::FileURLToFilePath(request->url(), &file_path)) {
+ if (net::FileURLToFilePath(request->url(), &file_path)) {
if (file_path[file_path.size() - 1] == file_util::kPathSeparator) {
// Only directories have trailing slashes.
return new URLRequestFileDirJob(request, file_path);
@@ -343,7 +343,7 @@ bool URLRequestFileJob::IsRedirectResponse(GURL* location,
if (!resolved)
return false;
- *location = net_util::FilePathToFileURL(new_path);
+ *location = net::FilePathToFileURL(new_path);
*http_status_code = 301;
return true;
}
diff --git a/net/url_request/url_request_ftp_job.cc b/net/url_request/url_request_ftp_job.cc
index 7c9b5e8..23a726d 100644
--- a/net/url_request/url_request_ftp_job.cc
+++ b/net/url_request/url_request_ftp_job.cc
@@ -79,7 +79,7 @@ URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request,
DCHECK(scheme == "ftp");
if (request->url().has_port() &&
- !net_util::IsPortAllowedByFtp(request->url().IntPort()))
+ !net::IsPortAllowedByFtp(request->url().IntPort()))
return new URLRequestErrorJob(request, net::ERR_UNSAFE_PORT);
return new URLRequestFtpJob(request);
@@ -396,7 +396,7 @@ void URLRequestFtpJob::OnFindFile(DWORD last_error) {
// We don't know the encoding, and can't assume utf8, so pass the 8bit
// directly to the browser for it to decide.
- string file_entry = net_util::GetDirectoryListingEntry(
+ string file_entry = net::GetDirectoryListingEntry(
find_data_.cFileName, find_data_.dwFileAttributes, size,
&find_data_.ftLastWriteTime);
WriteData(&file_entry, true);
@@ -413,14 +413,14 @@ void URLRequestFtpJob::OnStartDirectoryTraversal() {
state_ = GETTING_DIRECTORY;
// Unescape the URL path and pass the raw 8bit directly to the browser.
- string html = net_util::GetDirectoryListingHeader(
+ string html = net::GetDirectoryListingHeader(
UnescapeURLComponent(request_->url().path(),
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS));
// If this isn't top level directory (i.e. the path isn't "/",) add a link to
// the parent directory.
if (request_->url().path().length() > 1)
- html.append(net_util::GetDirectoryListingEntry("..", 0, 0, NULL));
+ html.append(net::GetDirectoryListingEntry("..", 0, 0, NULL));
WriteData(&html, true);
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index b0d2b8c..9e89faa 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -49,7 +49,7 @@ URLRequestJob* URLRequestHttpJob::Factory(URLRequest* request,
const std::string& scheme) {
DCHECK(scheme == "http" || scheme == "https");
- if (!net_util::IsPortAllowedByDefault(request->url().IntPort()))
+ if (!net::IsPortAllowedByDefault(request->url().IntPort()))
return new URLRequestErrorJob(request, net::ERR_UNSAFE_PORT);
if (!request->context() ||
@@ -486,7 +486,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
request_->policy_url())) {
std::string cookies = request_->context()->cookie_store()->
GetCookiesWithOptions(request_->url(),
- CookieMonster::INCLUDE_HTTPONLY);
+ net::CookieMonster::INCLUDE_HTTPONLY);
if (!cookies.empty())
request_info_.extra_headers += "Cookie: " + cookies + "\r\n";
}
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 6f842bb..0ce504b 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -571,7 +571,7 @@ TEST(URLRequestTest, ResolveShortcutTest) {
TestDelegate d;
{
- TestURLRequest r(net_util::FilePathToFileURL(lnk_path), &d);
+ TestURLRequest r(net::FilePathToFileURL(lnk_path), &d);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -626,7 +626,7 @@ TEST(URLRequestTest, ContentTypeNormalizationTest) {
TEST(URLRequestTest, FileDirCancelTest) {
// Put in mock resource provider.
- NetModule::SetResourceProvider(TestNetResourceProvider);
+ net::NetModule::SetResourceProvider(TestNetResourceProvider);
TestDelegate d;
{
@@ -636,7 +636,7 @@ TEST(URLRequestTest, FileDirCancelTest) {
file_util::AppendToPath(&file_path, L"data");
file_util::AppendToPath(&file_path, L"");
- TestURLRequest req(net_util::FilePathToFileURL(file_path), &d);
+ TestURLRequest req(net::FilePathToFileURL(file_path), &d);
req.Start();
EXPECT_TRUE(req.is_pending());
@@ -649,7 +649,7 @@ TEST(URLRequestTest, FileDirCancelTest) {
#endif
// Take out mock resource provider.
- NetModule::SetResourceProvider(NULL);
+ net::NetModule::SetResourceProvider(NULL);
}
TEST(URLRequestTest, RestrictRedirects) {
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index 0ee0043..d8a8809 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -153,7 +153,7 @@ class TestDelegate : public URLRequest::Delegate {
virtual void OnSSLCertificateError(URLRequest* request,
int cert_error,
- X509Certificate* cert) {
+ net::X509Certificate* cert) {
// Ignore SSL errors, we test the server is started and shut it down by
// performing GETs, no security restrictions should apply as we always want
// these GETs to go through.