Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: base/mime_util_xdg.cc

Issue 6312195: Linux: Restrict access to xdg-mime functions to the FILE thread.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mime_util_xdg.cc
===================================================================
--- base/mime_util_xdg.cc (revision 74011)
+++ base/mime_util_xdg.cc (working copy)
@@ -21,6 +21,7 @@
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/third_party/xdg_mime/xdgmime.h"
+#include "base/threading/thread_restrictions.h"
namespace {
@@ -155,6 +156,7 @@
IconTheme::IconTheme(const std::string& name)
: index_theme_loaded_(false),
info_array_(NULL) {
+ base::ThreadRestrictions::AssertIOAllowed();
// Iterate on all icon directories to find directories of the specified
// theme and load the first encountered index.theme.
std::map<FilePath, int>::iterator iter;
@@ -550,10 +552,12 @@
namespace mime_util {
std::string GetFileMimeType(const FilePath& filepath) {
+ base::ThreadRestrictions::AssertIOAllowed();
return xdg_mime_get_mime_type_from_file_name(filepath.value().c_str());
}
std::string GetDataMimeType(const std::string& data) {
+ base::ThreadRestrictions::AssertIOAllowed();
return xdg_mime_get_mime_type_for_data(data.data(), data.length(), NULL);
}
@@ -576,6 +580,7 @@
}
FilePath GetMimeIcon(const std::string& mime_type, size_t size) {
+ base::ThreadRestrictions::AssertIOAllowed();
std::vector<std::string> icon_names;
std::string icon_name;
FilePath icon_file;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698