diff options
Diffstat (limited to 'chrome/browser')
4 files changed, 16 insertions, 11 deletions
diff --git a/chrome/browser/debugger/debugger_contents.cc b/chrome/browser/debugger/debugger_contents.cc index 1c426f8..2756244 100644 --- a/chrome/browser/debugger/debugger_contents.cc +++ b/chrome/browser/debugger/debugger_contents.cc @@ -69,7 +69,12 @@ class DebuggerHTMLSource : public ChromeURLDataManager::DataSource { // Currently but three choices {"", "debugger.js", "debugger.css"}. // Map the extension to mime-type, defaulting to "text/html". std::string mime_type("text/html"); - net::GetMimeTypeFromFile(ASCIIToWide(path), &mime_type); +#if defined(OS_WIN) + FilePath file_path(ASCIIToWide(path)); +#elif defined(OS_POSIX) + FilePath file_path(path); +#endif + net::GetMimeTypeFromFile(file_path, &mime_type); return mime_type; } diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index 5747c3b..965f2ed 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -1080,7 +1080,7 @@ void DownloadManager::GenerateExtension( extension.assign(default_extension); std::string mime_type_from_extension; - net::GetMimeTypeFromFile(file_name.ToWStringHack(), + 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. @@ -1198,11 +1198,11 @@ static const char* kExecutableBlackList[] = { // static bool DownloadManager::IsExecutableMimeType(const std::string& mime_type) { - for (int i=0; i < arraysize(kExecutableWhiteList); ++i) { + for (size_t i = 0; i < arraysize(kExecutableWhiteList); ++i) { if (net::MatchesMimeType(kExecutableWhiteList[i], mime_type)) return true; } - for (int i=0; i < arraysize(kExecutableBlackList); ++i) { + for (size_t i = 0; i < arraysize(kExecutableBlackList); ++i) { if (net::MatchesMimeType(kExecutableBlackList[i], mime_type)) return false; } diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index 022a655..e7634dc 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -545,17 +545,17 @@ void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id, #endif // OS_WIN void ResourceMessageFilter::OnGetMimeTypeFromExtension( - const std::wstring& ext, std::string* mime_type) { + const FilePath::StringType& ext, std::string* mime_type) { net::GetMimeTypeFromExtension(ext, mime_type); } void ResourceMessageFilter::OnGetMimeTypeFromFile( - const std::wstring& file_path, std::string* mime_type) { + const FilePath& file_path, std::string* mime_type) { net::GetMimeTypeFromFile(file_path, mime_type); } void ResourceMessageFilter::OnGetPreferredExtensionForMimeType( - const std::string& mime_type, std::wstring* ext) { + const std::string& mime_type, FilePath::StringType* ext) { net::GetPreferredExtensionForMimeType(mime_type, ext); } diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h index c5b25f9..4133353 100644 --- a/chrome/browser/renderer_host/resource_message_filter.h +++ b/chrome/browser/renderer_host/resource_message_filter.h @@ -83,7 +83,7 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter, int render_process_host_id() const { return render_process_host_id_;} base::ProcessHandle renderer_handle() const { return render_handle_;} - + // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, @@ -154,12 +154,12 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter, void OnGetWindowRect(gfx::NativeViewId window, gfx::Rect *rect); void OnGetRootWindowRect(gfx::NativeViewId window, gfx::Rect *rect); #endif - void OnGetMimeTypeFromExtension(const std::wstring& ext, + void OnGetMimeTypeFromExtension(const FilePath::StringType& ext, std::string* mime_type); - void OnGetMimeTypeFromFile(const std::wstring& file_path, + void OnGetMimeTypeFromFile(const FilePath& file_path, std::string* mime_type); void OnGetPreferredExtensionForMimeType(const std::string& mime_type, - std::wstring* ext); + FilePath::StringType* ext); void OnGetCPBrowsingContext(uint32* context); void OnDuplicateSection(base::SharedMemoryHandle renderer_handle, base::SharedMemoryHandle* browser_handle); |