Skip to content

Commit

Permalink
[CrossThreadHandle] Convert third_party/blink/renderer/core/loader/im…
Browse files Browse the repository at this point in the history
…age_loader.cc

This is part of a cleanup task to make memory safer when data isn't used
cross thread, but is instead merely passed to be used back again on the
originating thread. Design doc:
https://docs.google.com/document/d/1GIT0ysdQ84sGhIo1r9EscF_fFt93lmNVM_q4vvHj2FQ/edit#

Bug: 1377337
Change-Id: I5974439bfa936a2fab0cbbe7c9ba791468ed685e

fuzzer infra failure

No-Try: true
Change-Id: I5974439bfa936a2fab0cbbe7c9ba791468ed685e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4048060
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1075896}
  • Loading branch information
arichiv authored and Chromium LUCI CQ committed Nov 26, 2022
1 parent 9a33fb3 commit 5b76078
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion third_party/blink/renderer/core/loader/image_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h"
#include "third_party/blink/renderer/platform/heap/cross_thread_handle.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/attribution_header_constants.h"
Expand Down Expand Up @@ -227,7 +228,8 @@ void ImageLoader::DispatchDecodeRequestsIfComplete() {
frame->GetChromeClient().RequestDecode(
frame, image->PaintImageForCurrentFrame(),
WTF::BindOnce(&ImageLoader::DecodeRequestFinished,
WrapCrossThreadPersistent(this), request->request_id()));
MakeUnwrappingCrossThreadHandle(this),
request->request_id()));
request->NotifyDecodeDispatched();
++it;
}
Expand Down

0 comments on commit 5b76078

Please sign in to comment.