fix: modernize-use-nodiscard clang-tidy warnings (32-x-y backport) (#44846)
fix: modernize-use-nodiscard clang-tidy warnings (#44808)
This commit is contained in:
parent
d1639ccb79
commit
10e0ce0692
8 changed files with 14 additions and 13 deletions
|
@ -85,7 +85,7 @@ class ElectronPermissionManager::PendingRequest {
|
|||
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() {
|
||||
if (!callback_.is_null()) {
|
||||
|
|
|
@ -135,15 +135,16 @@ class ElectronDelegatedFrameHostClient
|
|||
ElectronDelegatedFrameHostClient& operator=(
|
||||
const ElectronDelegatedFrameHostClient&) = delete;
|
||||
|
||||
ui::Layer* DelegatedFrameHostGetLayer() const override {
|
||||
// content::DelegatedFrameHostClient
|
||||
[[nodiscard]] ui::Layer* DelegatedFrameHostGetLayer() const override {
|
||||
return view_->root_layer();
|
||||
}
|
||||
|
||||
bool DelegatedFrameHostIsVisible() const override {
|
||||
[[nodiscard]] bool DelegatedFrameHostIsVisible() const override {
|
||||
return view_->IsShowing();
|
||||
}
|
||||
|
||||
SkColor DelegatedFrameHostGetGutterColor() const override {
|
||||
[[nodiscard]] SkColor DelegatedFrameHostGetGutterColor() const override {
|
||||
if (view_->render_widget_host()->delegate() &&
|
||||
view_->render_widget_host()->delegate()->IsFullscreen()) {
|
||||
return SK_ColorWHITE;
|
||||
|
@ -156,7 +157,7 @@ class ElectronDelegatedFrameHostClient
|
|||
view_->render_widget_host()->DidProcessFrame(frame_token, activation_time);
|
||||
}
|
||||
|
||||
float GetDeviceScaleFactor() const override {
|
||||
[[nodiscard]] float GetDeviceScaleFactor() const override {
|
||||
return view_->GetDeviceScaleFactor();
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ class BufferDataSource : public mojo::DataPipeProducer::DataSource {
|
|||
|
||||
private:
|
||||
// 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 result;
|
||||
if (offset <= buffer_.size()) {
|
||||
|
|
|
@ -39,12 +39,12 @@ class ElectronPermissionMessageProvider
|
|||
const ElectronPermissionMessageProvider&) = delete;
|
||||
|
||||
// PermissionMessageProvider implementation.
|
||||
extensions::PermissionMessages GetPermissionMessages(
|
||||
[[nodiscard]] extensions::PermissionMessages GetPermissionMessages(
|
||||
const extensions::PermissionIDSet& permissions) const override {
|
||||
return extensions::PermissionMessages();
|
||||
}
|
||||
|
||||
bool IsPrivilegeIncrease(
|
||||
[[nodiscard]] bool IsPrivilegeIncrease(
|
||||
const extensions::PermissionSet& granted_permissions,
|
||||
const extensions::PermissionSet& requested_permissions,
|
||||
extensions::Manifest::Type extension_type) const override {
|
||||
|
@ -53,7 +53,7 @@ class ElectronPermissionMessageProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
extensions::PermissionIDSet GetAllPermissionIDs(
|
||||
[[nodiscard]] extensions::PermissionIDSet GetAllPermissionIDs(
|
||||
const extensions::PermissionSet& permissions,
|
||||
extensions::Manifest::Type extension_type) const override {
|
||||
return extensions::PermissionIDSet();
|
||||
|
|
|
@ -88,7 +88,7 @@ class RefCountedGlobal
|
|||
RefCountedGlobal(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
||||
: 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 {
|
||||
return v8::Local<T>::New(isolate, handle_);
|
||||
|
|
|
@ -18,7 +18,7 @@ class HeapSnapshotOutputStream : public v8::OutputStream {
|
|||
DCHECK(file_);
|
||||
}
|
||||
|
||||
bool IsComplete() const { return is_complete_; }
|
||||
[[nodiscard]] bool IsComplete() const { return is_complete_; }
|
||||
|
||||
// v8::OutputStream
|
||||
int GetChunkSize() override { return 65536; }
|
||||
|
|
|
@ -57,7 +57,7 @@ class SpellCheckClient::SpellcheckRequest {
|
|||
SpellcheckRequest& operator=(const SpellcheckRequest&) = delete;
|
||||
~SpellcheckRequest() = default;
|
||||
|
||||
const std::u16string& text() const { return text_; }
|
||||
[[nodiscard]] const std::u16string& text() const { return text_; }
|
||||
blink::WebTextCheckingCompletion* completion() { return completion_.get(); }
|
||||
std::vector<Word>& wordlist() { return word_list_; }
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ class ChromePdfInternalPluginDelegate final
|
|||
~ChromePdfInternalPluginDelegate() override = default;
|
||||
|
||||
// `pdf::PdfInternalPluginDelegate`:
|
||||
bool IsAllowedOrigin(const url::Origin& origin) const override {
|
||||
[[nodiscard]] bool IsAllowedOrigin(const url::Origin& origin) const override {
|
||||
return origin.scheme() == extensions::kExtensionScheme &&
|
||||
origin.host() == extension_misc::kPdfExtensionId;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue