Commit 8bc362c8 authored by Austin Sullivan's avatar Austin Sullivan Committed by Chromium LUCI CQ

Use make_unique for new FileSystemOperationContext

Currently uses raw pointers.

Bug: N/A
Change-Id: Ib1cfc799e349e54b3f931a27545c042a9f6137a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626096Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843224}
parent e8d459d5
...@@ -224,9 +224,9 @@ class BrowsingDataMediaLicenseHelperTest : public testing::Test { ...@@ -224,9 +224,9 @@ class BrowsingDataMediaLicenseHelperTest : public testing::Test {
filesystem_context_->CrackURL(GURL(root + file_name)); filesystem_context_->CrackURL(GURL(root + file_name));
storage::AsyncFileUtil* file_util = filesystem_context_->GetAsyncFileUtil( storage::AsyncFileUtil* file_util = filesystem_context_->GetAsyncFileUtil(
storage::kFileSystemTypePluginPrivate); storage::kFileSystemTypePluginPrivate);
std::unique_ptr<storage::FileSystemOperationContext> operation_context = std::unique_ptr<storage::FileSystemOperationContext> operation_context(
base::WrapUnique( std::make_unique<storage::FileSystemOperationContext>(
new storage::FileSystemOperationContext(filesystem_context_)); filesystem_context_));
operation_context->set_allowed_bytes_growth( operation_context->set_allowed_bytes_growth(
storage::QuotaManager::kNoLimit); storage::QuotaManager::kNoLimit);
file_util->EnsureFileExists( file_util->EnsureFileExists(
...@@ -253,9 +253,9 @@ class BrowsingDataMediaLicenseHelperTest : public testing::Test { ...@@ -253,9 +253,9 @@ class BrowsingDataMediaLicenseHelperTest : public testing::Test {
AwaitCompletionHelper await_completion; AwaitCompletionHelper await_completion;
storage::AsyncFileUtil* file_util = filesystem_context_->GetAsyncFileUtil( storage::AsyncFileUtil* file_util = filesystem_context_->GetAsyncFileUtil(
storage::kFileSystemTypePluginPrivate); storage::kFileSystemTypePluginPrivate);
std::unique_ptr<storage::FileSystemOperationContext> operation_context = std::unique_ptr<storage::FileSystemOperationContext> operation_context(
base::WrapUnique( std::make_unique<storage::FileSystemOperationContext>(
new storage::FileSystemOperationContext(filesystem_context_)); filesystem_context_));
file_util->Touch( file_util->Touch(
std::move(operation_context), file_url, time_stamp, time_stamp, std::move(operation_context), file_url, time_stamp, time_stamp,
base::BindOnce(&BrowsingDataMediaLicenseHelperTest::OnFileTouched, base::BindOnce(&BrowsingDataMediaLicenseHelperTest::OnFileTouched,
......
...@@ -283,8 +283,8 @@ storage::FileSystemOperation* MediaFileSystemBackend::CreateFileSystemOperation( ...@@ -283,8 +283,8 @@ storage::FileSystemOperation* MediaFileSystemBackend::CreateFileSystemOperation(
FileSystemContext* context, FileSystemContext* context,
base::File::Error* error_code) const { base::File::Error* error_code) const {
std::unique_ptr<storage::FileSystemOperationContext> operation_context( std::unique_ptr<storage::FileSystemOperationContext> operation_context(
new storage::FileSystemOperationContext(context, std::make_unique<storage::FileSystemOperationContext>(
MediaTaskRunner().get())); context, MediaTaskRunner().get()));
return storage::FileSystemOperation::Create(url, context, return storage::FileSystemOperation::Create(url, context,
std::move(operation_context)); std::move(operation_context));
} }
......
...@@ -359,7 +359,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges( ...@@ -359,7 +359,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges(
file_system_context->sandbox_delegate()->sync_file_util(); file_system_context->sandbox_delegate()->sync_file_util();
DCHECK(file_util); DCHECK(file_util);
std::unique_ptr<FileSystemOperationContext> context( std::unique_ptr<FileSystemOperationContext> context(
new FileSystemOperationContext(file_system_context)); std::make_unique<FileSystemOperationContext>(file_system_context));
base::File::Info file_info; base::File::Info file_info;
base::FilePath platform_path; base::FilePath platform_path;
......
...@@ -180,7 +180,7 @@ FileSystemOperation* PluginPrivateFileSystemBackend::CreateFileSystemOperation( ...@@ -180,7 +180,7 @@ FileSystemOperation* PluginPrivateFileSystemBackend::CreateFileSystemOperation(
FileSystemContext* context, FileSystemContext* context,
base::File::Error* error_code) const { base::File::Error* error_code) const {
std::unique_ptr<FileSystemOperationContext> operation_context( std::unique_ptr<FileSystemOperationContext> operation_context(
new FileSystemOperationContext(context)); std::make_unique<FileSystemOperationContext>(context));
return FileSystemOperation::Create(url, context, return FileSystemOperation::Create(url, context,
std::move(operation_context)); std::move(operation_context));
} }
...@@ -315,7 +315,7 @@ void PluginPrivateFileSystemBackend::GetOriginDetailsOnFileTaskRunner( ...@@ -315,7 +315,7 @@ void PluginPrivateFileSystemBackend::GetOriginDetailsOnFileTaskRunner(
"pluginprivate"); "pluginprivate");
std::unique_ptr<FileSystemOperationContext> operation_context( std::unique_ptr<FileSystemOperationContext> operation_context(
new FileSystemOperationContext(context)); std::make_unique<FileSystemOperationContext>(context));
// Determine the available plugin private filesystem directories for this // Determine the available plugin private filesystem directories for this
// origin. Currently the plugin private filesystem is only used by Encrypted // origin. Currently the plugin private filesystem is only used by Encrypted
......
...@@ -176,7 +176,7 @@ FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( ...@@ -176,7 +176,7 @@ FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation(
FileSystemContext* context, FileSystemContext* context,
base::File::Error* error_code) const { base::File::Error* error_code) const {
std::unique_ptr<FileSystemOperationContext> operation_context( std::unique_ptr<FileSystemOperationContext> operation_context(
new FileSystemOperationContext(context)); std::make_unique<FileSystemOperationContext>(context));
operation_context->set_update_observers(*GetUpdateObservers(url.type())); operation_context->set_update_observers(*GetUpdateObservers(url.type()));
operation_context->set_change_observers(*GetChangeObservers(url.type())); operation_context->set_change_observers(*GetChangeObservers(url.type()));
return FileSystemOperation::Create(url, context, return FileSystemOperation::Create(url, context,
......
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