Commit 0dd59657 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Chromium LUCI CQ

Fix use-after-move in //media/fuchsia/cdm/service/

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

Also add a new std::move() call in this file, to optimize
passing one of the arguments.

Bug: 1122844
Change-Id: I0526ff7b4b8b4e9c080cb56b54b020c31f240492
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563824
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834217}
parent 60ba6e42
......@@ -171,7 +171,6 @@ class FuchsiaCdmManager::KeySystemClient {
base::Optional<DataStoreId> data_store_id = GetDataStoreIdForPath(
std::move(storage_path), std::move(create_fetcher_callback));
if (!data_store_id) {
DLOG(ERROR) << "Unable to create DataStore for path: " << storage_path;
request.Close(ZX_ERR_NO_RESOURCES);
return;
}
......@@ -292,11 +291,12 @@ void FuchsiaCdmManager::CreateAndProvision(
base::FilePath storage_path = GetStoragePath(key_system, origin);
auto task = base::BindOnce(&CreateStorageDirectory, storage_path);
storage_task_runner_->PostTaskAndReplyWithResult(
FROM_HERE, base::BindOnce(&CreateStorageDirectory, storage_path),
FROM_HERE, std::move(task),
base::BindOnce(&FuchsiaCdmManager::CreateCdm, weak_factory_.GetWeakPtr(),
key_system, std::move(create_fetcher_cb),
std::move(request), storage_path));
std::move(request), std::move(storage_path)));
}
void FuchsiaCdmManager::set_on_key_system_disconnect_for_test_callback(
......
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