Commit eca0f995 authored by Hazim Mohamed's avatar Hazim Mohamed Committed by Commit Bot

[NativeFS] GetSharedHandleState receives file_system parameter by value

Changed GetSharedHandleState to receive file_system parameter
by value instead of by const reference in order to facilitate
moving the file_system into the returned SharedHandleState.

Bug: 1080811
Change-Id: I7ece64b5f36c5b7695308eef41512d49632a515a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248326Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Hazim Mohamed <hazimmohamed@google.com>
Cr-Commit-Position: refs/heads/master@{#779115}
parent 27cb859f
...@@ -417,7 +417,7 @@ void NativeFileSystemManagerImpl::DeserializeHandle( ...@@ -417,7 +417,7 @@ void NativeFileSystemManagerImpl::DeserializeHandle(
data.handle_type() == NativeFileSystemHandleData::kDirectory; data.handle_type() == NativeFileSystemHandleData::kDirectory;
SharedHandleState handle_state = GetSharedHandleStateForPath( SharedHandleState handle_state = GetSharedHandleStateForPath(
root_path, origin, root.file_system, root_path, origin, std::move(root.file_system),
is_directory || !relative_path.empty(), is_directory || !relative_path.empty(),
NativeFileSystemPermissionContext::UserAction::kLoadFromStorage); NativeFileSystemPermissionContext::UserAction::kLoadFromStorage);
...@@ -447,7 +447,8 @@ NativeFileSystemManagerImpl::CreateDirectoryEntryFromPath( ...@@ -447,7 +447,8 @@ NativeFileSystemManagerImpl::CreateDirectoryEntryFromPath(
auto url = CreateFileSystemURLFromPath(binding_context.origin, file_path); auto url = CreateFileSystemURLFromPath(binding_context.origin, file_path);
SharedHandleState shared_handle_state = GetSharedHandleStateForPath( SharedHandleState shared_handle_state = GetSharedHandleStateForPath(
file_path, binding_context.origin, url.file_system, /*is_directory=*/true, file_path, binding_context.origin, std::move(url.file_system),
/*is_directory=*/true,
NativeFileSystemPermissionContext::UserAction::kOpen); NativeFileSystemPermissionContext::UserAction::kOpen);
return blink::mojom::NativeFileSystemEntry::New( return blink::mojom::NativeFileSystemEntry::New(
...@@ -860,7 +861,7 @@ NativeFileSystemManagerImpl::CreateFileEntryFromPathImpl( ...@@ -860,7 +861,7 @@ NativeFileSystemManagerImpl::CreateFileEntryFromPathImpl(
auto url = CreateFileSystemURLFromPath(binding_context.origin, file_path); auto url = CreateFileSystemURLFromPath(binding_context.origin, file_path);
SharedHandleState shared_handle_state = GetSharedHandleStateForPath( SharedHandleState shared_handle_state = GetSharedHandleStateForPath(
file_path, binding_context.origin, url.file_system, file_path, binding_context.origin, std::move(url.file_system),
/*is_directory=*/false, user_action); /*is_directory=*/false, user_action);
return blink::mojom::NativeFileSystemEntry::New( return blink::mojom::NativeFileSystemEntry::New(
...@@ -873,7 +874,7 @@ NativeFileSystemManagerImpl::SharedHandleState ...@@ -873,7 +874,7 @@ NativeFileSystemManagerImpl::SharedHandleState
NativeFileSystemManagerImpl::GetSharedHandleStateForPath( NativeFileSystemManagerImpl::GetSharedHandleStateForPath(
const base::FilePath& path, const base::FilePath& path,
const url::Origin& origin, const url::Origin& origin,
const storage::IsolatedContext::ScopedFSHandle& file_system, storage::IsolatedContext::ScopedFSHandle file_system,
bool is_directory, bool is_directory,
NativeFileSystemPermissionContext::UserAction user_action) { NativeFileSystemPermissionContext::UserAction user_action) {
scoped_refptr<NativeFileSystemPermissionGrant> read_grant, write_grant; scoped_refptr<NativeFileSystemPermissionGrant> read_grant, write_grant;
......
...@@ -198,7 +198,7 @@ class CONTENT_EXPORT NativeFileSystemManagerImpl ...@@ -198,7 +198,7 @@ class CONTENT_EXPORT NativeFileSystemManagerImpl
SharedHandleState GetSharedHandleStateForPath( SharedHandleState GetSharedHandleStateForPath(
const base::FilePath& path, const base::FilePath& path,
const url::Origin& origin, const url::Origin& origin,
const storage::IsolatedContext::ScopedFSHandle& file_system, storage::IsolatedContext::ScopedFSHandle file_system,
bool is_directory, bool is_directory,
NativeFileSystemPermissionContext::UserAction user_action); NativeFileSystemPermissionContext::UserAction user_action);
......
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