Report native messaging connection errors back to the native app.
When a native application attempts to initiate a native messaging
connection with a cooperating extension, that extension may not be
installed; in this case, the native app should be informed by launching
its native messaging host to notify it of this error. This is also
needed if the native app provides invalid input when requesting this
communication channel.
Add NativeMessagingHostErrorReporter, a self-owning class responsible
for starting the native messaging host with flag specific to the error
and keeping Chrome alive until either the native messaging host
terminates (upon informing the original native app of the error), or a
10 second timeout to avoid Chrome getting stuck due to a misbehaving
native messaging host.
Add plumbing to the existing native messaging host launch code to handle
the additional parameter.
Bug: 967262
Change-Id: Ie68cbae094de226fa43244719abda434d6200590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1675587
Reviewed-by: Ben Wells <[email protected]>
Reviewed-by: Sergey Ulanov <[email protected]>
Commit-Queue: Sam McNally <[email protected]>
Cr-Commit-Position: refs/heads/master@{#712836}
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn
index 0b6767c..c16f80cd 100644
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -1046,6 +1046,7 @@
"default_apps.cc",
"default_apps.h",
]
+ deps += [ "//components/keep_alive_registry" ]
if (is_posix) {
sources += [ "api/messaging/native_process_launcher_posix.cc" ]
}