Index: chrome/browser/shell_integration_linux.cc |
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc |
index f34c9ffb10a1225ca03507cac17b2233529bc84f..a9a1e98960cdf6467dfef7a5934294e77ecf7b96 100644 |
--- a/chrome/browser/shell_integration_linux.cc |
+++ b/chrome/browser/shell_integration_linux.cc |
@@ -50,13 +50,10 @@ |
#include "chrome/common/features.h" |
#include "chrome/grit/chrome_unscaled_resources.h" |
#include "components/version_info/version_info.h" |
-#include "content/public/browser/browser_thread.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/gfx/image/image_family.h" |
#include "url/gurl.h" |
-using content::BrowserThread; |
- |
namespace shell_integration { |
namespace { |
@@ -565,13 +562,13 @@ base::FilePath GetChromeExePath() { |
} // namespace |
base::FilePath GetDataWriteLocation(base::Environment* env) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
return base::nix::GetXDGDirectory(env, "XDG_DATA_HOME", ".local/share"); |
} |
std::vector<base::FilePath> GetDataSearchLocations(base::Environment* env) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
std::vector<base::FilePath> search_paths; |
base::FilePath write_location = GetDataWriteLocation(env); |
@@ -682,7 +679,7 @@ web_app::ShortcutLocations GetExistingShortcutLocations( |
const base::FilePath& profile_path, |
const std::string& extension_id, |
const base::FilePath& desktop_path) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
base::FilePath shortcut_filename = GetExtensionShortcutFilename( |
profile_path, extension_id); |
@@ -713,7 +710,7 @@ web_app::ShortcutLocations GetExistingShortcutLocations( |
bool GetExistingShortcutContents(base::Environment* env, |
const base::FilePath& desktop_filename, |
std::string* output) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
std::vector<base::FilePath> search_paths = GetDataSearchLocations(env); |
@@ -774,7 +771,7 @@ base::FilePath GetExtensionShortcutFilename(const base::FilePath& profile_path, |
std::vector<base::FilePath> GetExistingProfileShortcutFilenames( |
const base::FilePath& profile_path, |
const base::FilePath& directory) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
// Use a prefix, because xdg-desktop-menu requires it. |
std::string prefix(chrome::kBrowserProcessExecutableName); |
@@ -939,7 +936,7 @@ std::string GetDirectoryFileContents(const base::string16& title, |
bool CreateDesktopShortcut( |
const web_app::ShortcutInfo& shortcut_info, |
const web_app::ShortcutLocations& creation_locations) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
base::FilePath shortcut_filename; |
if (!shortcut_info.extension_id.empty()) { |
@@ -1032,7 +1029,7 @@ bool CreateDesktopShortcut( |
bool CreateAppListDesktopShortcut( |
const std::string& wm_class, |
const std::string& title) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
base::FilePath desktop_name(kAppListDesktopName); |
base::FilePath shortcut_filename = desktop_name.AddExtension("desktop"); |
@@ -1072,7 +1069,7 @@ bool CreateAppListDesktopShortcut( |
void DeleteDesktopShortcuts(const base::FilePath& profile_path, |
const std::string& extension_id) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
base::FilePath shortcut_filename = GetExtensionShortcutFilename( |
profile_path, extension_id); |
@@ -1088,7 +1085,7 @@ void DeleteDesktopShortcuts(const base::FilePath& profile_path, |
} |
void DeleteAllDesktopShortcuts(const base::FilePath& profile_path) { |
- DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
+ base::ThreadRestrictions::AssertIOAllowed(); |
std::unique_ptr<base::Environment> env(base::Environment::Create()); |