#include "extensions/renderer/api/declarative_content_hooks_delegate.h"
#include <string_view>
#include "base/functional/bind.h"
#include "extensions/common/api/declarative/declarative_constants.h"
#include "extensions/renderer/bindings/api_type_reference_map.h"
#include "extensions/renderer/bindings/argument_spec.h"
#include "gin/arguments.h"
#include "gin/converter.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_selector.h"
#include "v8/include/v8-container.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-exception.h"
#include "v8/include/v8-external.h"
#include "v8/include/v8-function-callback.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-object.h"
#include "v8/include/v8-primitive.h"
#include "v8/include/v8-template.h"
#include "v8/include/v8-value.h"
namespace extensions {
namespace {
void RunDeclarativeContentHooksDelegateHandlerCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) { … }
bool V8Assign(v8::Local<v8::Context> context,
v8::Local<v8::Object> src,
v8::Local<v8::Object> dst) { … }
bool CanonicalizeCssSelectors(v8::Local<v8::Context> context,
v8::Local<v8::Object> object,
std::string* error) { … }
bool Validate(const ArgumentSpec* spec,
const APITypeReferenceMap& type_refs,
v8::Local<v8::Context> context,
v8::Local<v8::Object> this_object,
v8::Local<v8::Object> source_object,
const std::string& type_name,
std::string* error) { … }
}
DeclarativeContentHooksDelegate::DeclarativeContentHooksDelegate() = default;
DeclarativeContentHooksDelegate::~DeclarativeContentHooksDelegate() = default;
void DeclarativeContentHooksDelegate::InitializeTemplate(
v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> object_template,
const APITypeReferenceMap& type_refs) { … }
void DeclarativeContentHooksDelegate::HandleCall(
const ArgumentSpec* spec,
const APITypeReferenceMap* type_refs,
const std::string& type_name,
const v8::FunctionCallbackInfo<v8::Value>& info) { … }
}