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

Unified Diff: chrome/browser/shell_integration_linux.cc

Issue 2888693003: Remove the usage of BrowserThread::FILE in the shell_integration* files (Closed)
Patch Set: Added a comment and fix typo Created 3 years, 7 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 | « chrome/browser/shell_integration.cc ('k') | chrome/browser/shell_integration_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/shell_integration.cc ('k') | chrome/browser/shell_integration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698