fix: modernize-use-nodiscard clang-tidy warnings (#44833)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
5a0e1ccf73
commit
c0d1c3481a
9 changed files with 14 additions and 14 deletions
|
@ -86,7 +86,7 @@ class ElectronPermissionManager::PendingRequest {
|
||||||
return content::RenderFrameHost::FromID(render_frame_host_id_);
|
return content::RenderFrameHost::FromID(render_frame_host_id_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsComplete() const { return remaining_results_ == 0; }
|
[[nodiscard]] bool IsComplete() const { return remaining_results_ == 0; }
|
||||||
|
|
||||||
void RunCallback() {
|
void RunCallback() {
|
||||||
if (!callback_.is_null()) {
|
if (!callback_.is_null()) {
|
||||||
|
|
|
@ -135,15 +135,15 @@ class ElectronDelegatedFrameHostClient
|
||||||
const ElectronDelegatedFrameHostClient&) = delete;
|
const ElectronDelegatedFrameHostClient&) = delete;
|
||||||
|
|
||||||
// content::DelegatedFrameHostClient
|
// content::DelegatedFrameHostClient
|
||||||
ui::Layer* DelegatedFrameHostGetLayer() const override {
|
[[nodiscard]] ui::Layer* DelegatedFrameHostGetLayer() const override {
|
||||||
return view_->root_layer();
|
return view_->root_layer();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DelegatedFrameHostIsVisible() const override {
|
[[nodiscard]] bool DelegatedFrameHostIsVisible() const override {
|
||||||
return view_->IsShowing();
|
return view_->IsShowing();
|
||||||
}
|
}
|
||||||
|
|
||||||
SkColor DelegatedFrameHostGetGutterColor() const override {
|
[[nodiscard]] SkColor DelegatedFrameHostGetGutterColor() const override {
|
||||||
if (view_->render_widget_host()->delegate() &&
|
if (view_->render_widget_host()->delegate() &&
|
||||||
view_->render_widget_host()->delegate()->IsFullscreen()) {
|
view_->render_widget_host()->delegate()->IsFullscreen()) {
|
||||||
return SK_ColorWHITE;
|
return SK_ColorWHITE;
|
||||||
|
@ -156,7 +156,7 @@ class ElectronDelegatedFrameHostClient
|
||||||
view_->render_widget_host()->DidProcessFrame(frame_token, activation_time);
|
view_->render_widget_host()->DidProcessFrame(frame_token, activation_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
float GetDeviceScaleFactor() const override {
|
[[nodiscard]] float GetDeviceScaleFactor() const override {
|
||||||
return view_->GetDeviceScaleFactor();
|
return view_->GetDeviceScaleFactor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ class BufferDataSource : public mojo::DataPipeProducer::DataSource {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// mojo::DataPipeProducer::DataSource:
|
// mojo::DataPipeProducer::DataSource:
|
||||||
uint64_t GetLength() const override { return buffer_.size(); }
|
[[nodiscard]] uint64_t GetLength() const override { return buffer_.size(); }
|
||||||
ReadResult Read(uint64_t offset, base::span<char> buffer) override {
|
ReadResult Read(uint64_t offset, base::span<char> buffer) override {
|
||||||
ReadResult result;
|
ReadResult result;
|
||||||
if (offset <= buffer_.size()) {
|
if (offset <= buffer_.size()) {
|
||||||
|
|
|
@ -38,12 +38,12 @@ class ElectronPermissionMessageProvider
|
||||||
const ElectronPermissionMessageProvider&) = delete;
|
const ElectronPermissionMessageProvider&) = delete;
|
||||||
|
|
||||||
// PermissionMessageProvider implementation.
|
// PermissionMessageProvider implementation.
|
||||||
extensions::PermissionMessages GetPermissionMessages(
|
[[nodiscard]] extensions::PermissionMessages GetPermissionMessages(
|
||||||
const extensions::PermissionIDSet& permissions) const override {
|
const extensions::PermissionIDSet& permissions) const override {
|
||||||
return extensions::PermissionMessages();
|
return extensions::PermissionMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPrivilegeIncrease(
|
[[nodiscard]] bool IsPrivilegeIncrease(
|
||||||
const extensions::PermissionSet& granted_permissions,
|
const extensions::PermissionSet& granted_permissions,
|
||||||
const extensions::PermissionSet& requested_permissions,
|
const extensions::PermissionSet& requested_permissions,
|
||||||
extensions::Manifest::Type extension_type) const override {
|
extensions::Manifest::Type extension_type) const override {
|
||||||
|
@ -52,7 +52,7 @@ class ElectronPermissionMessageProvider
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions::PermissionIDSet GetAllPermissionIDs(
|
[[nodiscard]] extensions::PermissionIDSet GetAllPermissionIDs(
|
||||||
const extensions::PermissionSet& permissions,
|
const extensions::PermissionSet& permissions,
|
||||||
extensions::Manifest::Type extension_type) const override {
|
extensions::Manifest::Type extension_type) const override {
|
||||||
return extensions::PermissionIDSet();
|
return extensions::PermissionIDSet();
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct OffscreenReleaseHolderMonitor {
|
||||||
holder_ = nullptr;
|
holder_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsTextureReleased() const { return holder_ == nullptr; }
|
[[nodiscard]] bool IsTextureReleased() const { return holder_ == nullptr; }
|
||||||
|
|
||||||
v8::Persistent<v8::Value>* CreatePersistent(v8::Isolate* isolate,
|
v8::Persistent<v8::Value>* CreatePersistent(v8::Isolate* isolate,
|
||||||
v8::Local<v8::Value> value) {
|
v8::Local<v8::Value> value) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ class RefCountedGlobal
|
||||||
RefCountedGlobal(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
RefCountedGlobal(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
||||||
: handle_(isolate, value.As<T>()) {}
|
: handle_(isolate, value.As<T>()) {}
|
||||||
|
|
||||||
bool IsAlive() const { return !handle_.IsEmpty(); }
|
[[nodiscard]] bool IsAlive() const { return !handle_.IsEmpty(); }
|
||||||
|
|
||||||
v8::Local<T> NewHandle(v8::Isolate* isolate) const {
|
v8::Local<T> NewHandle(v8::Isolate* isolate) const {
|
||||||
return v8::Local<T>::New(isolate, handle_);
|
return v8::Local<T>::New(isolate, handle_);
|
||||||
|
|
|
@ -18,7 +18,7 @@ class HeapSnapshotOutputStream : public v8::OutputStream {
|
||||||
DCHECK(file_);
|
DCHECK(file_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsComplete() const { return is_complete_; }
|
[[nodiscard]] bool IsComplete() const { return is_complete_; }
|
||||||
|
|
||||||
// v8::OutputStream
|
// v8::OutputStream
|
||||||
int GetChunkSize() override { return 65536; }
|
int GetChunkSize() override { return 65536; }
|
||||||
|
|
|
@ -58,7 +58,7 @@ class SpellCheckClient::SpellcheckRequest {
|
||||||
SpellcheckRequest& operator=(const SpellcheckRequest&) = delete;
|
SpellcheckRequest& operator=(const SpellcheckRequest&) = delete;
|
||||||
~SpellcheckRequest() = default;
|
~SpellcheckRequest() = default;
|
||||||
|
|
||||||
const std::u16string& text() const { return text_; }
|
[[nodiscard]] const std::u16string& text() const { return text_; }
|
||||||
blink::WebTextCheckingCompletion* completion() { return completion_.get(); }
|
blink::WebTextCheckingCompletion* completion() { return completion_.get(); }
|
||||||
std::vector<Word>& wordlist() { return word_list_; }
|
std::vector<Word>& wordlist() { return word_list_; }
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ class ChromePdfInternalPluginDelegate final
|
||||||
~ChromePdfInternalPluginDelegate() override = default;
|
~ChromePdfInternalPluginDelegate() override = default;
|
||||||
|
|
||||||
// `pdf::PdfInternalPluginDelegate`:
|
// `pdf::PdfInternalPluginDelegate`:
|
||||||
bool IsAllowedOrigin(const url::Origin& origin) const override {
|
[[nodiscard]] bool IsAllowedOrigin(const url::Origin& origin) const override {
|
||||||
return origin.scheme() == extensions::kExtensionScheme &&
|
return origin.scheme() == extensions::kExtensionScheme &&
|
||||||
origin.host() == extension_misc::kPdfExtensionId;
|
origin.host() == extension_misc::kPdfExtensionId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue