Skip to content

Commit

Permalink
Remove unnecessary base::Passed() with base::BindOnce()
Browse files Browse the repository at this point in the history
The documentation on base::Callback<...> (src/docs/callback.md)
recommends against using base::Passed(...) with base::BindOnce.

> Avoid using `base::Passed()` with `base::BindOnce()`, as `std::move()`
> does the same thing and is more familiar.

This CL was uploaded by git cl split.

Bug: none
Change-Id: Ibf726d23f8aa00ffd38aad2de3e51f239731a807
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611885
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659865}
  • Loading branch information
sdefresne authored and Commit Bot committed May 15, 2019
1 parent 83aea0e commit 0237c3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions extensions/browser/api/alarms/alarm_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ AlarmManager::~AlarmManager() {
void AlarmManager::AddAlarm(const std::string& extension_id,
std::unique_ptr<Alarm> alarm,
AddAlarmCallback callback) {
RunWhenReady(
extension_id,
base::BindOnce(&AlarmManager::AddAlarmWhenReady, AsWeakPtr(),
base::Passed(std::move(alarm)), std::move(callback)));
RunWhenReady(extension_id,
base::BindOnce(&AlarmManager::AddAlarmWhenReady, AsWeakPtr(),
std::move(alarm), std::move(callback)));
}

void AlarmManager::GetAlarm(const std::string& extension_id,
Expand Down
5 changes: 2 additions & 3 deletions extensions/browser/api/execute_code_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ bool ExecuteCodeFunction::LoadFile(const std::string& file,
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
base::BindOnce(&ExecuteCodeFunction::
GetFileURLAndLocalizeComponentResourceInBackground,
this, base::Passed(std::move(data)), extension_id,
extension_path, extension_default_locale,
might_require_localization),
this, std::move(data), extension_id, extension_path,
extension_default_locale, might_require_localization),
base::BindOnce(&ExecuteCodeFunction::DidLoadAndLocalizeFile, this,
resource_.relative_path().AsUTF8Unsafe(),
true /* We assume this call always succeeds */));
Expand Down

0 comments on commit 0237c3c

Please sign in to comment.