#include "extensions/browser/script_executor.h"
#include <map>
#include <set>
#include <string>
#include <vector>
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/dcheck_is_on.h"
#include "base/functional/bind.h"
#include "base/hash/hash.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/pickle.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/types/pass_key.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 "content/public/browser/web_contents_observer.h"
#include "extensions/browser/extension_api_frame_id_map.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_web_contents_observer.h"
#include "extensions/browser/script_injection_tracker.h"
#include "extensions/common/mojom/host_id.mojom.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "pdf/buildflags.h"
#if BUILDFLAG(ENABLE_PDF)
#include "extensions/common/constants.h"
#include "pdf/pdf_features.h"
#endif
namespace extensions {
namespace {
class Handler : public content::WebContentsObserver { … };
}
ScriptExecutor::FrameResult::FrameResult() = default;
ScriptExecutor::FrameResult::FrameResult(FrameResult&&) = default;
ScriptExecutor::FrameResult& ScriptExecutor::FrameResult::operator=(
FrameResult&&) = default;
ScriptExecutor::ScriptExecutor(content::WebContents* web_contents)
: … { … }
ScriptExecutor::~ScriptExecutor() = default;
std::string ScriptExecutor::GenerateInjectionKey(const mojom::HostID& host_id,
const GURL& script_url,
const std::string& code) { … }
void ScriptExecutor::ExecuteScript(const mojom::HostID& host_id,
mojom::CodeInjectionPtr injection,
ScriptExecutor::FrameScope frame_scope,
const std::set<int>& frame_ids,
ScriptExecutor::MatchAboutBlank about_blank,
mojom::RunLocation run_at,
ScriptExecutor::ProcessType process_type,
const GURL& webview_src,
ScriptFinishedCallback callback) { … }
}