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

Unified Diff: chrome/browser/platform_util_win.cc

Issue 431343002: Experimentally isolate OpenItemViaShell in a utility process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 4 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 | chrome/common/chrome_utility_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/platform_util_win.cc
diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc
index be651c45fd65da4290252019c78ad40d288ae957..7d18db66afe4d0596303f2d023d2e4369bb7c69b 100644
--- a/chrome/browser/platform_util_win.cc
+++ b/chrome/browser/platform_util_win.cc
@@ -13,6 +13,7 @@
#include "base/bind_helpers.h"
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h"
@@ -21,7 +22,9 @@
#include "base/win/windows_version.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/ui/host_desktop.h"
+#include "chrome/common/chrome_utility_messages.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/utility_process_host.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/native_widget_types.h"
#include "url/gurl.h"
@@ -155,6 +158,13 @@ void OpenExternalOnFileThread(const GURL& url) {
}
}
+void OpenItemViaShellInUtilityProcess(const base::FilePath& full_path) {
+ base::WeakPtr<content::UtilityProcessHost> utility_process_host(
+ content::UtilityProcessHost::Create(NULL, NULL)->AsWeakPtr());
+ utility_process_host->DisableSandbox();
+ utility_process_host->Send(new ChromeUtilityMsg_OpenItemViaShell(full_path));
+}
+
} // namespace
namespace platform_util {
@@ -175,9 +185,18 @@ void OpenItem(Profile* profile, const base::FilePath& full_path) {
if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH)
chrome::ActivateDesktopHelper(chrome::ASH_KEEP_RUNNING);
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(base::IgnoreResult(&ui::win::OpenItemViaShell), full_path));
+ if (base::FieldTrialList::FindFullName("IsolateShellOperations") ==
+ "Enabled") {
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&OpenItemViaShellInUtilityProcess, full_path));
+ } else {
+ BrowserThread::PostTask(
+ BrowserThread::FILE,
+ FROM_HERE,
+ base::Bind(base::IgnoreResult(&ui::win::OpenItemViaShell), full_path));
+ }
}
void OpenExternal(Profile* profile, const GURL& url) {
« no previous file with comments | « no previous file | chrome/common/chrome_utility_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698