#include "extensions/renderer/storage_area.h"
#include "base/strings/stringprintf.h"
#include "extensions/common/api/storage.h"
#include "extensions/renderer/bindings/api_binding_util.h"
#include "extensions/renderer/bindings/api_event_handler.h"
#include "extensions/renderer/bindings/api_invocation_errors.h"
#include "extensions/renderer/bindings/api_request_handler.h"
#include "extensions/renderer/bindings/api_signature.h"
#include "extensions/renderer/bindings/api_type_reference_map.h"
#include "extensions/renderer/bindings/binding_access_checker.h"
#include "gin/arguments.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "gin/wrappable.h"
#include "v8/include/v8-object.h"
#include "v8/include/v8-primitive.h"
namespace extensions {
namespace {
#define DEFINE_STORAGE_AREA_HANDLERS …
class LocalStorageArea final : public gin::Wrappable<LocalStorageArea> { … };
gin::WrapperInfo LocalStorageArea::kWrapperInfo = …;
class SyncStorageArea final : public gin::Wrappable<SyncStorageArea> { … };
gin::WrapperInfo SyncStorageArea::kWrapperInfo = …;
class ManagedStorageArea final : public gin::Wrappable<ManagedStorageArea> { … };
gin::WrapperInfo ManagedStorageArea::kWrapperInfo = …;
class SessionStorageArea final : public gin::Wrappable<SessionStorageArea> { … };
gin::WrapperInfo SessionStorageArea::kWrapperInfo = …;
#undef DEFINE_STORAGE_AREA_HANDLERS
}
StorageArea::StorageArea(APIRequestHandler* request_handler,
APIEventHandler* event_handler,
const APITypeReferenceMap* type_refs,
const std::string& name,
const BindingAccessChecker* access_checker)
: … { … }
StorageArea::~StorageArea() = default;
v8::Local<v8::Object> StorageArea::CreateStorageArea(
v8::Isolate* isolate,
const std::string& property_name,
const base::Value::List*,
APIRequestHandler* request_handler,
APIEventHandler* event_handler,
APITypeReferenceMap* type_refs,
const BindingAccessChecker* access_checker) { … }
void StorageArea::HandleFunctionCall(const std::string& method_name,
gin::Arguments* arguments) { … }
v8::Local<v8::Value> StorageArea::GetOnChangedEvent(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
v8::Local<v8::Object> wrapper) { … }
}