#include "extensions/renderer/worker_script_context_set.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/ranges/algorithm.h"
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/worker_thread_util.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"
#include "v8/include/v8-context.h"
namespace extensions {
namespace {
ContextVector;
ContextVector::iterator FindContext(ContextVector* contexts,
v8::Local<v8::Context> v8_context) { … }
ABSL_CONST_INIT thread_local ContextVector* contexts = …;
}
WorkerScriptContextSet::WorkerScriptContextSet() = default;
WorkerScriptContextSet::~WorkerScriptContextSet() = default;
void WorkerScriptContextSet::ForEach(
const mojom::HostID& host_id,
content::RenderFrame* render_frame,
const base::RepeatingCallback<void(ScriptContext*)>& callback) { … }
void WorkerScriptContextSet::ExecuteCallbackWithContext(
ScriptContext* context,
const base::RepeatingCallback<void(ScriptContext*)>& callback) { … }
void WorkerScriptContextSet::Insert(std::unique_ptr<ScriptContext> context) { … }
ScriptContext* WorkerScriptContextSet::GetContextByV8Context(
v8::Local<v8::Context> v8_context) { … }
void WorkerScriptContextSet::Remove(v8::Local<v8::Context> v8_context,
const GURL& url) { … }
void WorkerScriptContextSet::WillStopCurrentWorkerThread() { … }
}