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

Side by Side Diff: base/nix/mime_util_xdg.cc

Issue 2369933003: Remove dead code, GetDataMimeType (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « base/nix/mime_util_xdg.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/nix/mime_util_xdg.h" 5 #include "base/nix/mime_util_xdg.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "base/third_party/xdg_mime/xdgmime.h" 10 #include "base/third_party/xdg_mime/xdgmime.h"
(...skipping 11 matching lines...) Expand all
22 } // namespace 22 } // namespace
23 23
24 std::string GetFileMimeType(const FilePath& filepath) { 24 std::string GetFileMimeType(const FilePath& filepath) {
25 if (filepath.empty()) 25 if (filepath.empty())
26 return std::string(); 26 return std::string();
27 ThreadRestrictions::AssertIOAllowed(); 27 ThreadRestrictions::AssertIOAllowed();
28 AutoLock scoped_lock(g_mime_util_xdg_lock.Get()); 28 AutoLock scoped_lock(g_mime_util_xdg_lock.Get());
29 return xdg_mime_get_mime_type_from_file_name(filepath.value().c_str()); 29 return xdg_mime_get_mime_type_from_file_name(filepath.value().c_str());
30 } 30 }
31 31
32 std::string GetDataMimeType(const std::string& data) {
33 ThreadRestrictions::AssertIOAllowed();
34 AutoLock scoped_lock(g_mime_util_xdg_lock.Get());
35 return xdg_mime_get_mime_type_for_data(data.data(), data.length(), NULL);
36 }
37
38 } // namespace nix 32 } // namespace nix
39 } // namespace base 33 } // namespace base
OLDNEW
« no previous file with comments | « base/nix/mime_util_xdg.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698