0

Convert remaining WARN_UNUSED_RESULT to [[nodiscard]] in //content.

Bug: 1287045
Change-Id: Ied3bf1e46b233f4d9026bb0cd7167d6ce7d6a88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3402402
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961201}
This commit is contained in:
Daniel Cheng
2022-01-20 00:16:01 +00:00
committed by Chromium LUCI CQ
parent f374a655bc
commit e2ec1bf6dc
2 changed files with 5 additions and 12 deletions

@ -157,21 +157,14 @@
namespace content {
namespace {
// Specifying a prototype so that we can add the WARN_UNUSED_RESULT attribute.
// Executes the passed |script| in the frame specified by |render_frame_host|.
// If |result| is not NULL, stores the value that the evaluation of the script
// in |result|. Returns true on success.
[[nodiscard]] bool ExecuteScriptHelper(RenderFrameHost* render_frame_host,
const std::string& script,
bool user_gesture,
int32_t world_id,
std::unique_ptr<base::Value>* result);
// Executes the passed |script| in the frame specified by |render_frame_host|.
// If |result| is not NULL, stores the value that the evaluation of the script
// in |result|. Returns true on success.
bool ExecuteScriptHelper(RenderFrameHost* render_frame_host,
const std::string& script,
bool user_gesture,
int32_t world_id,
std::unique_ptr<base::Value>* result) {
std::unique_ptr<base::Value>* result) {
// TODO(lukasza): Only get messages from the specific |render_frame_host|.
DOMMessageQueue dom_message_queue(render_frame_host);

@ -354,7 +354,7 @@ class RenderFrameDeletedObserver : public WebContentsObserver {
// Overridden WebContentsObserver methods.
void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
// TODO(1267073): Add WARN_UNUSED_RESULT
// TODO(1267073): Add [[nodiscard]]
// Returns true if the frame was deleted before the timeout.
bool WaitUntilDeleted();
bool deleted() const;