See https://github.com/electron/electron/blob/54ad38526095f4a415ad75a1757feae4336c9db4/atom/browser/atom_permission_manager.cc#L213 and https://github.com/electron/electron/blob/54ad38526095f4a415ad75a1757feae4336c9db4/atom/browser/atom_permission_manager.cc#L246

Should probably call out to https://github.com/electron/electron/blob/54ad38526095f4a415ad75a1757feae4336c9db4/atom/browser/atom_permission_manager.cc#L231 and be documented as such
shell/browser/electron_permission_manager.cc
#include "shell/browser/electron_permission_manager.h"
#include <memory>
#include <utility>
#include <vector>
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/permission_controller.h"
#include "content/public/browser/permission_type.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "shell/browser/electron_browser_client.h"
#include "shell/browser/electron_browser_main_parts.h"
#include "shell/browser/web_contents_preferences.h"
namespace electron {
namespace {
bool WebContentsDestroyed(int process_id) {