diff options
-rw-r--r-- | base/base.gypi | 4 | ||||
-rw-r--r-- | base/nix/mime_util_xdg.cc (renamed from base/mime_util_xdg.cc) | 14 | ||||
-rw-r--r-- | base/nix/mime_util_xdg.h (renamed from base/mime_util.h) | 12 | ||||
-rw-r--r-- | chrome/browser/icon_loader.cc | 4 | ||||
-rw-r--r-- | chrome/browser/icon_loader_linux.cc | 4 | ||||
-rw-r--r-- | chrome/browser/icon_manager_linux.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/dialogs_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/dialogs_kde.cc | 4 | ||||
-rw-r--r-- | content/browser/tab_contents/web_drag_source_gtk.cc | 4 | ||||
-rw-r--r-- | net/base/platform_mime_util_linux.cc | 4 | ||||
-rw-r--r-- | tools/valgrind/memcheck/suppressions.txt | 2 |
11 files changed, 34 insertions, 30 deletions
diff --git a/base/base.gypi b/base/base.gypi index f81be8a..8cfd5fd 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -195,8 +195,6 @@ 'metrics/stats_counters.h', 'metrics/stats_table.cc', 'metrics/stats_table.h', - 'mime_util.h', - 'mime_util_xdg.cc', 'native_library.h', 'native_library_linux.cc', 'native_library_mac.mm', @@ -360,6 +358,8 @@ 'version.h', 'vlog.cc', 'vlog.h', + 'nix/mime_util_xdg.cc', + 'nix/mime_util_xdg.h', 'nix/xdg_util.cc', 'nix/xdg_util.h', 'win/event_trace_consumer.h', diff --git a/base/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc index 3232da0..77e9ae3 100644 --- a/base/mime_util_xdg.cc +++ b/base/nix/mime_util_xdg.cc @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/mime_util.h" - +#include "base/nix/mime_util_xdg.h" #include <cstdlib> #include <list> @@ -16,7 +15,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" -#include "base/message_loop.h" #include "base/nix/xdg_util.h" #include "base/string_split.h" #include "base/string_util.h" @@ -26,7 +24,9 @@ #include "base/time.h" #if defined(TOOLKIT_USES_GTK) -#include <gtk/gtk.h> +#include <gtk/gtk.h> // NOLINT + +#include "base/message_loop.h" #endif namespace { @@ -585,7 +585,8 @@ MimeUtilConstants::~MimeUtilConstants() { } // namespace -namespace mime_util { +namespace base { +namespace nix { std::string GetFileMimeType(const FilePath& filepath) { base::ThreadRestrictions::AssertIOAllowed(); @@ -672,4 +673,5 @@ FilePath GetMimeIcon(const std::string& mime_type, size_t size) { return FilePath(); } -} // namespace mime_util +} // namespace nix +} // namespace base diff --git a/base/mime_util.h b/base/nix/mime_util_xdg.h index 7af0472..94a6c06 100644 --- a/base/mime_util.h +++ b/base/nix/mime_util_xdg.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_MIME_UTIL_H_ -#define BASE_MIME_UTIL_H_ +#ifndef BASE_NIX_MIME_UTIL_XDG_H_ +#define BASE_NIX_MIME_UTIL_XDG_H_ #pragma once #include <string> @@ -13,7 +13,8 @@ class FilePath; -namespace mime_util { +namespace base { +namespace nix { // Gets the mime type for a file based on its filename. The file path does not // have to exist. Please note because it doesn't touch the disk, this does not @@ -37,6 +38,7 @@ BASE_EXPORT void DetectGtkTheme(); // then a generic icon, and finally an empty FilePath if all else fails. BASE_EXPORT FilePath GetMimeIcon(const std::string& mime_type, size_t size); -} // namespace mime_util +} // namespace nix +} // namespace base -#endif // BASE_MIME_UTIL_H_ +#endif // BASE_NIX_MIME_UTIL_XDG_H_ diff --git a/chrome/browser/icon_loader.cc b/chrome/browser/icon_loader.cc index 20904b5..4879adf 100644 --- a/chrome/browser/icon_loader.cc +++ b/chrome/browser/icon_loader.cc @@ -9,7 +9,7 @@ #include "third_party/skia/include/core/SkBitmap.h" #if defined(TOOLKIT_USES_GTK) -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #endif using content::BrowserThread; @@ -31,7 +31,7 @@ void IconLoader::Start() { #if defined(TOOLKIT_USES_GTK) // This call must happen on the UI thread before we can start loading icons. - mime_util::DetectGtkTheme(); + base::nix::DetectGtkTheme(); #endif BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, diff --git a/chrome/browser/icon_loader_linux.cc b/chrome/browser/icon_loader_linux.cc index 0bb6879..a6cb519 100644 --- a/chrome/browser/icon_loader_linux.cc +++ b/chrome/browser/icon_loader_linux.cc @@ -9,7 +9,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/image_decoder.h" @@ -31,7 +31,7 @@ void IconLoader::ReadIcon() { NOTREACHED(); } - FilePath filename = mime_util::GetMimeIcon(group_, size_pixels); + FilePath filename = base::nix::GetMimeIcon(group_, size_pixels); string icon_data; file_util::ReadFileToString(filename, &icon_data); diff --git a/chrome/browser/icon_manager_linux.cc b/chrome/browser/icon_manager_linux.cc index fc3cfa8..df7c629 100644 --- a/chrome/browser/icon_manager_linux.cc +++ b/chrome/browser/icon_manager_linux.cc @@ -4,16 +4,16 @@ #include "chrome/browser/icon_manager.h" -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #include "base/threading/thread_restrictions.h" IconGroupID IconManager::GetGroupIDFromFilepath(const FilePath& filepath) { - // It turns out the call to mime_util::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 // and Mac implementations do not). We should fix this by either not doing IO // in this method, or reworking callers to avoid calling it on the UI thread. // See crbug.com/72740. base::ThreadRestrictions::ScopedAllowIO allow_io; - return mime_util::GetFileMimeType(filepath); + return base::nix::GetFileMimeType(filepath); } diff --git a/chrome/browser/ui/gtk/dialogs_gtk.cc b/chrome/browser/ui/gtk/dialogs_gtk.cc index 6064705..b79a171 100644 --- a/chrome/browser/ui/gtk/dialogs_gtk.cc +++ b/chrome/browser/ui/gtk/dialogs_gtk.cc @@ -9,7 +9,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #include "base/sys_string_conversions.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" @@ -228,7 +228,7 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) { // Allow IO in the file dialog. http://crbug.com/72637 base::ThreadRestrictions::ScopedAllowIO allow_io; - std::string mime_type = mime_util::GetFileMimeType( + std::string mime_type = base::nix::GetFileMimeType( FilePath("name").ReplaceExtension(file_types_.extensions[i][j])); gtk_file_filter_add_mime_type(filter, mime_type.c_str()); } @@ -247,7 +247,7 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) { base::ThreadRestrictions::ScopedAllowIO allow_io; // There is no system default filter description so we use // the MIME type itself if the description is blank. - std::string mime_type = mime_util::GetFileMimeType( + std::string mime_type = base::nix::GetFileMimeType( FilePath("name").ReplaceExtension(file_types_.extensions[i][0])); gtk_file_filter_set_name(filter, mime_type.c_str()); } diff --git a/chrome/browser/ui/gtk/dialogs_kde.cc b/chrome/browser/ui/gtk/dialogs_kde.cc index 8b6893e..c5a9e4d 100644 --- a/chrome/browser/ui/gtk/dialogs_kde.cc +++ b/chrome/browser/ui/gtk/dialogs_kde.cc @@ -11,7 +11,7 @@ #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/logging.h" -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #include "base/nix/xdg_util.h" #include "base/process_util.h" #include "base/string_number_conversions.h" @@ -194,7 +194,7 @@ std::string SelectFileDialogImplKDE::GetMimeTypeFilterString() { for (size_t i = 0; i < file_types_.extensions.size(); ++i) { for (size_t j = 0; j < file_types_.extensions[i].size(); ++j) { if (!file_types_.extensions[i][j].empty()) { - std::string mime_type = mime_util::GetFileMimeType( + std::string mime_type = base::nix::GetFileMimeType( FilePath("name").ReplaceExtension(file_types_.extensions[i][j])); filter_set.insert(mime_type); } diff --git a/content/browser/tab_contents/web_drag_source_gtk.cc b/content/browser/tab_contents/web_drag_source_gtk.cc index bb0d3e8..7c01fa4 100644 --- a/content/browser/tab_contents/web_drag_source_gtk.cc +++ b/content/browser/tab_contents/web_drag_source_gtk.cc @@ -7,7 +7,7 @@ #include <string> #include "base/file_util.h" -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #include "base/threading/thread_restrictions.h" #include "base/utf_string_conversions.h" #include "content/browser/download/drag_download_file.h" @@ -114,7 +114,7 @@ void WebDragSourceGtk::StartDragging(const WebDropData& drop_data, // Looking up the mime type can hit the disk. http://crbug.com/84896 base::ThreadRestrictions::ScopedAllowIO allow_io; drag_file_mime_type_ = gdk_atom_intern( - mime_util::GetDataMimeType(drop_data.file_contents).c_str(), FALSE); + base::nix::GetDataMimeType(drop_data.file_contents).c_str(), FALSE); gtk_target_list_add(list, drag_file_mime_type_, 0, ui::CHROME_WEBDROP_FILE_CONTENTS); } diff --git a/net/base/platform_mime_util_linux.cc b/net/base/platform_mime_util_linux.cc index 1d4acc0..5aba0e3 100644 --- a/net/base/platform_mime_util_linux.cc +++ b/net/base/platform_mime_util_linux.cc @@ -12,7 +12,7 @@ #if defined(OS_ANDROID) #include "net/android/network_library.h" #else -#include "base/mime_util.h" +#include "base/nix/mime_util_xdg.h" #endif namespace net { @@ -33,7 +33,7 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( return false; FilePath dummy_path("foo." + ext); - std::string out = mime_util::GetFileMimeType(dummy_path); + std::string out = base::nix::GetFileMimeType(dummy_path); // GetFileMimeType likes to return application/octet-stream // for everything it doesn't know - ignore that. diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index fc21cca..72dda7b 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -4378,7 +4378,7 @@ ... fun:xdg_mime_init fun:xdg_mime_get_mime_type_from_file_name - fun:_ZN9mime_util15GetFileMimeTypeERK8FilePath + fun:*GetFileMimeTypeERK8FilePath fun:_ZNK3net16PlatformMimeUtil32GetPlatformMimeTypeFromExtensionERKSsPSs fun:_ZNK3net8MimeUtil30GetMimeTypeFromExtensionHelperERKSsbPSs fun:_ZNK3net8MimeUtil24GetMimeTypeFromExtensionERKSsPSs |