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

Unified Diff: base/nix/mime_util_xdg.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/nix/mime_util_xdg.h ('k') | base/nix/xdg_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nix/mime_util_xdg.cc
diff --git a/base/nix/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc
deleted file mode 100644
index f78b6aba558e4209c30354df4cb6458aac79b814..0000000000000000000000000000000000000000
--- a/base/nix/mime_util_xdg.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/nix/mime_util_xdg.h"
-
-#include "base/files/file_path.h"
-#include "base/lazy_instance.h"
-#include "base/synchronization/lock.h"
-#include "base/third_party/xdg_mime/xdgmime.h"
-#include "base/threading/thread_restrictions.h"
-
-namespace base {
-namespace nix {
-
-namespace {
-
-// None of the XDG stuff is thread-safe, so serialize all access under
-// this lock.
-LazyInstance<Lock>::Leaky g_mime_util_xdg_lock = LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
-std::string GetFileMimeType(const FilePath& filepath) {
- if (filepath.empty())
- return std::string();
- ThreadRestrictions::AssertIOAllowed();
- AutoLock scoped_lock(g_mime_util_xdg_lock.Get());
- return xdg_mime_get_mime_type_from_file_name(filepath.value().c_str());
-}
-
-std::string GetDataMimeType(const std::string& data) {
- ThreadRestrictions::AssertIOAllowed();
- AutoLock scoped_lock(g_mime_util_xdg_lock.Get());
- return xdg_mime_get_mime_type_for_data(data.data(), data.length(), NULL);
-}
-
-} // namespace nix
-} // namespace base
« no previous file with comments | « base/nix/mime_util_xdg.h ('k') | base/nix/xdg_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698