Compare commits

...

1 Commits

Author SHA1 Message Date
Charles Kerr
d11f0c381c chore: comment out unused arg names
autofix clang-tidy misc-unused-parameters warnings
2025-01-20 13:36:22 -06:00
150 changed files with 557 additions and 548 deletions

View File

@@ -187,7 +187,7 @@ void ElectronContentClient::AddPlugins(
void ElectronContentClient::AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) {
std::vector<media::CdmHostFilePath>* /*cdm_host_file_paths*/) {
if (cdms) {
#if BUILDFLAG(ENABLE_WIDEVINE)
base::FilePath cdm_path;

View File

@@ -86,7 +86,7 @@ void WINAPI FiberBinder(void* params) {
}
#endif // defined(ARCH_CPU_32_BITS)
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* /*cmd*/, int) {
#if defined(ARCH_CPU_32_BITS)
enum class FiberStatus { kConvertFailed, kCreateFiberFailed, kSuccess };
FiberStatus fiber_status = FiberStatus::kSuccess;

View File

@@ -15,7 +15,7 @@ UvTaskRunner::UvTaskRunner(uv_loop_t* loop) : loop_{loop} {}
UvTaskRunner::~UvTaskRunner() = default;
bool UvTaskRunner::PostDelayedTask(const base::Location& from_here,
bool UvTaskRunner::PostDelayedTask(const base::Location& /*from_here*/,
base::OnceClosure task,
base::TimeDelta delay) {
auto on_timeout = [](uv_timer_t* timer) {

View File

@@ -690,20 +690,20 @@ void App::OnDidResignActive() {
bool App::CanCreateWindow(
content::RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const url::Origin& source_origin,
content::mojom::WindowContainerType container_type,
const GURL& /*opener_url*/,
const GURL& /*opener_top_level_frame_url*/,
const url::Origin& /*source_origin*/,
content::mojom::WindowContainerType /*container_type*/,
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
const blink::mojom::WindowFeatures& /*features*/,
const std::string& raw_features,
const scoped_refptr<network::ResourceRequestBody>& body,
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) {
bool /*user_gesture*/,
bool /*opener_suppressed*/,
bool* /*no_javascript_access*/) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);
content::WebContents* web_contents =
@@ -726,7 +726,7 @@ void App::AllowCertificateError(
const net::SSLInfo& ssl_info,
const GURL& request_url,
bool is_main_frame_request,
bool strict_enforcement,
bool /*strict_enforcement*/,
base::OnceCallback<void(content::CertificateRequestResultType)> callback) {
auto adapted_callback = base::AdaptCallbackForRepeating(std::move(callback));
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
@@ -742,8 +742,8 @@ void App::AllowCertificateError(
}
base::OnceClosure App::SelectClientCertificate(
content::BrowserContext* browser_context,
int process_id,
content::BrowserContext* /*browser_context*/,
int /*process_id*/,
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList identities,
@@ -1827,7 +1827,7 @@ namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("app", electron::api::App::Create(isolate));

View File

@@ -152,9 +152,9 @@ namespace {
using electron::api::AutoUpdater;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("autoUpdater", AutoUpdater::Create(isolate));

View File

@@ -1001,7 +1001,7 @@ bool BaseWindow::IsModal() const {
return window_->is_modal();
}
bool BaseWindow::SetThumbarButtons(gin_helper::Arguments* args) {
bool BaseWindow::SetThumbarButtons(gin_helper::Arguments* /*args*/) {
#if BUILDFLAG(IS_WIN)
std::vector<TaskbarHost::ThumbarButton> buttons;
if (!args->GetNext(&buttons)) {
@@ -1353,9 +1353,9 @@ namespace {
using electron::api::BaseWindow;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
BaseWindow::SetConstructor(isolate, base::BindRepeating(&BaseWindow::New));

View File

@@ -325,9 +325,9 @@ namespace {
using electron::api::BrowserWindow;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("BrowserWindow",

View File

@@ -170,9 +170,9 @@ v8::Local<v8::Promise> GetTraceBufferUsage(v8::Isolate* isolate) {
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
gin_helper::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("getCategories", &GetCategories);
dict.SetMethod("startRecording", &StartTracing);

View File

@@ -350,7 +350,7 @@ v8::Local<v8::Promise> Cookies::Remove(v8::Isolate* isolate,
manager->DeleteCookies(
std::move(cookie_deletion_filter),
base::BindOnce(
[](gin_helper::Promise<void> promise, uint32_t num_deleted) {
[](gin_helper::Promise<void> promise, uint32_t /*num_deleted*/) {
gin_helper::Promise<void>::ResolvePromise(std::move(promise));
},
std::move(promise)));

View File

@@ -258,9 +258,9 @@ v8::Local<v8::Value> GetParameters(v8::Isolate* isolate) {
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
gin_helper::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("start", &electron::api::crash_reporter::Start);
#if IS_MAS_BUILD()

View File

@@ -25,7 +25,7 @@ namespace electron::api {
gin::WrapperInfo Debugger::kWrapperInfo = {gin::kEmbedderNativeGin};
Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
Debugger::Debugger(v8::Isolate* /*isolate*/, content::WebContents* web_contents)
: content::WebContentsObserver(web_contents), web_contents_(web_contents) {}
Debugger::~Debugger() = default;
@@ -79,7 +79,7 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
}
}
void Debugger::RenderFrameHostChanged(content::RenderFrameHost* old_rfh,
void Debugger::RenderFrameHostChanged(content::RenderFrameHost* /*old_rfh*/,
content::RenderFrameHost* new_rfh) {
if (agent_host_) {
agent_host_->DisconnectWebContents();

View File

@@ -238,7 +238,8 @@ void DesktopCapturer::DesktopListListener::OnDelegatedSourceListSelection() {
}
}
void DesktopCapturer::DesktopListListener::OnSourceThumbnailChanged(int index) {
void DesktopCapturer::DesktopListListener::OnSourceThumbnailChanged(
int /*index*/) {
if (have_selection_) {
// This is called every time a thumbnail is refreshed. Reset variable to
// ensure that the callback is not run again.
@@ -527,7 +528,7 @@ namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
gin_helper::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("createDesktopCapturer",
&electron::api::DesktopCapturer::Create);

View File

@@ -87,9 +87,9 @@ v8::Local<v8::Promise> ShowSaveDialog(
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.SetMethod("showMessageBoxSync", &ShowMessageBoxSync);

View File

@@ -24,9 +24,9 @@ void SetEventEmitterPrototype(v8::Isolate* isolate,
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin::Dictionary dict(isolate, exports);

View File

@@ -45,7 +45,7 @@ namespace electron::api {
gin::WrapperInfo GlobalShortcut::kWrapperInfo = {gin::kEmbedderNativeGin};
GlobalShortcut::GlobalShortcut(v8::Isolate* isolate) {}
GlobalShortcut::GlobalShortcut(v8::Isolate* /*isolate*/) {}
GlobalShortcut::~GlobalShortcut() {
UnregisterAll();
@@ -177,9 +177,9 @@ const char* GlobalShortcut::GetTypeName() {
namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin::Dictionary dict(isolate, exports);
dict.Set("globalShortcut", electron::api::GlobalShortcut::Create(isolate));

View File

@@ -50,7 +50,7 @@ namespace electron::api {
gin::WrapperInfo Menu::kWrapperInfo = {gin::kEmbedderNativeGin};
Menu::Menu(gin::Arguments* args)
Menu::Menu(gin::Arguments* /*args*/)
: model_(std::make_unique<ElectronMenuModel>(this)) {
model_->AddObserver(this);
@@ -141,7 +141,7 @@ void Menu::ExecuteCommand(int command_id, int flags) {
CreateEventFromFlags(flags), command_id);
}
void Menu::OnMenuWillShow(ui::SimpleMenuModel* source) {
void Menu::OnMenuWillShow(ui::SimpleMenuModel* /*source*/) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope scope(isolate);
gin_helper::CallMethod(isolate, const_cast<Menu*>(this), "_menuWillShow");
@@ -155,7 +155,7 @@ base::OnceClosure Menu::BindSelfToClosure(base::OnceClosure callback) {
if (GetWrapper(isolate).ToLocal(&self)) {
v8::Global<v8::Value> ref(isolate, self);
return base::BindOnce(
[](base::OnceClosure callback, v8::Global<v8::Value> ref) {
[](base::OnceClosure callback, v8::Global<v8::Value> /*ref*/) {
std::move(callback).Run();
},
std::move(callback), std::move(ref));
@@ -315,9 +315,9 @@ namespace {
using electron::api::Menu;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);

View File

@@ -22,7 +22,7 @@ MenuViews::~MenuViews() = default;
void MenuViews::PopupAt(BaseWindow* window,
int x,
int y,
int positioning_item,
int /*positioning_item*/,
ui::mojom::MenuSourceType source_type,
base::OnceClosure callback) {
auto* native_window = static_cast<NativeWindowViews*>(window->window());

View File

@@ -19,7 +19,7 @@ namespace electron::api {
gin::WrapperInfo NativeTheme::kWrapperInfo = {gin::kEmbedderNativeGin};
NativeTheme::NativeTheme(v8::Isolate* isolate,
NativeTheme::NativeTheme(v8::Isolate* /*isolate*/,
ui::NativeTheme* ui_theme,
ui::NativeTheme* web_theme)
: ui_theme_(ui_theme), web_theme_(web_theme) {
@@ -34,7 +34,7 @@ void NativeTheme::OnNativeThemeUpdatedOnUI() {
Emit("updated");
}
void NativeTheme::OnNativeThemeUpdated(ui::NativeTheme* theme) {
void NativeTheme::OnNativeThemeUpdated(ui::NativeTheme* /*theme*/) {
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(&NativeTheme::OnNativeThemeUpdatedOnUI,
base::Unretained(this)));
@@ -127,9 +127,9 @@ namespace {
using electron::api::NativeTheme;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin::Dictionary dict(isolate, exports);
dict.Set("nativeTheme", NativeTheme::Create(isolate));

View File

@@ -243,9 +243,9 @@ namespace {
using electron::api::Notification;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("Notification", Notification::GetConstructor(context));

View File

@@ -62,7 +62,7 @@ namespace electron::api {
gin::WrapperInfo PowerMonitor::kWrapperInfo = {gin::kEmbedderNativeGin};
PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
PowerMonitor::PowerMonitor(v8::Isolate* /*isolate*/) {
#if BUILDFLAG(IS_MAC)
Browser::Get()->SetShutdownHandler(base::BindRepeating(
&PowerMonitor::ShouldShutdown, base::Unretained(this)));
@@ -193,9 +193,9 @@ base::PowerThermalObserver::DeviceThermalState GetCurrentThermalState() {
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.SetMethod("createPowerMonitor",

View File

@@ -43,7 +43,7 @@ namespace electron::api {
gin::WrapperInfo PowerSaveBlocker::kWrapperInfo = {gin::kEmbedderNativeGin};
PowerSaveBlocker::PowerSaveBlocker(v8::Isolate* isolate)
PowerSaveBlocker::PowerSaveBlocker(v8::Isolate* /*isolate*/)
: current_lock_type_(device::mojom::WakeLockType::kPreventAppSuspension) {}
PowerSaveBlocker::~PowerSaveBlocker() = default;
@@ -135,9 +135,9 @@ const char* PowerSaveBlocker::GetTypeName() {
namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin::Dictionary dict(isolate, exports);
dict.Set("powerSaveBlocker",

View File

@@ -77,9 +77,9 @@ using electron::api::GetPrinterListAsync;
#endif
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
#if BUILDFLAG(ENABLE_PRINTING)

View File

@@ -364,7 +364,7 @@ void RegisterSchemesAsPrivileged(gin_helper::ErrorThrower thrower,
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("Protocol", electron::api::Protocol::GetConstructor(context));

View File

@@ -57,9 +57,9 @@ const char* PushNotifications::GetTypeName() {
namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin::Dictionary dict(isolate, exports);
dict.Set("pushNotifications",

View File

@@ -128,9 +128,9 @@ std::string DecryptString(v8::Isolate* isolate, v8::Local<v8::Value> buffer) {
} // namespace
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.SetMethod("decryptString", &DecryptString);

View File

@@ -64,7 +64,7 @@ void DelayEmitWithMetrics(Screen* screen,
} // namespace
Screen::Screen(v8::Isolate* isolate, display::Screen* screen)
Screen::Screen(v8::Isolate* /*isolate*/, display::Screen* screen)
: screen_(screen) {
screen_->AddObserver(this);
}
@@ -173,9 +173,9 @@ namespace {
using electron::api::Screen;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.SetMethod("createScreen", base::BindRepeating(&Screen::Create));

View File

@@ -83,7 +83,7 @@ ServiceWorkerContext::~ServiceWorkerContext() {
void ServiceWorkerContext::OnReportConsoleMessage(
int64_t version_id,
const GURL& scope,
const GURL& /*scope*/,
const content::ConsoleMessage& message) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);

View File

@@ -590,7 +590,7 @@ Session::~Session() {
#endif
}
void Session::OnDownloadCreated(content::DownloadManager* manager,
void Session::OnDownloadCreated(content::DownloadManager* /*manager*/,
download::DownloadItem* item) {
if (item->IsSavePackageDownload())
return;
@@ -1329,18 +1329,19 @@ v8::Local<v8::Value> Session::GetAllExtensions() {
return gin::ConvertToV8(isolate_, extensions_vector);
}
void Session::OnExtensionLoaded(content::BrowserContext* browser_context,
void Session::OnExtensionLoaded(content::BrowserContext* /*browser_context*/,
const extensions::Extension* extension) {
Emit("extension-loaded", extension);
}
void Session::OnExtensionUnloaded(content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UnloadedExtensionReason reason) {
void Session::OnExtensionUnloaded(
content::BrowserContext* /*browser_context*/,
const extensions::Extension* extension,
extensions::UnloadedExtensionReason /*reason*/) {
Emit("extension-unloaded", extension);
}
void Session::OnExtensionReady(content::BrowserContext* browser_context,
void Session::OnExtensionReady(content::BrowserContext* /*browser_context*/,
const extensions::Extension* extension) {
Emit("extension-ready", extension);
}
@@ -1890,7 +1891,7 @@ v8::Local<v8::Value> FromPath(const base::FilePath& path,
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("Session", Session::GetConstructor(context));

View File

@@ -113,9 +113,9 @@ namespace {
using electron::api::SystemPreferences;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("systemPreferences", SystemPreferences::Create(isolate));

View File

@@ -232,9 +232,9 @@ void Tray::SetToolTip(const std::string& tool_tip) {
tray_icon_->SetToolTip(tool_tip);
}
void Tray::SetTitle(const std::string& title,
const std::optional<gin_helper::Dictionary>& options,
gin::Arguments* args) {
void Tray::SetTitle(const std::string& /*title*/,
const std::optional<gin_helper::Dictionary>& /*options*/,
gin::Arguments* /*args*/) {
if (!CheckAlive())
return;
#if BUILDFLAG(IS_MAC)
@@ -272,7 +272,7 @@ std::string Tray::GetTitle() {
#endif
}
void Tray::SetIgnoreDoubleClickEvents(bool ignore) {
void Tray::SetIgnoreDoubleClickEvents(bool /*ignore*/) {
if (!CheckAlive())
return;
#if BUILDFLAG(IS_MAC)
@@ -438,9 +438,9 @@ namespace {
using electron::api::Tray;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin::Dictionary dict(isolate, exports);

View File

@@ -67,7 +67,7 @@ UtilityProcessWrapper::UtilityProcessWrapper(
std::map<IOHandle, IOType> stdio,
base::EnvironmentMap env_map,
base::FilePath current_working_directory,
bool use_plugin_helper,
bool /*use_plugin_helper*/,
bool create_network_observer) {
#if BUILDFLAG(IS_WIN)
base::win::ScopedHandle stdout_write(nullptr);
@@ -498,7 +498,7 @@ namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.SetMethod("_fork", &electron::api::UtilityProcessWrapper::Create);

View File

@@ -387,7 +387,7 @@ void View::SetVisible(bool visible) {
view_->SetVisible(visible);
}
void View::OnViewBoundsChanged(views::View* observed_view) {
void View::OnViewBoundsChanged(views::View* /*observed_view*/) {
ApplyBorderRadius();
Emit("bounds-changed");
}
@@ -455,9 +455,9 @@ namespace {
using electron::api::View;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);

View File

@@ -870,7 +870,7 @@ void WebContents::InitZoomController(content::WebContents* web_contents,
}
void WebContents::InitWithSessionAndOptions(
v8::Isolate* isolate,
v8::Isolate* /*isolate*/,
std::unique_ptr<content::WebContents> owned_web_contents,
gin::Handle<api::Session> session,
const gin_helper::Dictionary& options) {
@@ -1078,7 +1078,7 @@ void WebContents::OnDidAddMessageToConsole(
const std::u16string& message,
int32_t line_no,
const std::u16string& source_id,
const std::optional<std::u16string>& untrusted_stack_trace) {
const std::optional<std::u16string>& /*untrusted_stack_trace*/) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);
@@ -1111,9 +1111,9 @@ void WebContents::OnCreateWindow(
}
void WebContents::WebContentsCreatedWithFullParams(
content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
content::WebContents* /*source_contents*/,
int /*opener_render_process_id*/,
int /*opener_render_frame_id*/,
const content::mojom::CreateNewWindowParams& params,
content::WebContents* new_contents) {
ChildWebContentsTracker::CreateForWebContents(new_contents);
@@ -1140,9 +1140,9 @@ void WebContents::WebContentsCreatedWithFullParams(
}
bool WebContents::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
content::SiteInstance* /*source_site_instance*/,
content::mojom::WindowContainerType /*window_container_type*/,
const GURL& /*opener_url*/,
const content::mojom::CreateNewWindowParams& params) {
bool default_prevented = Emit(
"-will-add-new-contents", params.target_url, params.frame_name,
@@ -1163,25 +1163,25 @@ void WebContents::SetNextChildWebPreferences(
}
content::WebContents* WebContents::CreateCustomWebContents(
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
bool is_new_browsing_instance,
const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const content::StoragePartitionConfig& partition_config,
content::SessionStorageNamespace* session_storage_namespace) {
content::RenderFrameHost* /*opener*/,
content::SiteInstance* /*source_site_instance*/,
bool /*is_new_browsing_instance*/,
const GURL& /*opener_url*/,
const std::string& /*frame_name*/,
const GURL& /*target_url*/,
const content::StoragePartitionConfig& /*partition_config*/,
content::SessionStorageNamespace* /*session_storage_namespace*/) {
return nullptr;
}
content::WebContents* WebContents::AddNewContents(
content::WebContents* source,
content::WebContents* /*source*/,
std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url,
const GURL& /*target_url*/,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) {
bool* /*was_blocked*/) {
auto* tracker = ChildWebContentsTracker::FromWebContents(new_contents.get());
DCHECK(tracker);
@@ -1253,7 +1253,7 @@ content::WebContents* WebContents::OpenURLFromTab(
return source;
}
void WebContents::BeforeUnloadFired(content::WebContents* tab,
void WebContents::BeforeUnloadFired(content::WebContents* /*tab*/,
bool proceed,
bool* proceed_to_fire_unload) {
// Note that Chromium does not emit this for navigations.
@@ -1270,7 +1270,7 @@ void WebContents::SetContentsBounds(content::WebContents* source,
observer.OnSetContentBounds(rect);
}
void WebContents::CloseContents(content::WebContents* source) {
void WebContents::CloseContents(content::WebContents* /*source*/) {
Emit("close");
auto* autofill_driver_factory =
@@ -1287,7 +1287,7 @@ void WebContents::ActivateContents(content::WebContents* source) {
observer.OnActivateContents();
}
void WebContents::UpdateTargetURL(content::WebContents* source,
void WebContents::UpdateTargetURL(content::WebContents* /*source*/,
const GURL& url) {
Emit("update-target-url", url);
}
@@ -1326,7 +1326,7 @@ bool WebContents::PlatformHandleKeyboardEvent(
#endif
content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
content::WebContents* source,
content::WebContents* /*source*/,
const input::NativeWebKeyboardEvent& event) {
if (exclusive_access_manager_.HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED;
@@ -1443,7 +1443,7 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) {
void WebContents::RendererUnresponsive(
content::WebContents* source,
content::RenderWidgetHost* render_widget_host,
base::RepeatingClosure hang_monitor_restarter) {
base::RepeatingClosure /*hang_monitor_restarter*/) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);
gin::Handle<gin_helper::internal::Event> event =
@@ -1466,8 +1466,8 @@ void WebContents::RendererUnresponsive(
}
void WebContents::RendererResponsive(
content::WebContents* source,
content::RenderWidgetHost* render_widget_host) {
content::WebContents* /*source*/,
content::RenderWidgetHost* /*render_widget_host*/) {
Emit("responsive");
}
@@ -1511,7 +1511,7 @@ void WebContents::OnGetPlatformSuggestionsComplete(
}
#endif
void WebContents::FindReply(content::WebContents* web_contents,
void WebContents::FindReply(content::WebContents* /*web_contents*/,
int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,
@@ -1806,7 +1806,7 @@ void WebContents::PrimaryMainFrameRenderProcessGone(
}
void WebContents::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
base::ProcessId /*plugin_pid*/) {
#if BUILDFLAG(ENABLE_PLUGINS)
content::WebPluginInfo info;
auto* plugin_service = content::PluginService::GetInstance();
@@ -1815,15 +1815,15 @@ void WebContents::PluginCrashed(const base::FilePath& plugin_path,
#endif // BUILDFLAG(ENABLE_PLUGINS)
}
void WebContents::MediaStartedPlaying(const MediaPlayerInfo& video_type,
const content::MediaPlayerId& id) {
void WebContents::MediaStartedPlaying(const MediaPlayerInfo& /*video_type*/,
const content::MediaPlayerId& /*id*/) {
Emit("media-started-playing");
}
void WebContents::MediaStoppedPlaying(
const MediaPlayerInfo& video_type,
const content::MediaPlayerId& id,
content::WebContentsObserver::MediaStoppedReason reason) {
const MediaPlayerInfo& /*video_type*/,
const content::MediaPlayerId& /*id*/,
content::WebContentsObserver::MediaStoppedReason /*reason*/) {
Emit("media-paused");
}
@@ -1841,12 +1841,12 @@ void WebContents::DidAcquireFullscreen(content::RenderFrameHost* rfh) {
}
void WebContents::OnWebContentsFocused(
content::RenderWidgetHost* render_widget_host) {
content::RenderWidgetHost* /*render_widget_host*/) {
Emit("focus");
}
void WebContents::OnWebContentsLostFocus(
content::RenderWidgetHost* render_widget_host) {
content::RenderWidgetHost* /*render_widget_host*/) {
Emit("blur");
}
@@ -1861,7 +1861,7 @@ void WebContents::DOMContentLoaded(
}
void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) {
const GURL& /*validated_url*/) {
bool is_main_frame = !render_frame_host->GetParent();
int32_t frame_process_id =
render_frame_host->GetProcess()->GetID().GetUnsafeValue();
@@ -2110,7 +2110,7 @@ void WebContents::MessageHost(const std::string& channel,
void WebContents::DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) {
content::WebContents* /*contents*/) {
if (owner_window() && owner_window()->has_frame()) {
return;
}
@@ -2244,7 +2244,7 @@ void WebContents::TitleWasSet(content::NavigationEntry* entry) {
}
void WebContents::DidUpdateFaviconURL(
content::RenderFrameHost* render_frame_host,
content::RenderFrameHost* /*render_frame_host*/,
const std::vector<blink::mojom::FaviconURLPtr>& urls) {
std::set<GURL> unique_urls;
for (const auto& iter : urls) {
@@ -3891,7 +3891,7 @@ void WebContents::PDFReadyToPrint() {
Emit("-pdf-ready-to-print");
}
void WebContents::OnInputEvent(const content::RenderWidgetHost& rfh,
void WebContents::OnInputEvent(const content::RenderWidgetHost& /*rfh*/,
const blink::WebInputEvent& event) {
Emit("input-event", event);
}
@@ -3902,7 +3902,7 @@ void WebContents::RunJavaScriptDialog(content::WebContents* web_contents,
const std::u16string& message_text,
const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
bool* /*did_suppress_message*/) {
CHECK_EQ(web_contents, this->web_contents());
auto* isolate = JavascriptEnvironment::GetIsolate();
@@ -3917,16 +3917,16 @@ void WebContents::RunJavaScriptDialog(content::WebContents* web_contents,
EmitWithoutEvent("-run-dialog", info, std::move(callback));
}
void WebContents::RunBeforeUnloadDialog(content::WebContents* web_contents,
content::RenderFrameHost* rfh,
bool is_reload,
void WebContents::RunBeforeUnloadDialog(content::WebContents* /*web_contents*/,
content::RenderFrameHost* /*rfh*/,
bool /*is_reload*/,
DialogClosedCallback callback) {
// TODO: asyncify?
bool default_prevented = Emit("will-prevent-unload");
std::move(callback).Run(default_prevented, std::u16string());
}
void WebContents::CancelDialogs(content::WebContents* web_contents,
void WebContents::CancelDialogs(content::WebContents* /*web_contents*/,
bool reset_state) {
auto* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope scope(isolate);
@@ -4001,7 +4001,7 @@ v8::Local<v8::Promise> WebContents::TakeHeapSnapshot(
(*raw_ptr)->TakeHeapSnapshot(
mojo::WrapPlatformFile(base::ScopedPlatformFile(file.TakePlatformFile())),
base::BindOnce(
[](mojo::Remote<mojom::ElectronRenderer>* ep,
[](mojo::Remote<mojom::ElectronRenderer>* /*ep*/,
gin_helper::Promise<void> promise, bool success) {
if (success) {
promise.Resolve();
@@ -4013,7 +4013,7 @@ v8::Local<v8::Promise> WebContents::TakeHeapSnapshot(
return handle;
}
void WebContents::UpdatePreferredSize(content::WebContents* web_contents,
void WebContents::UpdatePreferredSize(content::WebContents* /*web_contents*/,
const gfx::Size& pref_size) {
Emit("preferred-size-changed", pref_size);
}
@@ -4044,7 +4044,7 @@ void WebContents::EnumerateDirectory(
}
bool WebContents::IsFullscreenForTabOrPending(
const content::WebContents* source) {
const content::WebContents* /*source*/) {
if (!owner_window())
return is_html_fullscreen();
@@ -4726,7 +4726,7 @@ std::vector<gin::Handle<WebContents>> GetAllWebContentsAsV8(
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("WebContents", WebContents::GetConstructor(context));

View File

@@ -228,7 +228,7 @@ using electron::api::WebContentsView;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("WebContentsView", WebContentsView::GetConstructor(isolate));

View File

@@ -491,7 +491,7 @@ void WebFrameMain::DOMContentLoaded() {
}
// static
gin::Handle<WebFrameMain> WebFrameMain::New(v8::Isolate* isolate) {
gin::Handle<WebFrameMain> WebFrameMain::New(v8::Isolate* /*isolate*/) {
return {};
}
@@ -595,9 +595,9 @@ v8::Local<v8::Value> FromFtnIdIfExists(gin_helper::ErrorThrower thrower,
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("WebFrameMain", WebFrameMain::GetConstructor(context));

View File

@@ -480,7 +480,7 @@ int WebRequest::OnHeadersReceived(
net::CompletionOnceCallback callback,
const net::HttpResponseHeaders* original_response_headers,
scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
GURL* allowed_unsafe_redirect_url) {
GURL* /*allowed_unsafe_redirect_url*/) {
return HandleOnHeadersReceivedResponseEvent(
info, request, std::move(callback), original_response_headers,
override_response_headers);

View File

@@ -39,7 +39,7 @@ void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
gin_helper::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("addGuest", &AddGuest);
dict.SetMethod("removeGuest", &RemoveGuest);

View File

@@ -135,7 +135,7 @@ void FrameSubscriber::OnFrameCaptured(
pixels,
media::VideoFrame::RowBytes(media::VideoFrame::Plane::kARGB,
info->pixel_format, info->coded_size.width()),
[](void* addr, void* context) {
[](void* /*addr*/, void* context) {
delete static_cast<FramePinner*>(context);
},
new FramePinner{std::move(mapping), std::move(callbacks_remote)});

View File

@@ -325,9 +325,9 @@ v8::Local<v8::Value> CreatePair(v8::Isolate* isolate) {
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.SetMethod("createPair", &CreatePair);

View File

@@ -18,7 +18,7 @@ SavePageHandler::SavePageHandler(content::WebContents* web_contents,
SavePageHandler::~SavePageHandler() = default;
void SavePageHandler::OnDownloadCreated(content::DownloadManager* manager,
void SavePageHandler::OnDownloadCreated(content::DownloadManager* /*manager*/,
download::DownloadItem* item) {
// OnDownloadCreated is invoked during WebContents::SavePage, so the |item|
// here is the one stated by WebContents::SavePage.

View File

@@ -46,9 +46,9 @@ namespace {
using electron::api::ImageView;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Value> /*unused*/,
v8::Local<v8::Context> context,
void* priv) {
void* /*priv*/) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("ImageView", gin_helper::CreateConstructor<ImageView>(

View File

@@ -30,8 +30,9 @@ void AutoUpdater::CheckForUpdates() {}
void AutoUpdater::QuitAndInstall() {}
bool AutoUpdater::IsVersionAllowedForUpdate(const std::string& current_version,
const std::string& target_version) {
bool AutoUpdater::IsVersionAllowedForUpdate(
const std::string& /*current_version*/,
const std::string& /*target_version*/) {
return false;
}
#endif

View File

@@ -32,7 +32,7 @@ BadgeManagerFactory::~BadgeManagerFactory() = default;
std::unique_ptr<KeyedService>
BadgeManagerFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
content::BrowserContext* /*context*/) const {
return std::make_unique<BadgeManager>();
}

View File

@@ -67,94 +67,94 @@ ElectronBluetoothDelegate::RunBluetoothChooser(
// The following methods are not currently called in Electron.
std::unique_ptr<content::BluetoothScanningPrompt>
ElectronBluetoothDelegate::ShowBluetoothScanningPrompt(
content::RenderFrameHost* frame,
const content::BluetoothScanningPrompt::EventHandler& event_handler) {
content::RenderFrameHost* /*frame*/,
const content::BluetoothScanningPrompt::EventHandler& /*event_handler*/) {
NOTIMPLEMENTED();
return nullptr;
}
WebBluetoothDeviceId ElectronBluetoothDelegate::GetWebBluetoothDeviceId(
RenderFrameHost* frame,
const std::string& device_address) {
RenderFrameHost* /*frame*/,
const std::string& /*device_address*/) {
NOTIMPLEMENTED();
return WebBluetoothDeviceId::Create();
}
std::string ElectronBluetoothDelegate::GetDeviceAddress(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
RenderFrameHost* /*frame*/,
const WebBluetoothDeviceId& /*device_id*/) {
NOTIMPLEMENTED();
return "";
}
WebBluetoothDeviceId ElectronBluetoothDelegate::AddScannedDevice(
RenderFrameHost* frame,
const std::string& device_address) {
RenderFrameHost* /*frame*/,
const std::string& /*device_address*/) {
NOTIMPLEMENTED();
return WebBluetoothDeviceId::Create();
}
WebBluetoothDeviceId ElectronBluetoothDelegate::GrantServiceAccessPermission(
RenderFrameHost* frame,
const device::BluetoothDevice* device,
const blink::mojom::WebBluetoothRequestDeviceOptions* options) {
RenderFrameHost* /*frame*/,
const device::BluetoothDevice* /*device*/,
const blink::mojom::WebBluetoothRequestDeviceOptions* /*options*/) {
NOTIMPLEMENTED();
return WebBluetoothDeviceId::Create();
}
bool ElectronBluetoothDelegate::HasDevicePermission(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
RenderFrameHost* /*frame*/,
const WebBluetoothDeviceId& /*device_id*/) {
NOTIMPLEMENTED();
return true;
}
void ElectronBluetoothDelegate::RevokeDevicePermissionWebInitiated(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
RenderFrameHost* /*frame*/,
const WebBluetoothDeviceId& /*device_id*/) {
NOTIMPLEMENTED();
}
bool ElectronBluetoothDelegate::MayUseBluetooth(RenderFrameHost* frame) {
bool ElectronBluetoothDelegate::MayUseBluetooth(RenderFrameHost* /*frame*/) {
return true;
}
bool ElectronBluetoothDelegate::IsAllowedToAccessService(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id,
const BluetoothUUID& service) {
RenderFrameHost* /*frame*/,
const WebBluetoothDeviceId& /*device_id*/,
const BluetoothUUID& /*service*/) {
NOTIMPLEMENTED();
return true;
}
bool ElectronBluetoothDelegate::IsAllowedToAccessAtLeastOneService(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
RenderFrameHost* /*frame*/,
const WebBluetoothDeviceId& /*device_id*/) {
NOTIMPLEMENTED();
return true;
}
bool ElectronBluetoothDelegate::IsAllowedToAccessManufacturerData(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id,
uint16_t manufacturer_code) {
RenderFrameHost* /*frame*/,
const WebBluetoothDeviceId& /*device_id*/,
uint16_t /*manufacturer_code*/) {
NOTIMPLEMENTED();
return true;
}
void ElectronBluetoothDelegate::AddFramePermissionObserver(
FramePermissionObserver* observer) {
FramePermissionObserver* /*observer*/) {
NOTIMPLEMENTED();
}
void ElectronBluetoothDelegate::RemoveFramePermissionObserver(
FramePermissionObserver* observer) {
FramePermissionObserver* /*observer*/) {
NOTIMPLEMENTED();
}
std::vector<blink::mojom::WebBluetoothDevicePtr>
ElectronBluetoothDelegate::GetPermittedDevices(
content::RenderFrameHost* frame) {
content::RenderFrameHost* /*frame*/) {
std::vector<blink::mojom::WebBluetoothDevicePtr> permitted_devices;
NOTIMPLEMENTED();
return permitted_devices;

View File

@@ -263,7 +263,7 @@ bool Browser::HandleBeforeQuit() {
return !prevent_default;
}
void Browser::OnWindowCloseCancelled(NativeWindow* window) {
void Browser::OnWindowCloseCancelled(NativeWindow* /*window*/) {
if (is_quitting_)
// Once a beforeunload handler has prevented the closing, we think the quit
// is cancelled too.

View File

@@ -97,12 +97,12 @@ void Browser::AddRecentDocument(const base::FilePath& path) {}
void Browser::ClearRecentDocuments() {}
bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
gin::Arguments* args) {
gin::Arguments* /*args*/) {
return SetDefaultWebClient(protocol);
}
bool Browser::IsDefaultProtocolClient(const std::string& protocol,
gin::Arguments* args) {
gin::Arguments* /*args*/) {
auto env = base::Environment::Create();
if (protocol.empty())
@@ -120,8 +120,8 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
}
// Todo implement
bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
gin::Arguments* args) {
bool Browser::RemoveAsDefaultProtocolClient(const std::string& /*protocol*/,
gin::Arguments* /*args*/) {
return false;
}
@@ -146,7 +146,7 @@ bool Browser::SetBadgeCount(std::optional<int> count) {
void Browser::SetLoginItemSettings(LoginItemSettings settings) {}
v8::Local<v8::Value> Browser::GetLoginItemSettings(
const LoginItemSettings& options) {
const LoginItemSettings& /*options*/) {
LoginItemSettings settings;
return gin::ConvertToV8(JavascriptEnvironment::GetIsolate(), settings);
}

View File

@@ -23,8 +23,7 @@ namespace {
net::NSSCertDatabase* g_nss_cert_database = nullptr;
net::NSSCertDatabase* GetNSSCertDatabase(
base::OnceCallback<void(net::NSSCertDatabase*)> callback) {
net::NSSCertDatabase* GetNSSCertDatabase() {
// This initialization is not thread safe. This CHECK ensures that this code
// is only run on a single thread.
CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
@@ -152,8 +151,7 @@ void CertificateManagerModel::GetCertDBOnIOThread(CreationCallback callback) {
auto split_callback = base::SplitOnceCallback(base::BindOnce(
&CertificateManagerModel::DidGetCertDBOnIOThread, std::move(callback)));
net::NSSCertDatabase* cert_db =
GetNSSCertDatabase(std::move(split_callback.first));
net::NSSCertDatabase* cert_db = GetNSSCertDatabase();
// If the NSS database was already available, |cert_db| is non-null and
// |did_get_cert_db_callback| has not been called. Call it explicitly.

View File

@@ -308,7 +308,7 @@ const extensions::Extension* GetEnabledExtensionFromEffectiveURL(
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
#if BUILDFLAG(IS_LINUX)
int GetCrashSignalFD(const base::CommandLine& command_line) {
int GetCrashSignalFD() {
int fd;
return crash_reporter::GetHandlerSocket(&fd, nullptr) ? fd : -1;
}
@@ -370,9 +370,9 @@ content::WebContents* ElectronBrowserClient::GetWebContentsFromProcessID(
}
content::SiteInstance* ElectronBrowserClient::GetSiteInstanceFromAffinity(
content::BrowserContext* browser_context,
const GURL& url,
content::RenderFrameHost* rfh) const {
content::BrowserContext* /*browser_context*/,
const GURL& /*url*/,
content::RenderFrameHost* /*rfh*/) const {
return nullptr;
}
@@ -765,8 +765,8 @@ bool ElectronBrowserClient::ShouldUseProcessPerSite(
void ElectronBrowserClient::GetMediaDeviceIDSalt(
content::RenderFrameHost* rfh,
const net::SiteForCookies& site_for_cookies,
const blink::StorageKey& storage_key,
const net::SiteForCookies& /*site_for_cookies*/,
const blink::StorageKey& /*storage_key*/,
base::OnceCallback<void(bool, const std::string&)> callback) {
constexpr bool persistent_media_device_id_allowed = true;
std::string persistent_media_device_id_salt =
@@ -783,7 +783,7 @@ base::FilePath ElectronBrowserClient::GetLoggingFileName(
std::unique_ptr<net::ClientCertStore>
ElectronBrowserClient::CreateClientCertStore(
content::BrowserContext* browser_context) {
content::BrowserContext* /*browser_context*/) {
#if BUILDFLAG(USE_NSS_CERTS)
return std::make_unique<net::ClientCertStoreNSS>(
base::BindRepeating([](const net::HostPortPair& server) {
@@ -811,8 +811,8 @@ ElectronBrowserClient::OverrideSystemLocationProvider() {
void ElectronBrowserClient::ConfigureNetworkContextParams(
content::BrowserContext* browser_context,
bool in_memory,
const base::FilePath& relative_partition_path,
bool /*in_memory*/,
const base::FilePath& /*relative_partition_path*/,
network::mojom::NetworkContextParams* network_context_params,
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) {
@@ -870,7 +870,7 @@ void ElectronBrowserClient::RenderProcessReady(
void ElectronBrowserClient::RenderProcessExited(
content::RenderProcessHost* host,
const content::ChildProcessTerminationInfo& info) {
const content::ChildProcessTerminationInfo& /*info*/) {
if (delegate_) {
static_cast<api::App*>(delegate_)->RenderProcessExited(host);
}
@@ -920,16 +920,16 @@ bool ElectronBrowserClient::HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
content::FrameTreeNodeId frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
content::NavigationUIData* /*navigation_data*/,
bool /*is_primary_main_frame*/,
bool /*is_in_fenced_frame_tree*/,
network::mojom::WebSandboxFlags /*sandbox_flags*/,
ui::PageTransition /*page_transition*/,
bool has_user_gesture,
const std::optional<url::Origin>& initiating_origin,
const std::optional<url::Origin>& /*initiating_origin*/,
content::RenderFrameHost* initiator_document,
const net::IsolationInfo& isolation_info,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
const net::IsolationInfo& /*isolation_info*/,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* /*out_factory*/) {
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(&HandleExternalProtocolInUI, url,
@@ -1097,11 +1097,11 @@ class FileURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
// network::mojom::URLLoaderFactory:
void CreateLoaderAndStart(
mojo::PendingReceiver<network::mojom::URLLoader> loader,
int32_t request_id,
uint32_t options,
int32_t /*request_id*/,
uint32_t /*options*/,
const network::ResourceRequest& request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation)
const net::MutableNetworkTrafficAnnotationTag& /*traffic_annotation*/)
override {
if (!content::ChildProcessSecurityPolicy::GetInstance()->CanRequestURL(
child_id_, request.url)) {
@@ -1125,7 +1125,7 @@ class FileURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
void ElectronBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const std::optional<url::Origin>& request_initiator_origin,
const std::optional<url::Origin>& /*request_initiator_origin*/,
NonNetworkURLLoaderFactoryMap* factories) {
auto* render_process_host =
content::RenderProcessHost::FromID(render_process_id);
@@ -1297,16 +1297,16 @@ void ElectronBrowserClient::WillCreateURLLoaderFactory(
content::RenderFrameHost* frame_host,
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
const url::Origin& /*request_initiator*/,
const net::IsolationInfo& /*isolation_info*/,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
bool* bypass_redirect_checks,
bool* disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr* factory_override,
bool* /*disable_secure_dns*/,
network::mojom::URLLoaderFactoryOverridePtr* /*factory_override*/,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope scope(isolate);
@@ -1363,11 +1363,12 @@ void ElectronBrowserClient::WillCreateURLLoaderFactory(
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
ElectronBrowserClient::WillCreateURLLoaderRequestInterceptors(
content::NavigationUIData* navigation_ui_data,
content::NavigationUIData* /*navigation_ui_data*/,
content::FrameTreeNodeId frame_tree_node_id,
int64_t navigation_id,
bool force_no_https_upgrade,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) {
int64_t /*navigation_id*/,
bool /*force_no_https_upgrade*/,
scoped_refptr<
base::SequencedTaskRunner> /*navigation_response_task_runner*/) {
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
interceptors;
#if BUILDFLAG(ENABLE_PDF_VIEWER)
@@ -1638,9 +1639,9 @@ void ElectronBrowserClient::RegisterBrowserInterfaceBindersForFrame(
#if BUILDFLAG(IS_LINUX)
void ElectronBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
int /*child_process_id*/,
content::PosixFileDescriptorInfo* mappings) {
int crash_signal_fd = GetCrashSignalFD(command_line);
int crash_signal_fd = GetCrashSignalFD();
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);
}
@@ -1651,14 +1652,14 @@ std::unique_ptr<content::LoginDelegate>
ElectronBrowserClient::CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
content::BrowserContext* browser_context,
const content::GlobalRequestID& request_id,
content::BrowserContext* /*browser_context*/,
const content::GlobalRequestID& /*request_id*/,
bool is_request_for_primary_main_frame,
bool is_request_for_navigation,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
content::GuestPageHolder* guest_page_holder,
content::GuestPageHolder* /*guest_page_holder*/,
LoginAuthRequiredCallback auth_required_callback) {
return std::make_unique<LoginHandler>(
auth_info, web_contents, is_request_for_primary_main_frame,
@@ -1669,9 +1670,9 @@ ElectronBrowserClient::CreateLoginDelegate(
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
ElectronBrowserClient::CreateURLLoaderThrottles(
const network::ResourceRequest& request,
content::BrowserContext* browser_context,
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data,
content::BrowserContext* /*browser_context*/,
const base::RepeatingCallback<content::WebContents*()>& /*wc_getter*/,
content::NavigationUIData* /*navigation_ui_data*/,
content::FrameTreeNodeId frame_tree_node_id,
std::optional<int64_t> navigation_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1738,8 +1739,9 @@ void BindBadgeServiceForServiceWorker(
} // namespace
void ElectronBrowserClient::RegisterBrowserInterfaceBindersForServiceWorker(
content::BrowserContext* browser_context,
const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
content::BrowserContext* /*browser_context*/,
const content::
ServiceWorkerVersionBaseInfo& /*service_worker_version_info*/,
mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
map) {
map->Add<blink::mojom::BadgeService>(

View File

@@ -161,9 +161,7 @@ media::mojom::CaptureHandlePtr CreateCaptureHandle(
}
// Copied from chrome/browser/media/webrtc/desktop_capture_devices_util.cc.
std::optional<int> GetZoomLevel(content::WebContents* capturer,
const url::Origin& capturer_origin,
const content::DesktopMediaID& captured_id) {
std::optional<int> GetZoomLevel(const content::DesktopMediaID& captured_id) {
content::RenderFrameHost* const captured_rfh =
content::RenderFrameHost::FromID(
captured_id.web_contents_id.render_process_id,
@@ -218,8 +216,7 @@ DesktopMediaIDToDisplayMediaInformation(
display_surface = media::mojom::DisplayCaptureSurfaceType::BROWSER;
cursor = media::mojom::CursorCaptureType::MOTION;
capture_handle = CreateCaptureHandle(capturer, capturer_origin, media_id);
zoom_level =
GetZoomLevel(capturer, capturer_origin, media_id).value_or(100);
zoom_level = GetZoomLevel(media_id).value_or(100);
break;
case content::DesktopMediaID::TYPE_NONE:
break;

View File

@@ -136,10 +136,10 @@ class LinuxUiGetterImpl : public ui::LinuxUiGetter {
~LinuxUiGetterImpl() override = default;
// ui::LinuxUiGetter
ui::LinuxUiTheme* GetForWindow(aura::Window* window) override {
ui::LinuxUiTheme* GetForWindow(aura::Window* /*window*/) override {
return GetForProfile(nullptr);
}
ui::LinuxUiTheme* GetForProfile(Profile* profile) override {
ui::LinuxUiTheme* GetForProfile(Profile* /*profile*/) override {
return ui::GetLinuxUiTheme(ui::SystemTheme::kGtk);
}
};

View File

@@ -376,7 +376,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
}
bool ElectronDownloadManagerDelegate::ShouldOpenDownload(
download::DownloadItem* download,
download::DownloadItem* /*download*/,
content::DownloadOpenDelayedCallback callback) {
return true;
}

View File

@@ -397,7 +397,7 @@ ElectronPermissionManager::GetPermissionStatusForCurrentDocument(
blink::mojom::PermissionStatus
ElectronPermissionManager::GetPermissionStatusForWorker(
blink::PermissionType permission,
content::RenderProcessHost* render_process_host,
content::RenderProcessHost* /*render_process_host*/,
const GURL& worker_origin) {
return GetPermissionStatus(permission, worker_origin, worker_origin);
}

View File

@@ -17,7 +17,7 @@ ElectronSpeechRecognitionManagerDelegate::
~ElectronSpeechRecognitionManagerDelegate() = default;
void ElectronSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id,
int /*session_id*/,
base::OnceCallback<void(bool ask_user, bool is_allowed)> callback) {
std::move(callback).Run(true, true);
}

View File

@@ -23,7 +23,7 @@ ElectronWebUIControllerFactory::ElectronWebUIControllerFactory() = default;
ElectronWebUIControllerFactory::~ElectronWebUIControllerFactory() = default;
content::WebUI::TypeID ElectronWebUIControllerFactory::GetWebUIType(
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
const GURL& url) {
if (const std::string_view host = url.host_piece();
host == chrome::kChromeUIDevToolsHost ||

View File

@@ -77,7 +77,7 @@ ElectronManagementAPIDelegate::~ElectronManagementAPIDelegate() = default;
bool ElectronManagementAPIDelegate::LaunchAppFunctionDelegate(
const extensions::Extension* extension,
content::BrowserContext* context) const {
content::BrowserContext* /*context*/) const {
// Note: Chromium looks for an existing profile and determines whether
// the user has set a launch preference
// See: https://chromium-review.googlesource.com/c/chromium/src/+/4389621
@@ -94,8 +94,8 @@ GURL ElectronManagementAPIDelegate::GetFullLaunchURL(
}
extensions::LaunchType ElectronManagementAPIDelegate::GetLaunchType(
const extensions::ExtensionPrefs* prefs,
const extensions::Extension* extension) const {
const extensions::ExtensionPrefs* /*prefs*/,
const extensions::Extension* /*extension*/) const {
// TODO(sentialx)
return extensions::LAUNCH_TYPE_DEFAULT;
}
@@ -120,24 +120,24 @@ ElectronManagementAPIDelegate::UninstallFunctionDelegate(
}
bool ElectronManagementAPIDelegate::CreateAppShortcutFunctionDelegate(
extensions::ManagementCreateAppShortcutFunction* function,
const extensions::Extension* extension,
std::string* error) const {
extensions::ManagementCreateAppShortcutFunction* /*function*/,
const extensions::Extension* /*extension*/,
std::string* /*error*/) const {
return false; // TODO(sentialx): route event and return true
}
std::unique_ptr<extensions::AppForLinkDelegate>
ElectronManagementAPIDelegate::GenerateAppForLinkFunctionDelegate(
extensions::ManagementGenerateAppForLinkFunction* function,
content::BrowserContext* context,
const std::string& title,
const GURL& launch_url) const {
extensions::ManagementGenerateAppForLinkFunction* /*function*/,
content::BrowserContext* /*context*/,
const std::string& /*title*/,
const GURL& /*launch_url*/) const {
// TODO(sentialx)
return nullptr;
}
bool ElectronManagementAPIDelegate::CanContextInstallWebApps(
content::BrowserContext* context) const {
content::BrowserContext* /*context*/) const {
// TODO(sentialx)
return false;
}
@@ -178,10 +178,10 @@ void ElectronManagementAPIDelegate::DisableExtension(
}
bool ElectronManagementAPIDelegate::UninstallExtension(
content::BrowserContext* context,
const extensions::ExtensionId& transient_extension_id,
extensions::UninstallReason reason,
std::u16string* error) const {
content::BrowserContext* /*context*/,
const extensions::ExtensionId& /*transient_extension_id*/,
extensions::UninstallReason /*reason*/,
std::u16string* /*error*/) const {
// TODO(sentialx): we don't have ExtensionService
// return extensions::ExtensionSystem::Get(context)
// ->extension_service()
@@ -211,8 +211,8 @@ GURL ElectronManagementAPIDelegate::GetIconURL(
}
GURL ElectronManagementAPIDelegate::GetEffectiveUpdateURL(
const extensions::Extension& extension,
content::BrowserContext* context) const {
const extensions::Extension& /*extension*/,
content::BrowserContext* /*context*/) const {
// TODO(codebytere): we do not currently support ExtensionManagement.
return GURL::EmptyGURL();
}

View File

@@ -34,13 +34,13 @@ void ElectronRuntimeAPIDelegate::ReloadExtension(
}
bool ElectronRuntimeAPIDelegate::CheckForUpdates(
const std::string& extension_id,
const std::string& /*extension_id*/,
UpdateCheckCallback callback) {
LOG(INFO) << "chrome.runtime.requestUpdateCheck is not supported in Electron";
return false;
}
void ElectronRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) {
void ElectronRuntimeAPIDelegate::OpenURL(const GURL& /*uninstall_url*/) {
LOG(INFO) << "chrome.runtime.openURL is not supported in Electron";
}

View File

@@ -383,8 +383,8 @@ bool CollectFramesForInjection(const api::scripting::InjectionTarget& target,
// if the target cannot be accessed, populates `error_out`.
bool CanAccessTarget(const PermissionsData& permissions,
const api::scripting::InjectionTarget& target,
content::BrowserContext* browser_context,
bool include_incognito_information,
content::BrowserContext* /*browser_context*/,
bool /*include_incognito_information*/,
ScriptExecutor** script_executor_out,
ScriptExecutor::FrameScope* frame_scope_out,
std::set<int>* frame_ids_out,
@@ -481,7 +481,7 @@ ConvertRegisteredContentScriptToSerializedUserScript(
}
std::unique_ptr<UserScript> ParseUserScript(
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
const Extension& extension,
bool allowed_in_incognito,
api::scripting::RegisteredContentScript content_script,

View File

@@ -189,7 +189,7 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) {
}
ScriptExecutor* ExecuteCodeInTabFunction::GetScriptExecutor(
std::string* error) {
std::string* /*error*/) {
auto* contents = electron::api::WebContents::FromID(execute_tab_id_);
if (!contents)
return nullptr;
@@ -624,7 +624,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
}
bool TabsUpdateFunction::UpdateURL(const std::string& url_string,
int tab_id,
int /*tab_id*/,
std::string* error) {
auto url =
PrepareURLForNavigation(url_string, extension(), browser_context());

View File

@@ -29,10 +29,10 @@ void ElectronExtensionHostDelegate::OnExtensionHostCreated(
void ElectronExtensionHostDelegate::CreateTab(
std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture) {
const std::string& /*extension_id*/,
WindowOpenDisposition /*disposition*/,
const blink::mojom::WindowFeatures& /*window_features*/,
bool /*user_gesture*/) {
// TODO(jamescook): Should app_shell support opening popup windows?
NOTREACHED();
}
@@ -48,8 +48,8 @@ void ElectronExtensionHostDelegate::ProcessMediaAccessRequest(
}
bool ElectronExtensionHostDelegate::CheckMediaAccessPermission(
content::RenderFrameHost* render_frame_host,
const url::Origin& security_origin,
content::RenderFrameHost* /*render_frame_host*/,
const url::Origin& /*security_origin*/,
blink::mojom::MediaStreamType type,
const Extension* extension) {
media_capture_util::VerifyMediaAccessPermission(type, extension);
@@ -58,7 +58,7 @@ bool ElectronExtensionHostDelegate::CheckMediaAccessPermission(
content::PictureInPictureResult
ElectronExtensionHostDelegate::EnterPictureInPicture(
content::WebContents* web_contents) {
content::WebContents* /*web_contents*/) {
NOTREACHED();
}

View File

@@ -159,7 +159,7 @@ void ElectronExtensionLoader::FinishExtensionLoad(
}
void ElectronExtensionLoader::FinishExtensionReload(
const ExtensionId& old_extension_id,
const ExtensionId& /*old_extension_id*/,
std::pair<scoped_refptr<const Extension>, std::string> result) {
scoped_refptr<const Extension> extension = result.first;
if (extension) {
@@ -197,7 +197,7 @@ void ElectronExtensionLoader::PostDeactivateExtension(
void ElectronExtensionLoader::LoadExtensionForReload(
const ExtensionId& extension_id,
const base::FilePath& path,
LoadErrorBehavior load_error_behavior) {
LoadErrorBehavior /*load_error_behavior*/) {
CHECK(!path.empty());
// TODO(nornagon): we should save whether file access was granted
@@ -211,16 +211,19 @@ void ElectronExtensionLoader::LoadExtensionForReload(
did_schedule_reload_ = true;
}
bool ElectronExtensionLoader::CanEnableExtension(const Extension* extension) {
bool ElectronExtensionLoader::CanEnableExtension(
const Extension* /*extension*/) {
return true;
}
bool ElectronExtensionLoader::CanDisableExtension(const Extension* extension) {
bool ElectronExtensionLoader::CanDisableExtension(
const Extension* /*extension*/) {
// Extensions cannot be disabled by the user.
return false;
}
bool ElectronExtensionLoader::ShouldBlockExtension(const Extension* extension) {
bool ElectronExtensionLoader::ShouldBlockExtension(
const Extension* /*extension*/) {
return false;
}

View File

@@ -72,7 +72,8 @@ void ElectronExtensionSystem::Shutdown() {
extension_loader_.reset();
}
void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
void ElectronExtensionSystem::InitForRegularProfile(
bool /*extensions_enabled*/) {
service_worker_manager_ =
std::make_unique<ServiceWorkerManager>(browser_context_);
quota_service_ = std::make_unique<QuotaService>();
@@ -179,28 +180,28 @@ ContentVerifier* ElectronExtensionSystem::content_verifier() {
}
std::unique_ptr<ExtensionSet> ElectronExtensionSystem::GetDependentExtensions(
const Extension* extension) {
const Extension* /*extension*/) {
return std::make_unique<ExtensionSet>();
}
void ElectronExtensionSystem::InstallUpdate(
const std::string& extension_id,
const std::string& public_key,
const base::FilePath& temp_dir,
bool install_immediately,
const std::string& /*extension_id*/,
const std::string& /*public_key*/,
const base::FilePath& /*temp_dir*/,
bool /*install_immediately*/,
InstallUpdateCallback install_update_callback) {
NOTREACHED();
}
bool ElectronExtensionSystem::FinishDelayedInstallationIfReady(
const std::string& extension_id,
bool install_immediately) {
const std::string& /*extension_id*/,
bool /*install_immediately*/) {
NOTREACHED();
}
void ElectronExtensionSystem::PerformActionBasedOnOmahaAttributes(
const std::string& extension_id,
const base::Value::Dict& attributes) {
const std::string& /*extension_id*/,
const base::Value::Dict& /*attributes*/) {
NOTREACHED();
}

View File

@@ -103,7 +103,7 @@ ElectronExtensionsAPIClient::CreateManagementAPIDelegate() const {
std::unique_ptr<MimeHandlerViewGuestDelegate>
ElectronExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const {
MimeHandlerViewGuest* /*guest*/) const {
return std::make_unique<ElectronMimeHandlerViewGuestDelegate>();
}

View File

@@ -79,8 +79,8 @@ bool ElectronExtensionsBrowserClient::IsShuttingDown() {
}
bool ElectronExtensionsBrowserClient::AreExtensionsDisabled(
const base::CommandLine& command_line,
BrowserContext* context) {
const base::CommandLine& /*command_line*/,
BrowserContext* /*context*/) {
return false;
}
@@ -99,12 +99,12 @@ bool ElectronExtensionsBrowserClient::IsSameContext(BrowserContext* first,
}
bool ElectronExtensionsBrowserClient::HasOffTheRecordContext(
BrowserContext* context) {
BrowserContext* /*context*/) {
return false;
}
BrowserContext* ElectronExtensionsBrowserClient::GetOffTheRecordContext(
BrowserContext* context) {
BrowserContext* /*context*/) {
// app_shell only supports a single context.
return nullptr;
}
@@ -137,24 +137,24 @@ ElectronExtensionsBrowserClient::GetContextForOriginalOnly(
}
bool ElectronExtensionsBrowserClient::AreExtensionsDisabledForContext(
content::BrowserContext* context) {
content::BrowserContext* /*context*/) {
return false;
}
bool ElectronExtensionsBrowserClient::IsGuestSession(
BrowserContext* context) const {
BrowserContext* /*context*/) const {
return false;
}
bool ElectronExtensionsBrowserClient::IsExtensionIncognitoEnabled(
const std::string& extension_id,
content::BrowserContext* context) const {
const std::string& /*extension_id*/,
content::BrowserContext* /*context*/) const {
return false;
}
bool ElectronExtensionsBrowserClient::CanExtensionCrossIncognito(
const extensions::Extension* extension,
content::BrowserContext* context) const {
const extensions::Extension* /*extension*/,
content::BrowserContext* /*context*/) const {
return false;
}
@@ -268,9 +268,9 @@ ElectronExtensionsBrowserClient::GetProcessManagerDelegate() const {
mojo::PendingRemote<network::mojom::URLLoaderFactory>
ElectronExtensionsBrowserClient::GetControlledFrameEmbedderURLLoader(
const url::Origin& app_origin,
const url::Origin& /*app_origin*/,
content::FrameTreeNodeId frame_tree_node_id,
content::BrowserContext* browser_context) {
content::BrowserContext* /*browser_context*/) {
return mojo::PendingRemote<network::mojom::URLLoaderFactory>();
}
@@ -281,7 +281,7 @@ ElectronExtensionsBrowserClient::
}
bool ElectronExtensionsBrowserClient::DidVersionUpdate(
BrowserContext* context) {
BrowserContext* /*context*/) {
// TODO(jamescook): We might want to tell extensions when app_shell updates.
return false;
}
@@ -293,7 +293,7 @@ bool ElectronExtensionsBrowserClient::IsInDemoMode() {
}
bool ElectronExtensionsBrowserClient::IsScreensaverInDemoMode(
const std::string& app_id) {
const std::string& /*app_id*/) {
return false;
}
@@ -302,7 +302,7 @@ bool ElectronExtensionsBrowserClient::IsRunningInForcedAppMode() {
}
bool ElectronExtensionsBrowserClient::IsAppModeForcedForApp(
const extensions::ExtensionId& extension_id) {
const extensions::ExtensionId& /*extension_id*/) {
return false;
}
@@ -361,7 +361,7 @@ bool ElectronExtensionsBrowserClient::IsBackgroundUpdateAllowed() {
}
bool ElectronExtensionsBrowserClient::IsMinBrowserVersionSupported(
const std::string& min_version) {
const std::string& /*min_version*/) {
return true;
}

View File

@@ -11,7 +11,7 @@ ElectronKioskDelegate::ElectronKioskDelegate() = default;
ElectronKioskDelegate::~ElectronKioskDelegate() = default;
bool ElectronKioskDelegate::IsAutoLaunchedKioskApp(
const extensions::ExtensionId& id) const {
const extensions::ExtensionId& /*id*/) const {
return false;
}

View File

@@ -32,8 +32,8 @@ ElectronMessagingDelegate::~ElectronMessagingDelegate() = default;
MessagingDelegate::PolicyPermission
ElectronMessagingDelegate::IsNativeMessagingHostAllowed(
content::BrowserContext* browser_context,
const std::string& native_host_name) {
content::BrowserContext* /*browser_context*/,
const std::string& /*native_host_name*/) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
return PolicyPermission::DISALLOW;
@@ -56,7 +56,7 @@ std::optional<base::Value::Dict> ElectronMessagingDelegate::MaybeGetTabInfo(
}
content::WebContents* ElectronMessagingDelegate::GetWebContentsByTabId(
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
int tab_id) {
auto* contents = electron::api::WebContents::FromID(tab_id);
if (!contents) {
@@ -114,22 +114,22 @@ std::unique_ptr<MessagePort> ElectronMessagingDelegate::CreateReceiverForTab(
std::unique_ptr<MessagePort>
ElectronMessagingDelegate::CreateReceiverForNativeApp(
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate,
content::RenderFrameHost* source,
const std::string& extension_id,
const PortId& receiver_port_id,
const std::string& native_app_name,
bool allow_user_level,
std::string* error_out) {
content::RenderFrameHost* /*source*/,
const std::string& /*extension_id*/,
const PortId& /*receiver_port_id*/,
const std::string& /*native_app_name*/,
bool /*allow_user_level*/,
std::string* /*error_out*/) {
return nullptr;
}
void ElectronMessagingDelegate::QueryIncognitoConnectability(
content::BrowserContext* context,
const Extension* target_extension,
content::WebContents* source_contents,
const GURL& source_url,
const Extension* /*target_extension*/,
content::WebContents* /*source_contents*/,
const GURL& /*source_url*/,
base::OnceCallback<void(bool)> callback) {
DCHECK(context->IsOffTheRecord());
std::move(callback).Run(false);

View File

@@ -18,18 +18,18 @@ ElectronProcessManagerDelegate::ElectronProcessManagerDelegate() = default;
ElectronProcessManagerDelegate::~ElectronProcessManagerDelegate() = default;
bool ElectronProcessManagerDelegate::AreBackgroundPagesAllowedForContext(
content::BrowserContext* context) const {
content::BrowserContext* /*context*/) const {
return true;
}
bool ElectronProcessManagerDelegate::IsExtensionBackgroundPageAllowed(
content::BrowserContext* context,
const Extension& extension) const {
content::BrowserContext* /*context*/,
const Extension& /*extension*/) const {
return true;
}
bool ElectronProcessManagerDelegate::DeferCreatingStartupBackgroundHosts(
content::BrowserContext* context) const {
content::BrowserContext* /*context*/) const {
return false;
}

View File

@@ -76,7 +76,7 @@ FileSelectHelper::~FileSelectHelper() {
}
void FileSelectHelper::FileSelected(const ui::SelectedFileInfo& file,
int index) {
int /*index*/) {
if (!render_frame_host_) {
RunFileChooserEnd();
return;
@@ -488,7 +488,7 @@ void FileSelectHelper::EnumerateDirectoryEnd() {
void FileSelectHelper::RenderFrameHostChanged(
content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) {
content::RenderFrameHost* /*new_host*/) {
// The |old_host| and its children are now pending deletion. Do not give them
// file access past this point.
for (content::RenderFrameHost* host = render_frame_host_; host;

View File

@@ -229,7 +229,7 @@ class FileSystemAccessPermissionContext::PermissionGrantImpl
const content::PathInfo& path_info,
HandleType handle_type,
GrantType type,
UserAction user_action)
UserAction /*user_action*/)
: context_{std::move(context)},
origin_{origin},
handle_type_{handle_type},
@@ -562,26 +562,26 @@ FileSystemAccessPermissionContext::GetWritePermissionGrant(
}
bool FileSystemAccessPermissionContext::IsFileTypeDangerous(
const base::FilePath& path,
const url::Origin& origin) {
const base::FilePath& /*path*/,
const url::Origin& /*origin*/) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return false;
}
base::expected<void, std::string>
FileSystemAccessPermissionContext::CanShowFilePicker(
content::RenderFrameHost* rfh) {
content::RenderFrameHost* /*rfh*/) {
return base::ok();
}
bool FileSystemAccessPermissionContext::CanObtainReadPermission(
const url::Origin& origin) {
const url::Origin& /*origin*/) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return true;
}
bool FileSystemAccessPermissionContext::CanObtainWritePermission(
const url::Origin& origin) {
const url::Origin& /*origin*/) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return true;
}
@@ -631,7 +631,7 @@ void FileSystemAccessPermissionContext::CheckPathAgainstBlocklist(
void FileSystemAccessPermissionContext::PerformAfterWriteChecks(
std::unique_ptr<content::FileSystemAccessWriteItem> item,
content::GlobalRenderFrameHostId frame_id,
content::GlobalRenderFrameHostId /*frame_id*/,
base::OnceCallback<void(AfterWriteCheckResult)> callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
std::move(callback).Run(AfterWriteCheckResult::kAllow);
@@ -657,7 +657,7 @@ void FileSystemAccessPermissionContext::DidCheckPathAgainstBlocklist(
const content::PathInfo& path_info,
HandleType handle_type,
UserAction user_action,
content::GlobalRenderFrameHostId frame_id,
content::GlobalRenderFrameHostId /*frame_id*/,
bool should_block) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -779,7 +779,7 @@ content::PathInfo FileSystemAccessPermissionContext::GetLastPickedDirectory(
base::FilePath FileSystemAccessPermissionContext::GetWellKnownDirectoryPath(
blink::mojom::WellKnownDirectory directory,
const url::Origin& origin) {
const url::Origin& /*origin*/) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
int key = base::PATH_START;
@@ -862,7 +862,7 @@ void FileSystemAccessPermissionContext::OnFileCreatedFromShowSaveFilePicker(
void FileSystemAccessPermissionContext::CheckPathsAgainstEnterprisePolicy(
std::vector<content::PathInfo> entries,
content::GlobalRenderFrameHostId frame_id,
content::GlobalRenderFrameHostId /*frame_id*/,
EntriesAllowedByEnterprisePolicyCallback callback) {
std::move(callback).Run(std::move(entries));
}

View File

@@ -152,7 +152,7 @@ bool ElectronHidDelegate::CanRequestDevicePermission(
bool ElectronHidDelegate::HasDevicePermission(
content::BrowserContext* browser_context,
content::RenderFrameHost* render_frame_host,
content::RenderFrameHost* /*render_frame_host*/,
const url::Origin& origin,
const device::mojom::HidDeviceInfo& device) {
return browser_context && GetChooserContext(browser_context)
@@ -161,7 +161,7 @@ bool ElectronHidDelegate::HasDevicePermission(
void ElectronHidDelegate::RevokeDevicePermission(
content::BrowserContext* browser_context,
content::RenderFrameHost* render_frame_host,
content::RenderFrameHost* /*render_frame_host*/,
const url::Origin& origin,
const device::mojom::HidDeviceInfo& device) {
if (browser_context) {

View File

@@ -102,9 +102,9 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
void BluetoothChooser::AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) {
bool /*is_gatt_connected*/,
bool /*is_paired*/,
int /*signal_strength_level*/) {
if (refreshing_) {
// If the list of bluetooth devices is currently being generated don't fire
// an event

View File

@@ -27,7 +27,7 @@ MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() = default;
const std::optional<blink::MediaStreamDevice>
MediaCaptureDevicesDispatcher::GetPreferredAudioDeviceForBrowserContext(
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
const std::vector<std::string>& eligible_audio_device_ids) const {
auto audio_devices = GetAudioCaptureDevices();
if (!eligible_audio_device_ids.empty()) {
@@ -43,7 +43,7 @@ MediaCaptureDevicesDispatcher::GetPreferredAudioDeviceForBrowserContext(
const std::optional<blink::MediaStreamDevice>
MediaCaptureDevicesDispatcher::GetPreferredVideoDeviceForBrowserContext(
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
const std::vector<std::string>& eligible_video_device_ids) const {
auto video_devices = GetVideoCaptureDevices();
if (!eligible_video_device_ids.empty()) {

3
shell/browser/microtasks_runner.cc Executable file → Normal file
View File

@@ -16,7 +16,8 @@ MicrotasksRunner::MicrotasksRunner(v8::Isolate* isolate) : isolate_(isolate) {}
void MicrotasksRunner::WillProcessTask(const base::PendingTask& pending_task,
bool was_blocked_or_low_priority) {}
void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) {
void MicrotasksRunner::DidProcessTask(
const base::PendingTask& /*pending_task*/) {
// In the browser process we follow Node.js microtask policy of kExplicit
// and let the MicrotaskRunner which is a task observer for chromium UI thread
// scheduler run the microtask checkpoint. This worked fine because Node.js

View File

@@ -453,7 +453,7 @@ void NativeWindow::SetParentWindow(NativeWindow* parent) {
parent_ = parent;
}
bool NativeWindow::AddTabbedWindow(NativeWindow* window) {
bool NativeWindow::AddTabbedWindow(NativeWindow* /*window*/) {
return true; // for non-Mac platforms
}
@@ -461,7 +461,7 @@ std::optional<std::string> NativeWindow::GetTabbingIdentifier() const {
return ""; // for non-Mac platforms
}
void NativeWindow::SetVibrancy(const std::string& type, int duration) {
void NativeWindow::SetVibrancy(const std::string& type, int /*duration*/) {
vibrancy_ = type;
}

View File

@@ -793,7 +793,7 @@ bool NativeWindowViews::IsFullscreen() const {
return widget()->IsFullscreen();
}
void NativeWindowViews::SetBounds(const gfx::Rect& bounds, bool animate) {
void NativeWindowViews::SetBounds(const gfx::Rect& bounds, bool /*animate*/) {
#if BUILDFLAG(IS_WIN)
if (is_moving_ || is_resizing_) {
pending_bounds_change_ = bounds;
@@ -1064,8 +1064,8 @@ bool NativeWindowViews::IsClosable() const {
}
void NativeWindowViews::SetAlwaysOnTop(ui::ZOrderLevel z_order,
const std::string& level,
int relativeLevel) {
const std::string& /*level*/,
int /*relativeLevel*/) {
bool level_changed = z_order != widget()->GetZOrderLevel();
widget()->SetZOrderLevel(z_order);
@@ -1217,7 +1217,7 @@ bool NativeWindowViews::HasShadow() const {
wm::kShadowElevationNone;
}
void NativeWindowViews::SetOpacity(const double opacity) {
void NativeWindowViews::SetOpacity(const double /*opacity*/) {
#if BUILDFLAG(IS_WIN)
const double boundedOpacity = std::clamp(opacity, 0.0, 1.0);
HWND hwnd = GetAcceleratedWidget();
@@ -1238,7 +1238,7 @@ double NativeWindowViews::GetOpacity() const {
return opacity_;
}
void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool /*forward*/) {
#if BUILDFLAG(IS_WIN)
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
if (ignore)
@@ -1421,7 +1421,7 @@ gfx::NativeWindow NativeWindowViews::GetNativeWindow() const {
}
void NativeWindowViews::SetProgressBar(double progress,
NativeWindow::ProgressState state) {
NativeWindow::ProgressState /*state*/) {
#if BUILDFLAG(IS_WIN)
taskbar_host_.SetProgressBar(GetAcceleratedWidget(), progress, state);
#elif BUILDFLAG(IS_LINUX)
@@ -1489,8 +1489,8 @@ void NativeWindowViews::SetBackgroundMaterial(const std::string& material) {
void NativeWindowViews::SetVisibleOnAllWorkspaces(
bool visible,
bool visibleOnFullScreen,
bool skipTransformProcessType) {
bool /*visibleOnFullScreen*/,
bool /*skipTransformProcessType*/) {
widget()->SetVisibleOnAllWorkspaces(visible);
}
@@ -1660,7 +1660,7 @@ void NativeWindowViews::OnWidgetActivationChanged(views::Widget* changed_widget,
}
void NativeWindowViews::OnWidgetBoundsChanged(views::Widget* changed_widget,
const gfx::Rect& bounds) {
const gfx::Rect& /*bounds*/) {
if (changed_widget != widget())
return;
@@ -1691,13 +1691,13 @@ void NativeWindowViews::OnWidgetBoundsChanged(views::Widget* changed_widget,
}
}
void NativeWindowViews::OnWidgetDestroying(views::Widget* widget) {
void NativeWindowViews::OnWidgetDestroying(views::Widget* /*widget*/) {
aura::Window* window = GetNativeWindow();
if (window)
window->RemovePreTargetHandler(this);
}
void NativeWindowViews::OnWidgetDestroyed(views::Widget* changed_widget) {
void NativeWindowViews::OnWidgetDestroyed(views::Widget* /*changed_widget*/) {
widget_destroyed_ = true;
}
@@ -1726,7 +1726,7 @@ views::View* NativeWindowViews::GetContentsView() {
}
bool NativeWindowViews::ShouldDescendIntoChildForEventHandling(
gfx::NativeView child,
gfx::NativeView /*child*/,
const gfx::Point& location) {
return NonClientHitTest(location) == HTNOWHERE;
}

View File

@@ -25,8 +25,8 @@ void CertVerifierClient::Verify(
const net::CertVerifyResult& default_result,
const scoped_refptr<net::X509Certificate>& certificate,
const std::string& hostname,
int flags,
const std::optional<std::string>& ocsp_response,
int /*flags*/,
const std::optional<std::string>& /*ocsp_response*/,
VerifyCallback callback) {
VerifyRequestParams params;
params.hostname = hostname;

View File

@@ -212,7 +212,7 @@ void ElectronURLLoaderFactory::RedirectedRequest::FollowRedirect(
const std::vector<std::string>& removed_headers,
const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers,
const std::optional<GURL>& new_url) {
const std::optional<GURL>& /*new_url*/) {
// Update |request_| with info from the redirect, so that it's accurate
// The following references code in WorkerScriptLoader::FollowRedirect
bool should_clear_upload = false;
@@ -307,7 +307,7 @@ void ElectronURLLoaderFactory::CreateLoaderAndStart(
// static
void ElectronURLLoaderFactory::OnComplete(
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
int32_t request_id,
int32_t /*request_id*/,
const network::URLLoaderCompletionStatus& status) {
if (client.is_valid()) {
mojo::Remote<network::mojom::URLLoaderClient> client_remote(

View File

@@ -46,7 +46,7 @@ NetworkContextService::~NetworkContextService() = default;
void NetworkContextService::ConfigureNetworkContextParams(
network::mojom::NetworkContextParams* network_context_params,
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) {
/*cert_verifier_creation_params*/) {
bool in_memory = browser_context_->IsOffTheRecord();
const base::FilePath& path = browser_context_->GetPath();

View File

@@ -25,7 +25,7 @@ ProxyingWebSocket::ProxyingWebSocket(
bool has_extra_headers,
int process_id,
int render_frame_id,
content::BrowserContext* browser_context,
content::BrowserContext* /*browser_context*/,
uint64_t* request_id_generator)
: web_request_api_(web_request_api),
request_(request),
@@ -209,7 +209,7 @@ void ProxyingWebSocket::OnBeforeSendHeaders(
}
void ProxyingWebSocket::OnHeadersReceived(const std::string& headers,
const net::IPEndPoint& endpoint,
const net::IPEndPoint& /*endpoint*/,
OnHeadersReceivedCallback callback) {
DCHECK(receiver_as_header_client_.is_bound());
@@ -391,7 +391,7 @@ void ProxyingWebSocket::OnAuthRequiredComplete(AuthRequiredResponse rv) {
}
void ProxyingWebSocket::OnHeadersReceivedCompleteForAuth(
const net::AuthChallengeInfo& auth_info,
const net::AuthChallengeInfo& /*auth_info*/,
int rv) {
if (rv != net::OK) {
OnError(rv);

View File

@@ -74,7 +74,7 @@ void ResolveHostFunction::Run() {
}
void ResolveHostFunction::OnComplete(
int result,
int /*result*/,
const net::ResolveErrorInfo& resolve_error_info,
const std::optional<net::AddressList>& resolved_addresses,
const std::optional<net::HostResolverEndpointResults>&

View File

@@ -70,7 +70,7 @@ void ResolveProxyHelper::StartPendingRequest() {
}
void ResolveProxyHelper::OnProxyLookupComplete(
int32_t net_error,
int32_t /*net_error*/,
const std::optional<net::ProxyInfo>& proxy_info) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!pending_requests_.empty());

View File

@@ -70,8 +70,8 @@ URLLoaderNetworkObserver::Bind() {
}
void URLLoaderNetworkObserver::OnAuthRequired(
const std::optional<base::UnguessableToken>& window_id,
int32_t request_id,
const std::optional<base::UnguessableToken>& /*window_id*/,
int32_t /*request_id*/,
const GURL& url,
bool first_auth_attempt,
const net::AuthChallengeInfo& auth_info,
@@ -83,20 +83,20 @@ void URLLoaderNetworkObserver::OnAuthRequired(
}
void URLLoaderNetworkObserver::OnSSLCertificateError(
const GURL& url,
const GURL& /*url*/,
int net_error,
const net::SSLInfo& ssl_info,
bool fatal,
const net::SSLInfo& /*ssl_info*/,
bool /*fatal*/,
OnSSLCertificateErrorCallback response) {
std::move(response).Run(net_error);
}
void URLLoaderNetworkObserver::OnClearSiteData(
const GURL& url,
const std::string& header_value,
int32_t load_flags,
const std::optional<net::CookiePartitionKey>& cookie_partition_key,
bool partitioned_state_allowed_only,
const GURL& /*url*/,
const std::string& /*header_value*/,
int32_t /*load_flags*/,
const std::optional<net::CookiePartitionKey>& /*cookie_partition_key*/,
bool /*partitioned_state_allowed_only*/,
OnClearSiteDataCallback callback) {
std::move(callback).Run();
}
@@ -108,10 +108,10 @@ void URLLoaderNetworkObserver::OnLoadingStateUpdate(
}
void URLLoaderNetworkObserver::OnSharedStorageHeaderReceived(
const url::Origin& request_origin,
const url::Origin& /*request_origin*/,
std::vector<network::mojom::SharedStorageModifierMethodWithOptionsPtr>
methods,
const std::optional<std::string>& with_lock,
const std::optional<std::string>& /*with_lock*/,
OnSharedStorageHeaderReceivedCallback callback) {
std::move(callback).Run();
}

View File

@@ -60,7 +60,7 @@ void URLPipeLoader::NotifyComplete(int result) {
}
void URLPipeLoader::OnResponseStarted(
const GURL& final_url,
const GURL& /*final_url*/,
const network::mojom::URLResponseHead& response_head) {
mojo::ScopedDataPipeProducerHandle producer;
mojo::ScopedDataPipeConsumerHandle consumer;
@@ -93,7 +93,7 @@ void URLPipeLoader::OnDataReceived(std::string_view string_view,
std::move(resume)));
}
void URLPipeLoader::OnRetry(base::OnceClosure start_retry) {
void URLPipeLoader::OnRetry(base::OnceClosure /*start_retry*/) {
NOTREACHED();
}

View File

@@ -177,13 +177,14 @@ void LibnotifyNotification::Dismiss() {
}
void LibnotifyNotification::OnNotificationClosed(
NotifyNotification* notification) {
NotifyNotification* /*notification*/) {
NotificationDismissed(!on_dismissing_);
}
void LibnotifyNotification::OnNotificationView(NotifyNotification* notification,
char* action,
gpointer user_data) {
void LibnotifyNotification::OnNotificationView(
NotifyNotification* /*notification*/,
char* /*action*/,
gpointer user_data) {
LibnotifyNotification* that = static_cast<LibnotifyNotification*>(user_data);
DCHECK(that);
that->NotificationClicked();

View File

@@ -85,8 +85,8 @@ PlatformNotificationService::~PlatformNotificationService() = default;
void PlatformNotificationService::DisplayNotification(
content::RenderFrameHost* render_frame_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
const GURL& /*origin*/,
const GURL& /*document_url*/,
const blink::PlatformNotificationData& notification_data,
const blink::NotificationResources& notification_resources) {
auto* presenter = browser_client_->GetNotificationPresenter();

View File

@@ -358,13 +358,13 @@ gfx::Size OffScreenRenderWidgetHostView::GetVisibleViewportSize() {
}
blink::mojom::PointerLockResult OffScreenRenderWidgetHostView::LockPointer(
bool request_unadjusted_movement) {
bool /*request_unadjusted_movement*/) {
return blink::mojom::PointerLockResult::kUnsupportedOptions;
}
blink::mojom::PointerLockResult
OffScreenRenderWidgetHostView::ChangePointerLock(
bool request_unadjusted_movement) {
bool /*request_unadjusted_movement*/) {
return blink::mojom::PointerLockResult::kUnsupportedOptions;
}
@@ -397,7 +397,7 @@ void OffScreenRenderWidgetHostView::ResetFallbackToFirstNavigationSurface() {
void OffScreenRenderWidgetHostView::InitAsPopup(
content::RenderWidgetHostView* parent_host_view,
const gfx::Rect& bounds,
const gfx::Rect& anchor_rect) {
const gfx::Rect& /*anchor_rect*/) {
DCHECK_EQ(parent_host_view_, parent_host_view);
DCHECK_EQ(widget_type_, content::WidgetType::kPopup);
@@ -511,7 +511,7 @@ content::RenderWidgetHostViewBase*
OffScreenRenderWidgetHostView::CreateViewForWidget(
content::RenderWidgetHost* render_widget_host,
content::RenderWidgetHost* embedder_render_widget_host,
content::WebContentsView* web_contents_view) {
content::WebContentsView* /*web_contents_view*/) {
if (auto* rwhv = render_widget_host->GetView())
return static_cast<content::RenderWidgetHostViewBase*>(rwhv);

View File

@@ -162,7 +162,7 @@ void OffScreenVideoConsumer::OnFrameCaptured(
pixels,
media::VideoFrame::RowBytes(media::VideoFrame::Plane::kARGB,
info->pixel_format, info->coded_size.width()),
[](void* addr, void* context) {
[](void* /*addr*/, void* context) {
delete static_cast<FramePinner*>(context);
},
new FramePinner{std::move(mapping), std::move(callbacks)});

View File

@@ -111,12 +111,12 @@ void PrintViewManagerElectron::ScriptedPrint(
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintViewManagerElectron::SetupScriptedPrintPreview(
SetupScriptedPrintPreviewCallback callback) {
SetupScriptedPrintPreviewCallback /*callback*/) {
mojo::ReportBadMessage(kInvalidSetupScriptedPrintPreviewCall);
}
void PrintViewManagerElectron::ShowScriptedPrintPreview(
bool source_is_modifiable) {
bool /*source_is_modifiable*/) {
mojo::ReportBadMessage(kInvalidShowScriptedPrintPreviewCall);
}
@@ -125,8 +125,8 @@ void PrintViewManagerElectron::RequestPrintPreview(
mojo::ReportBadMessage(kInvalidRequestPrintPreviewCall);
}
void PrintViewManagerElectron::CheckForCancel(int32_t preview_ui_id,
int32_t request_id,
void PrintViewManagerElectron::CheckForCancel(int32_t /*preview_ui_id*/,
int32_t /*request_id*/,
CheckForCancelCallback callback) {
std::move(callback).Run(false);
}

View File

@@ -41,7 +41,7 @@
namespace electron {
gfx::Size GetDefaultPrinterDPI(const std::u16string& device_name) {
gfx::Size GetDefaultPrinterDPI(const std::u16string& /*device_name*/) {
#if BUILDFLAG(IS_MAC)
return gfx::Size(printing::kDefaultMacDpi, printing::kDefaultMacDpi);
#elif BUILDFLAG(IS_WIN)

View File

@@ -159,7 +159,7 @@ bool RelaunchAppWithHelper(const base::FilePath& helper,
return true;
}
int RelauncherMain(const content::MainFunctionParams& main_parameters) {
int RelauncherMain(const content::MainFunctionParams& /*main_parameters*/) {
const StringVector& argv = electron::ElectronCommandLine::argv();
if (argv.size() < 4 || argv[1] != kRelauncherTypeArg) {

View File

@@ -50,7 +50,7 @@ void RelauncherSynchronizeWithParent() {
parentWaiter.Wait();
}
int LaunchProgram(const StringVector& relauncher_args,
int LaunchProgram(const StringVector& /*relauncher_args*/,
const StringVector& argv) {
// Redirect the stdout of child process to /dev/null, otherwise after
// relaunch the child process will raise exception when writing to stdout.

View File

@@ -86,7 +86,7 @@ SerialChooserContext::~SerialChooserContext() {
void SerialChooserContext::GrantPortPermission(
const url::Origin& origin,
const device::mojom::SerialPortInfo& port,
content::RenderFrameHost* render_frame_host) {
content::RenderFrameHost* /*render_frame_host*/) {
port_info_.insert({port.token, port.Clone()});
if (CanStorePersistentEntry(port)) {
@@ -105,7 +105,7 @@ void SerialChooserContext::GrantPortPermission(
bool SerialChooserContext::HasPortPermission(
const url::Origin& origin,
const device::mojom::SerialPortInfo& port,
content::RenderFrameHost* render_frame_host) {
content::RenderFrameHost* /*render_frame_host*/) {
auto it = ephemeral_ports_.find(origin);
if (it != ephemeral_ports_.end()) {
const std::set<base::UnguessableToken>& ports = it->second;

View File

@@ -12,23 +12,23 @@ SpecialStoragePolicy::SpecialStoragePolicy() = default;
SpecialStoragePolicy::~SpecialStoragePolicy() = default;
bool SpecialStoragePolicy::IsStorageProtected(const GURL& origin) {
bool SpecialStoragePolicy::IsStorageProtected(const GURL& /*origin*/) {
return true;
}
bool SpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
bool SpecialStoragePolicy::IsStorageUnlimited(const GURL& /*origin*/) {
return true;
}
bool SpecialStoragePolicy::IsStorageDurable(const GURL& origin) {
bool SpecialStoragePolicy::IsStorageDurable(const GURL& /*origin*/) {
return true;
}
bool SpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
bool SpecialStoragePolicy::HasIsolatedStorage(const GURL& /*origin*/) {
return false;
}
bool SpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
bool SpecialStoragePolicy::IsStorageSessionOnly(const GURL& /*origin*/) {
return false;
}

View File

@@ -248,12 +248,12 @@ gfx::Rect AutofillPopup::popup_bounds_in_view() {
return {origin, popup_bounds_.size()};
}
void AutofillPopup::OnViewBoundsChanged(views::View* view) {
void AutofillPopup::OnViewBoundsChanged(views::View* /*view*/) {
UpdatePopupBounds();
view_->DoUpdateBoundsAndRedrawPopup();
}
void AutofillPopup::OnViewIsDeleting(views::View* view) {
void AutofillPopup::OnViewIsDeleting(views::View* /*view*/) {
Hide();
}

View File

@@ -19,8 +19,9 @@ namespace certificate_trust {
// store for the current user.
//
// This requires prompting the user to confirm they trust the certificate.
BOOL AddToTrustedRootStore(const PCCERT_CONTEXT cert_context,
const scoped_refptr<net::X509Certificate>& cert) {
BOOL AddToTrustedRootStore(
const PCCERT_CONTEXT cert_context,
const scoped_refptr<net::X509Certificate>& /*cert*/) {
auto* root_cert_store = CertOpenStore(
CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"Root");

View File

@@ -55,7 +55,7 @@ class TCPServerSocketFactory : public content::DevToolsSocketFactory {
return socket;
}
std::unique_ptr<net::ServerSocket> CreateForTethering(
std::string* name) override {
std::string* /*name*/) override {
return {};
}
@@ -103,7 +103,7 @@ DevToolsManagerDelegate::~DevToolsManagerDelegate() = default;
void DevToolsManagerDelegate::Inspect(content::DevToolsAgentHost* agent_host) {}
void DevToolsManagerDelegate::HandleCommand(
content::DevToolsAgentHostClientChannel* channel,
content::DevToolsAgentHostClientChannel* /*channel*/,
base::span<const uint8_t> message,
NotHandledCallback callback) {
crdtp::Dispatchable dispatchable(crdtp::SpanFrom(message));
@@ -124,8 +124,8 @@ void DevToolsManagerDelegate::HandleCommand(
}
scoped_refptr<content::DevToolsAgentHost>
DevToolsManagerDelegate::CreateNewTarget(const GURL& url,
TargetType target_type) {
DevToolsManagerDelegate::CreateNewTarget(const GURL& /*url*/,
TargetType /*target_type*/) {
return nullptr;
}

View File

@@ -87,7 +87,7 @@ std::string BundledDataSource::GetSource() {
void BundledDataSource::StartDataRequest(
const GURL& url,
const content::WebContents::Getter& wc_getter,
const content::WebContents::Getter& /*wc_getter*/,
GotDataCallback callback) {
const std::string path = content::URLDataSource::URLToRequestPath(url);
// Serve request from local bundle.

View File

@@ -47,7 +47,7 @@ void ElectronDesktopWindowTreeHostLinux::OnWidgetInitDone() {
}
gfx::Insets ElectronDesktopWindowTreeHostLinux::CalculateInsetsInDIP(
ui::PlatformWindowState window_state) const {
ui::PlatformWindowState /*window_state*/) const {
// If we are not showing frame, the insets should be zero.
if (native_window_view_->IsFullscreen()) {
return {};
@@ -142,7 +142,7 @@ void ElectronDesktopWindowTreeHostLinux::UpdateWindowState(
}
void ElectronDesktopWindowTreeHostLinux::OnNativeThemeUpdated(
ui::NativeTheme* observed_theme) {
ui::NativeTheme* /*observed_theme*/) {
UpdateFrameHints();
}

View File

@@ -133,7 +133,7 @@ class FileChooserDialog : public ui::SelectFileDialog::Listener {
}
// ui::SelectFileDialog::Listener
void FileSelected(const ui::SelectedFileInfo& file, int index) override {
void FileSelected(const ui::SelectedFileInfo& file, int /*index*/) override {
v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate();
v8::HandleScope scope(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);

View File

@@ -150,7 +150,8 @@ GURL GetDevToolsURL(bool can_dock) {
return GURL(url_string);
}
void OnOpenItemComplete(const base::FilePath& path, const std::string& result) {
void OnOpenItemComplete(const base::FilePath& path,
const std::string& /*result*/) {
platform_util::ShowItemInFolder(path);
}
@@ -816,8 +817,8 @@ void InspectableWebContents::DispatchProtocolMessageFromDevToolsFrontend(
}
void InspectableWebContents::SendJsonRequest(DispatchCallback callback,
const std::string& browser_id,
const std::string& url) {
const std::string& /*browser_id*/,
const std::string& /*url*/) {
std::move(callback).Run(nullptr);
}
@@ -898,7 +899,7 @@ void InspectableWebContents::HandleMessageFromDevToolsFrontend(
}
void InspectableWebContents::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host,
content::DevToolsAgentHost* /*agent_host*/,
base::span<const uint8_t> message) {
if (!frontend_loaded_)
return;
@@ -924,7 +925,7 @@ void InspectableWebContents::DispatchProtocolMessage(
}
void InspectableWebContents::RenderFrameHostChanged(
content::RenderFrameHost* old_host,
content::RenderFrameHost* /*old_host*/,
content::RenderFrameHost* new_host) {
if (new_host->GetParent())
return;
@@ -956,7 +957,7 @@ bool InspectableWebContents::HandleKeyboardEvent(
return !delegate || delegate->HandleKeyboardEvent(source, event);
}
void InspectableWebContents::CloseContents(content::WebContents* source) {
void InspectableWebContents::CloseContents(content::WebContents* /*source*/) {
// This is where the devtools closes itself (by clicking the x button).
CloseDevTools();
}

View File

@@ -55,7 +55,7 @@ class DevToolsWindowDelegate : public views::ClientView,
views::Widget* GetWidget() override { return widget_; }
const views::Widget* GetWidget() const override { return widget_; }
views::View* GetContentsView() override { return view_; }
views::ClientView* CreateClientView(views::Widget* widget) override {
views::ClientView* CreateClientView(views::Widget* /*widget*/) override {
return this;
}

Some files were not shown because too many files have changed in this diff Show More