Commit d14e6a0b authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in blink/renderer/core/loader/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: I5307cf82ed89c1afeec735418f406d303bbcc1c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401142Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806048}
parent 6e769c05
...@@ -209,7 +209,7 @@ bool SendBeaconCommon(const ScriptState& state, ...@@ -209,7 +209,7 @@ bool SendBeaconCommon(const ScriptState& state,
params.MutableOptions().initiator_info.name = params.MutableOptions().initiator_info.name =
fetch_initiator_type_names::kBeacon; fetch_initiator_type_names::kBeacon;
frame->Client()->DidDispatchPingLoader(request.Url()); frame->Client()->DidDispatchPingLoader(url);
Resource* resource = Resource* resource =
RawResource::Fetch(params, frame->DomWindow()->Fetcher(), nullptr); RawResource::Fetch(params, frame->DomWindow()->Fetcher(), nullptr);
return resource->GetStatus() != ResourceStatus::kLoadError; return resource->GetStatus() != ResourceStatus::kLoadError;
......
...@@ -1038,16 +1038,16 @@ void ThreadableLoader::LoadRequest( ...@@ -1038,16 +1038,16 @@ void ThreadableLoader::LoadRequest(
} }
} }
const mojom::RequestContextType request_context = request.GetRequestContext();
FetchParameters new_params(std::move(request), resource_loader_options); FetchParameters new_params(std::move(request), resource_loader_options);
DCHECK(!GetResource()); DCHECK(!GetResource());
checker_.WillAddClient(); checker_.WillAddClient();
if (request.GetRequestContext() == mojom::RequestContextType::VIDEO || if (request_context == mojom::RequestContextType::VIDEO ||
request.GetRequestContext() == mojom::RequestContextType::AUDIO) { request_context == mojom::RequestContextType::AUDIO) {
DCHECK(async_); DCHECK(async_);
RawResource::FetchMedia(new_params, resource_fetcher_, this); RawResource::FetchMedia(new_params, resource_fetcher_, this);
} else if (request.GetRequestContext() == } else if (request_context == mojom::RequestContextType::MANIFEST) {
mojom::RequestContextType::MANIFEST) {
DCHECK(async_); DCHECK(async_);
RawResource::FetchManifest(new_params, resource_fetcher_, this); RawResource::FetchManifest(new_params, resource_fetcher_, this);
} else if (async_) { } else if (async_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment