Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add missing gin::Wrappable GetTypeName overrides #41512

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions shell/browser/api/electron_api_data_pipe_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ v8::Local<v8::Promise> DataPipeHolder::ReadAll(v8::Isolate* isolate) {
return handle;
}

const char* DataPipeHolder::GetTypeName() {
return "DataPipeHolder";
}

// static
gin::Handle<DataPipeHolder> DataPipeHolder::Create(
v8::Isolate* isolate,
Expand Down
2 changes: 2 additions & 0 deletions shell/browser/api/electron_api_data_pipe_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ namespace electron::api {
// Retains reference to the data pipe.
class DataPipeHolder : public gin::Wrappable<DataPipeHolder> {
public:
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
const char* GetTypeName() override;

static gin::Handle<DataPipeHolder> Create(
v8::Isolate* isolate,
Expand Down
4 changes: 4 additions & 0 deletions shell/browser/api/electron_api_power_save_blocker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ gin::ObjectTemplateBuilder PowerSaveBlocker::GetObjectTemplateBuilder(
.SetMethod("isStarted", &PowerSaveBlocker::IsStarted);
}

const char* PowerSaveBlocker::GetTypeName() {
return "PowerSaveBlocker";
}

} // namespace electron::api

namespace {
Expand Down
4 changes: 2 additions & 2 deletions shell/browser/api/electron_api_power_save_blocker.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {
static gin::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate);

// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;

static gin::WrapperInfo kWrapperInfo;
const char* GetTypeName() override;

// disable copy
PowerSaveBlocker(const PowerSaveBlocker&) = delete;
Expand Down
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_web_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ namespace electron::api {

class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI {
public:
static gin::WrapperInfo kWrapperInfo;

// Return the WebRequest object attached to |browser_context|, create if there
// is no one.
// Note that the lifetime of WebRequest object is managed by Session, instead
Expand All @@ -44,6 +42,7 @@ class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI {
content::BrowserContext* browser_context);

// gin::Wrappable:
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/message_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class MessagePort : public gin::Wrappable<MessagePort>,
bool* threw_exception);

// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
static gin::WrapperInfo kWrapperInfo;
const char* GetTypeName() override;

private:
Expand Down
2 changes: 2 additions & 0 deletions shell/common/api/electron_api_url_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ class JSChunkedDataPipeGetter : public gin::Wrappable<JSChunkedDataPipeGetter>,
.SetMethod("done", &JSChunkedDataPipeGetter::Done);
}

const char* GetTypeName() override { return "JSChunkedDataPipeGetter"; }

static gin::WrapperInfo kWrapperInfo;
~JSChunkedDataPipeGetter() override = default;

Expand Down
2 changes: 2 additions & 0 deletions shell/common/gin_converters/net_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ class ChunkedDataPipeReadableStream
.SetMethod("read", &ChunkedDataPipeReadableStream::Read);
}

const char* GetTypeName() override { return "ChunkedDataPipeReadableStream"; }

static gin::WrapperInfo kWrapperInfo;

private:
Expand Down
4 changes: 4 additions & 0 deletions shell/common/gin_helper/event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ Event::~Event() = default;

gin::WrapperInfo Event::kWrapperInfo = {gin::kEmbedderNativeGin};

const char* Event::GetTypeName() {
return GetClassName();
}

} // namespace gin_helper::internal
1 change: 1 addition & 0 deletions shell/common/gin_helper/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Event : public gin::Wrappable<Event>,

// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
const char* GetTypeName() override;

~Event() override;

Expand Down