Commit 46931e2d authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

Run modernize-emplace-back on chrome/browser/chromeos/extensions/file_manager

Steps I followed:

autoninja -C out/Default chrome

tools/clang/scripts/generate_compdb.py -p out/Default > compile_commands.json

cd out/Default

/usr/local/google/code/llvm/tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-p ../.. \
-clang-tidy-binary /usr/local/google/code/build/bin/clang-tidy \
-clang-apply-replacements-binary /usr/local/google/code/build/bin/clang-apply-replacements \
-checks=-*,modernize-emplace-back \
-header-filter=chrome/browser/chromeos/extensions/file_manager/* \
-fix chrome/browser/chromeos/extensions/file_manager

git cl format

No logic changes, No new tests.

Bug: 841659
Change-Id: Ie194e7cc68289e6ec8d04e699ba7bdaeed5c5c07
Reviewed-on: https://chromium-review.googlesource.com/1106580Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568562}
parent 39d36b0d
......@@ -249,20 +249,14 @@ IN_PROC_BROWSER_TEST_F(FileBrowserHandlerExtensionTest, EndToEnd) {
GetFullPathOnTmpMountPoint(base::FilePath("test_file.txt"));
std::vector<std::string> allowed_extensions;
allowed_extensions.push_back("txt");
allowed_extensions.push_back("html");
allowed_extensions.emplace_back("txt");
allowed_extensions.emplace_back("html");
std::vector<TestCase> test_cases;
test_cases.push_back(
TestCase(base::FilePath("some_file_name.txt"),
allowed_extensions,
true,
selected_path));
test_cases.push_back(
TestCase(base::FilePath("fail"),
std::vector<std::string>(),
false,
base::FilePath()));
test_cases.emplace_back(base::FilePath("some_file_name.txt"),
allowed_extensions, true, selected_path);
test_cases.emplace_back(base::FilePath("fail"), std::vector<std::string>(),
false, base::FilePath());
SetTestCases(&test_cases);
......
......@@ -61,7 +61,7 @@ bool FileManagerPrivateSelectFileFunction::RunAsync() {
EXTENSION_FUNCTION_VALIDATE(params);
std::vector<GURL> file_paths;
file_paths.push_back(GURL(params->selected_path));
file_paths.emplace_back(params->selected_path);
file_manager::util::GetSelectedFileInfoLocalPathOption option =
file_manager::util::NO_LOCAL_PATH_RESOLUTION;
......@@ -103,7 +103,7 @@ bool FileManagerPrivateSelectFilesFunction::RunAsync() {
std::vector<GURL> file_urls;
for (size_t i = 0; i < params->selected_paths.size(); ++i)
file_urls.push_back(GURL(params->selected_paths[i]));
file_urls.emplace_back(params->selected_paths[i]);
file_manager::util::GetSelectedFileInfo(
render_frame_host(),
......
......@@ -1504,7 +1504,7 @@ void FileManagerPrivateInternalGetDownloadUrlFunction::OnGotDownloadUrl(
SigninManagerFactory::GetForProfile(GetProfile());
const std::string& account_id = signin_manager->GetAuthenticatedAccountId();
std::vector<std::string> scopes;
scopes.push_back("https://www.googleapis.com/auth/drive.readonly");
scopes.emplace_back("https://www.googleapis.com/auth/drive.readonly");
auth_service_ = std::make_unique<google_apis::AuthService>(
oauth2_token_service, account_id, GetProfile()->GetRequestContext(),
......
......@@ -352,7 +352,7 @@ FileManagerPrivateRequestWebStoreAccessTokenFunction::
bool FileManagerPrivateRequestWebStoreAccessTokenFunction::RunAsync() {
std::vector<std::string> scopes;
scopes.push_back(kCWSScope);
scopes.emplace_back(kCWSScope);
ProfileOAuth2TokenService* oauth_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile());
......
......@@ -180,9 +180,9 @@ void FileManagerPrivateInternalGetFileTasksFunction::
std::unique_ptr<std::set<base::FilePath>> directory_paths) {
std::vector<EntryInfo> entries;
for (size_t i = 0; i < local_paths_.size(); ++i) {
entries.push_back(EntryInfo(
entries.emplace_back(
local_paths_[i], (*mime_types)[i],
directory_paths->find(local_paths_[i]) != directory_paths->end()));
directory_paths->find(local_paths_[i]) != directory_paths->end());
}
file_manager::file_tasks::FindAllTypesOfTasks(
......
......@@ -128,8 +128,7 @@ void GetSelectedFileInfoInternal(
switch (params->local_path_option) {
case NO_LOCAL_PATH_RESOLUTION:
// Pass empty local path.
params->selected_files.push_back(
ui::SelectedFileInfo(file_path, base::FilePath()));
params->selected_files.emplace_back(file_path, base::FilePath());
break;
case NEED_LOCAL_PATH_FOR_OPENING:
GetFileNativeLocalPathForOpening(
......@@ -149,8 +148,7 @@ void GetSelectedFileInfoInternal(
return; // Remaining work is done in ContinueGetSelectedFileInfo.
}
} else {
params->selected_files.push_back(
ui::SelectedFileInfo(file_path, file_path));
params->selected_files.emplace_back(file_path, file_path);
}
}
params->callback.Run(params->selected_files);
......@@ -167,7 +165,7 @@ void ContinueGetSelectedFileInfo(
}
const int index = params->selected_files.size();
const base::FilePath& file_path = params->file_paths[index];
params->selected_files.push_back(ui::SelectedFileInfo(file_path, local_path));
params->selected_files.emplace_back(file_path, local_path);
GetSelectedFileInfoInternal(profile, std::move(params));
}
......
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