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

Unified Diff: chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc

Issue 12285015: Require manifests for native messaging hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
index 6297271817a49793166e207cc4a0dcc1d1fdabad..b2a5fff7bd439e4329b9e92fc770d16f9e30dc2b 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
@@ -9,9 +9,31 @@
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process_util.h"
+#include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h"
namespace extensions {
+namespace {
+
+const char kNativeMessagingDirectory[] =
+#if defined(OS_MAXOSX)
+ "/Library/Chrome/NativeMessagingHosts";
+#else
+ "/etc/opt/chrome/native-messaging-hosts";
+#endif
+
+} // namespace
+
+// static
+scoped_ptr<NativeMessagingHostManifest>
+NativeProcessLauncher::FindAndLoadManifest(
+ const std::string& native_host_name,
+ std::string* error_message) {
+ FilePath manifest_path =
+ FilePath(kNativeMessagingDirectory).Append(native_host_name + ".json");
+ return NativeMessagingHostManifest::Load(manifest_path, error_message);
+}
+
// static
bool NativeProcessLauncher::LaunchNativeProcess(
const base::FilePath& path,

Powered by Google App Engine
This is Rietveld 408576698