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

Unified Diff: content/public/browser/utility_process_mojo_client.h

Issue 2697463002: Convert utility process extension Unpacker IPC to mojo (Closed)
Patch Set: Use MakeUnique when creating the utility mojo client. Created 3 years, 10 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
Index: content/public/browser/utility_process_mojo_client.h
diff --git a/content/public/browser/utility_process_mojo_client.h b/content/public/browser/utility_process_mojo_client.h
index cfcb93b953dd1b87f3c8dc4dba6722809db9ac8b..258c3dc2430ff374e93573dbdcae95d43a859a9b 100644
--- a/content/public/browser/utility_process_mojo_client.h
+++ b/content/public/browser/utility_process_mojo_client.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/callback.h"
+#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/strings/string16.h"
@@ -42,6 +43,12 @@ class UtilityProcessMojoClient {
on_error_callback_ = on_error_callback;
}
+ // Allows a directory to be opened through the sandbox.
+ void set_exposed_directory(const base::FilePath& directory) {
+ DCHECK(!start_called_);
+ helper_->set_exposed_directory(directory);
+ }
+
// Disables the sandbox in the utility process.
void set_disable_sandbox() {
DCHECK(!start_called_);
@@ -102,6 +109,10 @@ class UtilityProcessMojoClient {
mojo_interface_name, base::Passed(&interface_pipe)));
}
+ void set_exposed_directory(const base::FilePath& directory) {
+ exposed_directory_ = directory;
+ }
+
void set_disable_sandbox() { disable_sandbox_ = true; }
#if defined(OS_WIN)
@@ -120,6 +131,9 @@ class UtilityProcessMojoClient {
utility_host_ = UtilityProcessHost::Create(nullptr, nullptr)->AsWeakPtr();
utility_host_->SetName(process_name_);
+ if (!exposed_directory_.empty())
+ utility_host_->SetExposedDir(exposed_directory_);
+
if (disable_sandbox_)
utility_host_->DisableSandbox();
#if defined(OS_WIN)
@@ -137,6 +151,7 @@ class UtilityProcessMojoClient {
// Properties of the utility process.
base::string16 process_name_;
+ base::FilePath exposed_directory_;
bool disable_sandbox_ = false;
#if defined(OS_WIN)
bool run_elevated_ = false;

Powered by Google App Engine
This is Rietveld 408576698