| Index: chrome/browser/extensions/api/messaging/native_process_launcher.h
|
| diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.h b/chrome/browser/extensions/api/messaging/native_process_launcher.h
|
| index cbb9bd37fc29bc69b02905dd4f417f6a7ee34679..0b71507395774a33f8c3aebf067f090c01bbaac2 100644
|
| --- a/chrome/browser/extensions/api/messaging/native_process_launcher.h
|
| +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.h
|
| @@ -14,6 +14,8 @@ class FilePath;
|
|
|
| namespace extensions {
|
|
|
| +class NativeMessagingHostManifest;
|
| +
|
| class NativeProcessLauncher {
|
| public:
|
| // Callback that's called after the process has been launched.
|
| @@ -28,14 +30,25 @@ class NativeProcessLauncher {
|
| NativeProcessLauncher() {}
|
| virtual ~NativeProcessLauncher() {}
|
|
|
| - // Launches native host with the specified name asynchronously. |callback| is
|
| - // called after the process has been started. If the launcher is destroyed
|
| - // before the callback is called then the call is canceled and the process is
|
| - // killed if it has been started already.
|
| - virtual void Launch(const std::string& native_host_name,
|
| + // Finds native messaging host with the specified name and launches it
|
| + // asynchronously. Also checks that the specified |origin| is permitted to
|
| + // access the host. |callback| is called after the process has been started.
|
| + // If the launcher is destroyed before the callback is called then the call is
|
| + // canceled and the process is killed if it has been started already.
|
| + virtual void Launch(const std::string& origin,
|
| + const std::string& native_host_name,
|
| LaunchedCallback callback) const = 0;
|
|
|
| protected:
|
| + // The following two methods are platform specific and are implemented in
|
| + // platform-specific .cc files.
|
| +
|
| + // Loads manifest for the native messaging host |name|.
|
| + static scoped_ptr<NativeMessagingHostManifest> FindAndLoadManifest(
|
| + const std::string& native_host_name,
|
| + std::string* error_message);
|
| +
|
| + // Launches native messaging process.
|
| static bool LaunchNativeProcess(
|
| const base::FilePath& path,
|
| base::ProcessHandle* native_process_handle,
|
|
|