summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 16:40:10 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 16:40:10 +0000
commita9bb6f69b32018c245e05a79011114653fe8f5e0 (patch)
treec4fe6b5db0e508f860c82feb44245bf549d608ff /chrome
parentf23423a1245dffc2a368708fafd2867d2cf3e0f8 (diff)
downloadchromium_src-a9bb6f69b32018c245e05a79011114653fe8f5e0.zip
chromium_src-a9bb6f69b32018c245e05a79011114653fe8f5e0.tar.gz
chromium_src-a9bb6f69b32018c245e05a79011114653fe8f5e0.tar.bz2
Move some more classes from net/base into the net:: namespace.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/download_manager.cc19
-rw-r--r--chrome/browser/firefox2_importer.cc2
-rw-r--r--chrome/browser/firefox_importer_utils.cc4
-rw-r--r--chrome/browser/gears_integration.cc2
-rw-r--r--chrome/browser/login_prompt.cc10
-rw-r--r--chrome/browser/login_prompt.h5
-rw-r--r--chrome/browser/metrics_log.cc5
-rw-r--r--chrome/browser/plugin_process_host.cc7
-rw-r--r--chrome/browser/resource_dispatcher_host.cc13
-rw-r--r--chrome/browser/resource_dispatcher_host.h2
-rw-r--r--chrome/browser/resource_message_filter.cc6
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_util.cc4
-rw-r--r--chrome/browser/web_app.cc2
-rw-r--r--chrome/browser/web_contents.cc4
-rw-r--r--chrome/renderer/renderer_glue.cc6
16 files changed, 48 insertions, 45 deletions
diff --git a/chrome/browser/download_manager.cc b/chrome/browser/download_manager.cc
index 06759c9..17851ac 100644
--- a/chrome/browser/download_manager.cc
+++ b/chrome/browser/download_manager.cc
@@ -866,7 +866,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
extension.assign(default_extension);
std::string mime_type_from_extension;
- mime_util::GetMimeTypeFromFile(file_name, &mime_type_from_extension);
+ net::GetMimeTypeFromFile(file_name, &mime_type_from_extension);
if (mime_type == mime_type_from_extension) {
// The hinted extension matches the mime type. It looks like a winner.
generated_extension->swap(extension);
@@ -877,7 +877,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
// We want to be careful about executable extensions. The worry here is
// that a trusted web site could be tricked into dropping an executable file
// on the user's filesystem.
- if (!mime_util::GetPreferredExtensionForMimeType(mime_type, &extension)) {
+ if (!net::GetPreferredExtensionForMimeType(mime_type, &extension)) {
// We couldn't find a good extension for this content type. Use a dummy
// extension instead.
extension.assign(default_extension);
@@ -885,7 +885,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
}
if (extension.empty()) {
- mime_util::GetPreferredExtensionForMimeType(mime_type, &extension);
+ net::GetPreferredExtensionForMimeType(mime_type, &extension);
} else {
// Append entension generated from the mime type if:
// 1. New extension is not ".txt"
@@ -895,8 +895,7 @@ void DownloadManager::GenerateExtension(const std::wstring& file_name,
// E.g. my-cat.jpg becomes my-cat.jpg.js if content type is
// application/x-javascript.
std::wstring append_extension;
- if (mime_util::GetPreferredExtensionForMimeType(mime_type,
- &append_extension)) {
+ if (net::GetPreferredExtensionForMimeType(mime_type, &append_extension)) {
if (append_extension != L".txt" && append_extension != extension &&
!IsExecutable(append_extension))
extension += append_extension;
@@ -973,19 +972,19 @@ bool DownloadManager::ShouldOpenFileExtension(const std::wstring& extension) {
// static
bool DownloadManager::IsExecutableMimeType(const std::string& mime_type) {
// JavaScript is just as powerful as EXE.
- if (mime_util::MatchesMimeType("text/javascript", mime_type))
+ if (net::MatchesMimeType("text/javascript", mime_type))
return true;
- if (mime_util::MatchesMimeType("text/javascript;version=*", mime_type))
+ if (net::MatchesMimeType("text/javascript;version=*", mime_type))
return true;
// We don't consider other non-application types to be executable.
- if (!mime_util::MatchesMimeType("application/*", mime_type))
+ if (!net::MatchesMimeType("application/*", mime_type))
return false;
// These application types are not executable.
- if (mime_util::MatchesMimeType("application/*+xml", mime_type))
+ if (net::MatchesMimeType("application/*+xml", mime_type))
return false;
- if (mime_util::MatchesMimeType("application/xml", mime_type))
+ if (net::MatchesMimeType("application/xml", mime_type))
return false;
return true;
diff --git a/chrome/browser/firefox2_importer.cc b/chrome/browser/firefox2_importer.cc
index a04f380..36b3555 100644
--- a/chrome/browser/firefox2_importer.cc
+++ b/chrome/browser/firefox2_importer.cc
@@ -519,7 +519,7 @@ void Firefox2Importer::DataURLToFaviconUsage(
// Parse the data URL.
std::string mime_type, char_set, data;
- if (!DataURL::Parse(favicon_data, &mime_type, &char_set, &data) ||
+ if (!net::DataURL::Parse(favicon_data, &mime_type, &char_set, &data) ||
data.empty())
return;
diff --git a/chrome/browser/firefox_importer_utils.cc b/chrome/browser/firefox_importer_utils.cc
index 35425da..96b6d8c 100644
--- a/chrome/browser/firefox_importer_utils.cc
+++ b/chrome/browser/firefox_importer_utils.cc
@@ -592,7 +592,7 @@ std::wstring NSSDecryptor::Decrypt(const std::string& crypt) const {
// by a leading '~'. Otherwise, we should decrypt the text.
if (crypt[0] != '~') {
std::string decoded_data;
- Base64Decode(crypt, &decoded_data);
+ net::Base64Decode(crypt, &decoded_data);
PK11SlotInfo* slot = NULL;
slot = PK11_GetInternalKeySlot();
SECStatus result = PK11_Authenticate(slot, PR_TRUE, NULL);
@@ -616,7 +616,7 @@ std::wstring NSSDecryptor::Decrypt(const std::string& crypt) const {
PK11_FreeSlot(slot);
} else {
// Deletes the leading '~' before decoding.
- Base64Decode(crypt.substr(1), &plain);
+ net::Base64Decode(crypt.substr(1), &plain);
}
return UTF8ToWide(plain);
diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc
index d236272..e13a7a3 100644
--- a/chrome/browser/gears_integration.cc
+++ b/chrome/browser/gears_integration.cc
@@ -154,7 +154,7 @@ static GURL ConvertSkBitmapToDataURL(const SkBitmap& icon) {
std::string icon_data_str(reinterpret_cast<char*>(&icon_data[0]),
icon_data.size());
std::string icon_base64_encoded;
- Base64Encode(icon_data_str, &icon_base64_encoded);
+ net::Base64Encode(icon_data_str, &icon_base64_encoded);
GURL icon_url("data:image/png;base64," + icon_base64_encoded);
return icon_url;
diff --git a/chrome/browser/login_prompt.cc b/chrome/browser/login_prompt.cc
index ec10fb9..650c1cf 100644
--- a/chrome/browser/login_prompt.cc
+++ b/chrome/browser/login_prompt.cc
@@ -323,7 +323,7 @@ class LoginHandlerImpl : public LoginHandler,
// which then routes it to the URLRequest on the I/O thread.
class LoginDialogTask : public Task {
public:
- LoginDialogTask(AuthChallengeInfo* auth_info, LoginHandlerImpl* handler)
+ LoginDialogTask(net::AuthChallengeInfo* auth_info, LoginHandlerImpl* handler)
: auth_info_(auth_info), handler_(handler) {
}
virtual ~LoginDialogTask() {
@@ -380,15 +380,15 @@ class LoginDialogTask : public Task {
// TODO(timsteele): Shouldn't depend on HttpKey since a change to the
// format would result in not being able to retrieve existing logins
// for a site. Refactor HttpKey behavior to be more reusable.
- dialog_form.signon_realm = AuthCache::HttpKey(dialog_form.origin,
- *auth_info_);
+ dialog_form.signon_realm =
+ net::AuthCache::HttpKey(dialog_form.origin, *auth_info_);
password_manager_input->push_back(dialog_form);
// Set the password form for the handler (by copy).
handler_->set_password_form(dialog_form);
}
// Info about who/where/what is asking for authentication.
- scoped_refptr<AuthChallengeInfo> auth_info_;
+ scoped_refptr<net::AuthChallengeInfo> auth_info_;
// Where to send the authentication when obtained.
// This is owned by the ResourceDispatcherHost that invoked us.
@@ -400,7 +400,7 @@ class LoginDialogTask : public Task {
// ----------------------------------------------------------------------------
// Public API
-LoginHandler* CreateLoginPrompt(AuthChallengeInfo* auth_info,
+LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info,
URLRequest* request,
MessageLoop* ui_loop) {
LoginHandlerImpl* handler = new LoginHandlerImpl(request, ui_loop);
diff --git a/chrome/browser/login_prompt.h b/chrome/browser/login_prompt.h
index 3c4d5f6..eacd165 100644
--- a/chrome/browser/login_prompt.h
+++ b/chrome/browser/login_prompt.h
@@ -34,7 +34,10 @@
#include "base/basictypes.h"
+namespace net {
class AuthChallengeInfo;
+}
+
class URLRequest;
class MessageLoop;
class TabContents;
@@ -83,7 +86,7 @@ private:
// which can be used to set or cancel authentication programmatically. The
// caller must invoke OnRequestCancelled() on this LoginHandler before
// destroying the URLRequest.
-LoginHandler* CreateLoginPrompt(AuthChallengeInfo* auth_info,
+LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info,
URLRequest* request,
MessageLoop* ui_loop);
diff --git a/chrome/browser/metrics_log.cc b/chrome/browser/metrics_log.cc
index 06daa76..a563ed5 100644
--- a/chrome/browser/metrics_log.cc
+++ b/chrome/browser/metrics_log.cc
@@ -136,12 +136,11 @@ std::string MetricsLog::CreateHash(const std::string& value) {
std::string MetricsLog::CreateBase64Hash(const std::string& string) {
std::string encoded_digest;
- if (Base64Encode(CreateHash(string), &encoded_digest)) {
+ if (net::Base64Encode(CreateHash(string), &encoded_digest)) {
DLOG(INFO) << "Metrics: Hash [" << encoded_digest << "]=[" << string << "]";
return encoded_digest;
- } else {
- return std::string();
}
+ return std::string();
}
void MetricsLog::RecordUserAction(const wchar_t* key) {
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 328d1dc..2240c6f 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -130,7 +130,7 @@ class PluginDownloadUrlHelper : public URLRequest::Delegate {
virtual void OnReceivedRedirect(URLRequest* request,
const GURL& new_url);
virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info);
+ net::AuthChallengeInfo* auth_info);
virtual void OnSSLCertificateError(URLRequest* request,
int cert_error,
X509Certificate* cert);
@@ -195,8 +195,9 @@ void PluginDownloadUrlHelper::OnReceivedRedirect(URLRequest* request,
const GURL& new_url) {
}
-void PluginDownloadUrlHelper::OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) {
+void PluginDownloadUrlHelper::OnAuthRequired(
+ URLRequest* request,
+ net::AuthChallengeInfo* auth_info) {
URLRequest::Delegate::OnAuthRequired(request, auth_info);
DownloadCompletedHelper(false);
}
diff --git a/chrome/browser/resource_dispatcher_host.cc b/chrome/browser/resource_dispatcher_host.cc
index 3104151..87f504f 100644
--- a/chrome/browser/resource_dispatcher_host.cc
+++ b/chrome/browser/resource_dispatcher_host.cc
@@ -974,7 +974,7 @@ bool ResourceDispatcherHost::BufferedEventHandler::DelayResponse() {
std::string mime_type;
request_->GetMimeType(&mime_type);
- if (mime_util::ShouldSniffMimeType(request_->url(), mime_type)) {
+ if (net::ShouldSniffMimeType(request_->url(), mime_type)) {
// We're going to look at the data before deciding what the content type
// is. That means we need to delay sending the ResponseStarted message
// over the IPC channel.
@@ -1019,8 +1019,8 @@ bool ResourceDispatcherHost::BufferedEventHandler::KeepBuffering(
std::string type_hint, new_type;
request_->GetMimeType(&type_hint);
- if (!mime_util::SniffMimeType(read_buffer_, bytes_read_, request_->url(),
- type_hint, &new_type)) {
+ if (!net::SniffMimeType(read_buffer_, bytes_read_, request_->url(),
+ type_hint, &new_type)) {
// SniffMimeType() returns false if there is not enough data to determine
// the mime type. However, even if it returns false, it returns a new type
// that is probably better than the current one.
@@ -1804,8 +1804,9 @@ void ResourceDispatcherHost::OnReceivedRedirect(URLRequest* request,
CancelRequest(info->render_process_host_id, info->request_id, false);
}
-void ResourceDispatcherHost::OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info) {
+void ResourceDispatcherHost::OnAuthRequired(
+ URLRequest* request,
+ net::AuthChallengeInfo* auth_info) {
// Create a login dialog on the UI thread to get authentication data,
// or pull from cache and continue on the IO thread.
// TODO(mpcomplete): We should block the parent tab while waiting for
@@ -1961,7 +1962,7 @@ bool ResourceDispatcherHost::ShouldDownload(
}
// MIME type checking.
- if (mime_util::IsSupportedMimeType(type))
+ if (net::IsSupportedMimeType(type))
return false;
// Finally, check the plugin service.
diff --git a/chrome/browser/resource_dispatcher_host.h b/chrome/browser/resource_dispatcher_host.h
index 52c876b..9614e08 100644
--- a/chrome/browser/resource_dispatcher_host.h
+++ b/chrome/browser/resource_dispatcher_host.h
@@ -347,7 +347,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
virtual void OnReceivedRedirect(URLRequest* request,
const GURL& new_url);
virtual void OnAuthRequired(URLRequest* request,
- AuthChallengeInfo* auth_info);
+ net::AuthChallengeInfo* auth_info);
virtual void OnSSLCertificateError(URLRequest* request,
int cert_error,
X509Certificate* cert);
diff --git a/chrome/browser/resource_message_filter.cc b/chrome/browser/resource_message_filter.cc
index a1f7a2f..20007dc 100644
--- a/chrome/browser/resource_message_filter.cc
+++ b/chrome/browser/resource_message_filter.cc
@@ -449,17 +449,17 @@ void ResourceMessageFilter::OnGetWindowRect(HWND window, gfx::Rect *rect) {
void ResourceMessageFilter::OnGetMimeTypeFromExtension(
const std::wstring& ext, std::string* mime_type) {
- mime_util::GetMimeTypeFromExtension(ext, mime_type);
+ net::GetMimeTypeFromExtension(ext, mime_type);
}
void ResourceMessageFilter::OnGetMimeTypeFromFile(
const std::wstring& file_path, std::string* mime_type) {
- mime_util::GetMimeTypeFromFile(file_path, mime_type);
+ net::GetMimeTypeFromFile(file_path, mime_type);
}
void ResourceMessageFilter::OnGetPreferredExtensionForMimeType(
const std::string& mime_type, std::wstring* ext) {
- mime_util::GetPreferredExtensionForMimeType(mime_type, ext);
+ net::GetPreferredExtensionForMimeType(mime_type, ext);
}
void ResourceMessageFilter::OnGetCPBrowsingContext(uint32* context) {
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 086ceb9..9307cd3 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -364,7 +364,7 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url,
std::string data_str;
data_str.assign(data, length);
std::string encoded_chunk;
- Base64Encode(data, &encoded_chunk);
+ net::Base64Encode(data, &encoded_chunk);
SB_DLOG(INFO) << "ParseChunk error for chunk: " << chunk_url.url
<< ", client_key: " << client_key_
<< ", wrapped_key: " << wrapped_key_
diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc
index 802d5ff..304a637 100644
--- a/chrome/browser/safe_browsing/safe_browsing_util.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_util.cc
@@ -165,12 +165,12 @@ bool VerifyMAC(const std::string& key, const std::string& mac,
std::string key_copy = key;
DecodeWebSafe(&key_copy);
std::string decoded_key;
- Base64Decode(key_copy, &decoded_key);
+ net::Base64Decode(key_copy, &decoded_key);
std::string mac_copy = mac;
DecodeWebSafe(&mac_copy);
std::string decoded_mac;
- Base64Decode(mac_copy, &decoded_mac);
+ net::Base64Decode(mac_copy, &decoded_mac);
HMAC hmac(HMAC::SHA1,
reinterpret_cast<const unsigned char*>(decoded_key.data()),
diff --git a/chrome/browser/web_app.cc b/chrome/browser/web_app.cc
index 4c4620f..1760263 100644
--- a/chrome/browser/web_app.cc
+++ b/chrome/browser/web_app.cc
@@ -58,7 +58,7 @@ static std::set<GURL> ExtractImageURLs(const GearsShortcutData& data) {
static SkBitmap DecodePNGEncodedURL(const GURL& url) {
std::string mime_type, charset, data;
if (!url.SchemeIs("data") ||
- !DataURL::Parse(url, &mime_type, &charset, &data) ||
+ !net::DataURL::Parse(url, &mime_type, &charset, &data) ||
mime_type != kPNGImageMimeType) {
return SkBitmap();
}
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc
index 8ee43e3..5a330e7 100644
--- a/chrome/browser/web_contents.cc
+++ b/chrome/browser/web_contents.cc
@@ -2975,8 +2975,8 @@ HWND WebContents::GetContentHWND() {
bool WebContents::CanDisplayFile(const std::wstring& full_path) {
bool allow_wildcard = false;
std::string mime_type;
- mime_util::GetMimeTypeFromFile(full_path, &mime_type);
- if (mime_util::IsSupportedMimeType(mime_type) ||
+ net::GetMimeTypeFromFile(full_path, &mime_type);
+ if (net::IsSupportedMimeType(mime_type) ||
(PluginService::GetInstance() &&
PluginService::GetInstance()->HavePluginFor(mime_type, allow_wildcard)))
return true;
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index cfe1d9c..5d9c9d4 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -162,7 +162,7 @@ void webkit_glue::AppendToLog(const char* file, int line, const char* msg) {
bool webkit_glue::GetMimeTypeFromExtension(std::wstring &ext,
std::string *mime_type) {
if (IsPluginProcess())
- return mime_util::GetMimeTypeFromExtension(ext, mime_type);
+ return net::GetMimeTypeFromExtension(ext, mime_type);
// The sandbox restricts our access to the registry, so we need to proxy
// these calls over to the browser process.
@@ -175,7 +175,7 @@ bool webkit_glue::GetMimeTypeFromExtension(std::wstring &ext,
bool webkit_glue::GetMimeTypeFromFile(const std::wstring &file_path,
std::string *mime_type) {
if (IsPluginProcess())
- return mime_util::GetMimeTypeFromFile(file_path, mime_type);
+ return net::GetMimeTypeFromFile(file_path, mime_type);
// The sandbox restricts our access to the registry, so we need to proxy
// these calls over to the browser process.
@@ -188,7 +188,7 @@ bool webkit_glue::GetMimeTypeFromFile(const std::wstring &file_path,
bool webkit_glue::GetPreferredExtensionForMimeType(const std::string& mime_type,
std::wstring* ext) {
if (IsPluginProcess())
- return mime_util::GetPreferredExtensionForMimeType(mime_type, ext);
+ return net::GetPreferredExtensionForMimeType(mime_type, ext);
// The sandbox restricts our access to the registry, so we need to proxy
// these calls over to the browser process.